亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? srec2flash.c

?? ADAM2 sources (modified by Oleg)
?? C
字號:
/************************************************************************
 *
 *  srec2flash.c
 *
 *  Tool for conversion between srecord format and flash format
 *
 *  $Id: srec2flash.c,v 1.1.1.1 2002/08/06 20:52:00 sneha Exp $
 *
 * ######################################################################
 *
 * Copyright (C) 1999 MIPS Technologies, Inc. All rights reserved.
 *
 * Unpublished rights reserved under the Copyright Laws of the United
 * States of America.
 *
 * This document contains information that is confidential and proprietary
 * to MIPS Technologies, Inc. and may be disclosed only to those employees
 * of MIPS Technologies, Inc. with a need to know, or as otherwise
 * permitted in writing by MIPS Technologies, Inc. or a
 * contractually-authorized third party. Any copying, modifying, use or
 * disclosure of this information (in whole or in part) which is not
 * expressly permitted in writing by MIPS Technologies, Inc. or a
 * contractually-authorized third party is strictly prohibited. At a
 * minimum, this information is protected under trade secret and unfair
 * competition laws and the expression of the information contained herein
 * is protected under federal copyright laws. Violations thereof may
 * result in criminal penalties and fines.
 *
 * MIPS Technologies, Inc. or any contractually-authorized third party
 * reserves the right to change the information contained in this document
 * to improve function, design or otherwise. MIPS Technologies, Inc. does
 * not assume any liability arising out of the application or use of this
 * information. Any license under patent rights or any other intellectual
 * property rights owned by MIPS Technologies or third parties shall be
 * conveyed by MIPS Technologies, Inc. or any contractually-authorized
 * third party in a separate license agreement fully executed by the
 * parties.
 *
 * The information contained in this document constitutes "Commercial
 * Computer Software" or "Commercial Computer Software Documentation," as
 * described in FAR 12.212 for civilian agencies, and DFARS 227.7202 for
 * military agencies. This information may only be disclosed to the U.S.
 * Government, or to U.S. Government users, with prior written consent from
 * MIPS Technologies, Inc. or a contractually-authorized third party. Such
 * disclosure to the U.S. Government, or to U.S. Government users, shall
 * be subject to license terms and conditions at least as restrictive and
 * protective of the confidentiality of this information as the terms and
 * conditions used by MIPS Technologies, Inc. in its license agreements
 * covering this information.
 *
 ************************************************************************/


/************************************************************************
 *  Include files
 ************************************************************************/

#include <stdio.h>
#include <fcntl.h>
#include <ctype.h>
#include <string.h>

/************************************************************************
 *  Definitions
 ************************************************************************/

#define TOK	  " :\t"

#define WRITE	  0
#define FLUSH	  1
#define SECTORS	  128

/************************************************************************
 *  Static variables
 ************************************************************************/

static int		   bendian   = 1;  // -EB
static int		   wordsize  = 32; // -W32
static int		   padsize   = 32; // -P32
static int		   addr_bits = 20; // -S21
static unsigned long int   lines_since_addr = 0;
static unsigned int	   sector_erased[SECTORS];
static unsigned int	   sector_size;
static char		   pad[9];

/************************************************************************
 *  Static function prototypes
 ************************************************************************/

static void 
print_data(
    unsigned long int   addr, 
    char	        *byte, 
    int			action);

/************************************************************************
 *  Implementation : Static functions
 ************************************************************************/

static void 
print_data(
    unsigned long int    addr,		/* Byte address		  */
    char		 *byte,		/* Pointer to byte string */
    int			 action)	/* WRITE/FLUSH		  */
{
    static unsigned long   prev_addr;
    static unsigned long   cur_addr;
    static unsigned long   print_addr;
    static int		   first = 1;
    static unsigned char   word[9];
    int			   byte_no;

    /* Only react to flush if data is not all x */
    if( action == FLUSH )
    {
      if (first) return;
      if(strncmp(word,"xxxxxxxx",strlen(word))) 
      {
	  lines_since_addr++;
	  printf("%s%s\n",pad,word);
      }

      /* Pad the end of the file */
      while ((lines_since_addr & 15) != 0) 
      {
	  printf("f111c0de\n");
	  lines_since_addr++;
      }

      first   = 1;
      return;
    }

    /* Mask unwanted address bits */
    addr = (addr << 32-addr_bits) & 0xffffffff;
    addr = (addr >> 32-addr_bits);

    /* cur_addr is in the type dictated by wordsize */
    if (wordsize==32)     cur_addr = addr >> 2;
    else if(wordsize==16) cur_addr = addr >> 1;
    else                  cur_addr = addr >> 0; // trivial

    /* Initialize on first call */
    if(first)
    {
	if(wordsize==32)      strcpy(word, "00000000" );
	else if(wordsize==16) strcpy(word, "0000" );
	else                  strcpy(word, "00" );

        prev_addr = cur_addr;

	if (wordsize==32) print_addr = 4 * cur_addr;
	if (wordsize==16) print_addr = 2 * cur_addr;

	printf("@%.8x\n",print_addr);
	printf(">%.8x\n",print_addr);

	lines_since_addr = 0;

        first=0;
    }

    /* When current word is complete dump it */
    else if(cur_addr != prev_addr)
    {
        /* TBD : Check if we have to erase this sector */

	printf("%s%s\n",pad,word);

	/* Keep a count of how many lines we have written */
	lines_since_addr++;

	/* Re-initialize word string */
	if(wordsize==32)      strcpy(word, "00000000" );
	else if(wordsize==16) strcpy(word, "0000" );
	else                  strcpy(word, "00" );

	if (wordsize==32) print_addr = 4 * cur_addr;
	if (wordsize==16) print_addr = 2 * cur_addr;
	
        if ((cur_addr != prev_addr + 1L))
	{
	    /*  We're about to print a new address, so pad the previous
	     *  data to x16 lines 
	     */
	    while ((lines_since_addr & 15) != 0) 
	    {
	      printf("f111c0de\n");
	      lines_since_addr++;
	    }
	    lines_since_addr = 0;

	    printf("@%.8x\n",print_addr);
	    printf(">%.8x\n",print_addr);
	}

        prev_addr = cur_addr;
    }

    /*  Place the byte correctly in the word string.
     *  depends on endianess.
     */
    if(wordsize==32)       byte_no = (int) (addr % 4L); // 0, 1, 2, 3
    else if(wordsize==16)  byte_no = (int) (addr % 2L); // 0, 1
    else                   byte_no = (int) (addr % 1L); // 0

    if (!bendian && wordsize==32)      byte_no=byte_no ^ 3;
    else if (!bendian && wordsize==16) byte_no=byte_no ^ 1;

    word[2*byte_no]  =byte[0];
    word[2*byte_no+1]=byte[1];
}

/************************************************************************
 *  Implementation : Public functions
 ************************************************************************/

int 
main(
    int argc,
    char **argv)
{
    unsigned char	buf[258];
    unsigned char	no_bytes[3];
    unsigned char	addr_str[9];
    unsigned char	byte_str[3];
    unsigned char	commentstr[3] = "//";
    unsigned char	*buf_ptr,*end;
    FILE		*fdi,*fdo;
    unsigned long int	first_addr,last_addr,addr;
    int			i;
    int			sector;

    /* Do we have enough arguments */
    if (argc==1) 
    {
	printf("\n\nUsage:\n",argv[0]);
	printf("%s [-EL -EB -Sxx -W32 -W16 -W8 -P32 -P16] srecfile\n\n",argv[0]);
	printf("-EL : Formats data for little endian memory layout\n");
	printf("-EB : Formats data for big endian memory layout. [DEFAULT]\n");
	printf("-Sxx: Number of byte address bits. Legal range: 1-32. [DEFAULT -S20]. \n");
	printf("-W32: Formats data for a 32 bit wide memory. [DEFAULT]\n");
	printf("-W16: Formats data for a 16 bit wide memory\n");
	printf("-W8:  Formats data for a 8  bit wide memory\n");
	printf("-P32: Pad 'x' on data to get 32 bits data. Only applies to -W16 and -W8. [DEFAULT]\n");
	printf("-P16: Pad 'x' on data to get 16 bits data. Only applies to -W8.\n");
	exit(-1);
    }

    /* Process options */
    i=1;
    while( *argv[i] == '-' )
    {
	if      ( strcmp(  argv[i], "-EL" )   == 0 ) bendian=0;
	else if ( strcmp(  argv[i], "-EB" )   == 0 ) bendian=1;
	else if ( strcmp(  argv[i], "-W32" )  == 0 ) wordsize=32;
	else if ( strcmp(  argv[i], "-W16" )  == 0 ) wordsize=16;
	else if ( strcmp(  argv[i], "-W8" )   == 0 ) wordsize=8;
	else if ( strcmp(  argv[i], "-P32" )  == 0 ) padsize=32;
	else if ( strcmp(  argv[i], "-P16" )  == 0 ) padsize=16;
	else if ( strncmp( argv[i], "-S", 2 ) == 0 )
	{
	    addr_bits = atoi( &argv[i][2] );
	    if (addr_bits>32 || addr_bits<1)
	    {
		printf("Error: No of address bits (%d) out of range [1..32]\n",addr_bits);
		exit (-1);
	    }
	}
	else
	{
	    printf("Error: Unknown argument %s\n",argv[i]);
	    exit(-1);
	}

	i++;
    }

    strcpy(commentstr,"#");

    printf("# Reset the loader state machine.\n!R\n");

    /* Clear the erased record (all = not erased) */
    sector = 0;
    while (sector<SECTORS) 
    {
        sector_erased[sector++] = 0;
    }

    sector_size = 131072;

    /* Setup the pad field */
    if     (wordsize==8  && padsize==32) sprintf(pad, "00000000");
    else if(wordsize==8  && padsize==16) sprintf(pad, "00");
    else if(wordsize==16 && padsize==32) sprintf(pad, "0000");
    else pad[0]=0;

    /* Can we open input file ? */
    if ((fdi=fopen(argv[i],"r"))==(FILE *)0) 
    {
	printf("Can not open %s \n",argv[i]);
	exit(-1);
    }

    /* Now we are ready to read all the s-records */
    while (fgets(buf,200,fdi))
    {
	/* Ignore all entries that does not begin with S3 */
	if (strncmp(buf,"S3",2)) continue;

	/* Get number of bytes */
	strncpy(no_bytes,buf+2,2);
	no_bytes[2]=0;

	/* Get start byte address */
	strncpy(addr_str,buf+4,8);
	addr_str[8]=0;

	/* Get first/last address for this s-record line */
	first_addr = strtoul(addr_str,&end,16);
	last_addr  = strtoul(no_bytes,&end,16) + first_addr - 6L ;

	/* Point to first byte */
	buf_ptr = buf+12;

	/* Loop through all bytes in line */
	for(addr=first_addr; addr <= last_addr; addr++)
        {
	    /* Get byte as a string */
	    strncpy(byte_str,buf_ptr,2);
	    byte_str[2] = 0;
	    buf_ptr+=2;

	    /* Write data to output */
 	    print_data(addr,byte_str,WRITE);
         }
    }

    /* Flush output */
    print_data(0L,NULL,FLUSH);

    fclose(fdi);

    /* Finally make the boot vector info file */
    fdo=fopen("bcfg.flash","w");
    fprintf(fdo,"// srec2flash \n");
    fprintf(fdo,"// Boot configuration:\n");
    fprintf(fdo,"// %s %s\n",(bendian ? "-EB" : "-EL"),
		       (wordsize==8  ? "-W8"  :
                        wordsize==16 ? "-W16" : "-W32"));

    buf[0]=0;
    if(bendian) strcat(buf,"1");
    else        strcat(buf,"0");

    if(wordsize==32)      strcat(buf,"00");
    else if(wordsize==16) strcat(buf,"01");
    else                  strcat(buf,"10");

    fputs(buf,fdo);
    fclose(fdo);

    exit(0);
}




?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
97精品久久久午夜一区二区三区 | 久久久久久久久久看片| 日韩视频一区二区在线观看| 国产精品美女久久久久av爽李琼| 天天免费综合色| av不卡在线观看| 久久综合色一综合色88| 亚洲妇熟xx妇色黄| 99精品视频一区二区| 欧美一级二级在线观看| 一区二区三区中文字幕精品精品| 黄色日韩三级电影| 欧美猛男gaygay网站| 国产精品国产自产拍高清av| 精品一区二区综合| 欧美日本视频在线| 亚洲精品大片www| av中文一区二区三区| 久久久国产精华| 精品午夜久久福利影院| 日韩午夜av电影| 视频一区欧美精品| 欧美亚洲国产一区二区三区| 亚洲女同女同女同女同女同69| 国产成人高清视频| 中文字幕国产精品一区二区| 国产精品一区一区| 久久久不卡网国产精品一区| 久久97超碰色| 国产亚洲精品精华液| 国产成人免费av在线| 中文字幕电影一区| 成人一区二区三区中文字幕| 国产日韩欧美精品一区| 国产激情精品久久久第一区二区| 久久先锋影音av| 国产成人在线观看| 国产精品久久久久久久久快鸭| 国产aⅴ精品一区二区三区色成熟| 久久免费精品国产久精品久久久久| 久久99精品久久久久| 久久久无码精品亚洲日韩按摩| 国产伦精品一区二区三区免费迷| 亚洲一区二区三区美女| 色婷婷av一区二区三区软件 | 国产亚洲欧美色| 岛国精品一区二区| 亚洲乱码日产精品bd| 欧美日韩小视频| 美腿丝袜亚洲一区| 日本一区二区三区在线不卡 | 国产精品久久久久影院老司 | 国产一区二区三区在线观看免费 | 91麻豆精品国产91久久久使用方法 | 五月综合激情网| 日韩欧美的一区二区| 国产不卡一区视频| 一区二区三区日韩欧美精品| 欧美精品v国产精品v日韩精品| 久99久精品视频免费观看| 国产欧美日韩久久| 欧美日韩一区二区三区在线看| 另类小说欧美激情| 亚洲男人的天堂av| 日韩欧美一卡二卡| 色域天天综合网| 麻豆国产精品一区二区三区| 国产精品乱人伦| 制服丝袜亚洲精品中文字幕| 国产剧情在线观看一区二区| 亚洲欧美日韩久久| 3751色影院一区二区三区| 成人午夜av影视| 亚洲成av人片一区二区| 久久久久久久久久电影| 在线观看不卡一区| 国产成人av网站| 午夜精品aaa| 日韩理论片一区二区| 精品久久久影院| 欧美三级中文字| 成人免费看黄yyy456| 免费欧美在线视频| 一区二区三区日韩精品| 国产欧美日韩一区二区三区在线观看| 欧美视频在线观看一区| eeuss鲁片一区二区三区在线看| 日韩av一二三| 亚洲一区二区三区四区在线观看| 国产色91在线| 精品国产91亚洲一区二区三区婷婷| 在线观看精品一区| 91女厕偷拍女厕偷拍高清| 国产一区二区三区在线观看精品 | 国产日韩高清在线| 日韩一区二区视频| 欧美日本国产视频| 91高清视频免费看| 色噜噜狠狠色综合欧洲selulu| 国产一区二区在线电影| 麻豆成人免费电影| 日韩在线a电影| 亚洲一区精品在线| 一区二区在线观看视频| 成人欧美一区二区三区黑人麻豆| 国产午夜精品福利| 国产亚洲一区字幕| 国产蜜臀av在线一区二区三区| 精品久久久久av影院| 精品日韩在线观看| 欧美变态口味重另类| 欧美大度的电影原声| 日韩欧美的一区二区| 日韩精品在线一区二区| 日韩免费视频线观看| 精品国产91乱码一区二区三区| 欧美一级二级三级蜜桃| 日韩视频一区二区在线观看| 日韩精品一区二区三区视频在线观看 | 天堂av在线一区| 首页国产丝袜综合| 五月天视频一区| 免费观看30秒视频久久| 麻豆国产精品一区二区三区| 国产一区二区三区黄视频| 国产精品一区二区你懂的| 成人h动漫精品| 色老汉一区二区三区| 欧美午夜免费电影| 日韩一区二区在线看| 久久久精品国产免费观看同学| 欧美激情一区二区在线| 1区2区3区国产精品| 亚洲一区视频在线| 美女一区二区视频| 国产一区二区毛片| www.亚洲人| 欧美三级蜜桃2在线观看| 欧美一区二区三区成人| 国产日韩欧美麻豆| 亚洲影院免费观看| 久久精品国产精品青草| 成人黄色软件下载| 欧美精品日韩精品| 亚洲精品在线网站| 亚洲三级电影全部在线观看高清| 亚洲成人中文在线| 国产一区不卡视频| 色悠久久久久综合欧美99| 正在播放亚洲一区| 亚洲国产精品黑人久久久| 亚洲一区在线观看免费| 国产真实乱偷精品视频免| 一本大道久久a久久综合| 日韩一级在线观看| |精品福利一区二区三区| 亚洲成av人影院| 豆国产96在线|亚洲| 欧美精品久久一区二区三区| 欧美国产精品中文字幕| 亚洲va欧美va人人爽| 丁香五精品蜜臀久久久久99网站| 欧美午夜一区二区| 中文字幕在线播放不卡一区| 轻轻草成人在线| 色欧美日韩亚洲| 国产精品视频第一区| 免费在线观看日韩欧美| 日本韩国一区二区| 国产亚洲精品7777| 免费高清在线视频一区·| 在线看国产一区二区| 中文字幕av资源一区| 蜜桃视频一区二区三区在线观看| 色婷婷国产精品| 国产精品免费丝袜| 国产一区二区三区免费在线观看| 欧美色男人天堂| 一区二区三区中文在线观看| 波多野结衣在线一区| 久久夜色精品国产噜噜av| 手机精品视频在线观看| 91精彩视频在线观看| 中文字幕一区二区不卡| 国产成人日日夜夜| 久久综合给合久久狠狠狠97色69| 蜜臀久久99精品久久久久宅男| 欧美亚洲综合网| 一区二区三区中文字幕| 91年精品国产| 一区二区三区资源| 99在线精品观看| 最新高清无码专区| 99re成人在线| 国产精品色哟哟网站| 国产精品自拍网站| 国产午夜精品久久久久久免费视| 国产一区二区美女| 亚洲国产精品ⅴa在线观看| 国产伦精品一区二区三区免费|