⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 utility.lst

📁 基于摩托罗拉S12标准源程序 包括:SCIO,Timer
💻 LST
📖 第 1 页 / 共 5 页
字号:
  212:  * Return      : char
  213:  ********************************************************************/ 
  214:  byte rx_char0()
  215:  {

Function: rx_char0
Source  : D:\Code S12\Utility\S12 Ex5 EEPROM ICD\sources\utility.c
Options : -Env"GENPATH=D:\Code S12\Utility\S12 Ex5 EEPROM ICD;D:\Code S12\Utility\S12 Ex5 EEPROM ICD\bin;D:\Code S12\Utility\S12 Ex5 EEPROM ICD\cmd;D:\Code S12\Utility\S12 Ex5 EEPROM ICD\prm;D:\Code S12\Utility\S12 Ex5 EEPROM ICD\sources;D:\Metrowerks\CodeWarrior MOT_V1.2\lib\HC12c\LIB;D:\Metrowerks\CodeWarrior MOT_V1.2\lib\HC12c\SRC;D:\Metrowerks\CodeWarrior MOT_V1.2\lib\HC12c\INCLUDE" -Env"LIBPATH=D:\Metrowerks\CodeWarrior MOT_V1.2\lib\HC12c\INCLUDE" -Env"OBJPATH=D:\Code S12\Utility\S12 Ex5 EEPROM ICD\bin" -Env"TEXTPATH=D:\Code S12\Utility\S12 Ex5 EEPROM ICD\bin" -Lasm=%n.lst -ObjN="D:\Code S12\Utility\S12 Ex5 EEPROM ICD\S12_Ex5_EEPROM_ICD_Data\Flash_Application\ObjectCode\utility.c.o" -Ol0

  216:  	char data;
  217:  	
  218:  	while( (SC0SR1 & 0x20)==0);
  0000 4fcc20fc     BRCLR 204,#32,*+0 ;abs = 0000
  219:      data = SC0SR1;
  0004 d6cc         LDAB  204
  220:  	return(SC0DRL);
  0006 d6cf         LDAB  207
  221:  }
  0008 3d           RTS   
  222:  
  223:  /*******************************************************************
  224:  * Wait for receiving char subroutine
  225:  * Description : Waiting for rx char and display page information
  226:  *			  :
  227:  * Example     : N/A  
  228:  * Input 	  : menu_page
  229:  * Output	  : N/A
  230:  * Modify      : N/A
  231:  * Return      : char
  232:  ********************************************************************/ 
  233:  byte menurx_char0(char menu_page)
  234:  { 

Function: menurx_char0
Source  : D:\Code S12\Utility\S12 Ex5 EEPROM ICD\sources\utility.c
Options : -Env"GENPATH=D:\Code S12\Utility\S12 Ex5 EEPROM ICD;D:\Code S12\Utility\S12 Ex5 EEPROM ICD\bin;D:\Code S12\Utility\S12 Ex5 EEPROM ICD\cmd;D:\Code S12\Utility\S12 Ex5 EEPROM ICD\prm;D:\Code S12\Utility\S12 Ex5 EEPROM ICD\sources;D:\Metrowerks\CodeWarrior MOT_V1.2\lib\HC12c\LIB;D:\Metrowerks\CodeWarrior MOT_V1.2\lib\HC12c\SRC;D:\Metrowerks\CodeWarrior MOT_V1.2\lib\HC12c\INCLUDE" -Env"LIBPATH=D:\Metrowerks\CodeWarrior MOT_V1.2\lib\HC12c\INCLUDE" -Env"OBJPATH=D:\Code S12\Utility\S12 Ex5 EEPROM ICD\bin" -Env"TEXTPATH=D:\Code S12\Utility\S12 Ex5 EEPROM ICD\bin" -Lasm=%n.lst -ObjN="D:\Code S12\Utility\S12 Ex5 EEPROM ICD\S12_Ex5_EEPROM_ICD_Data\Flash_Application\ObjectCode\utility.c.o" -Ol0

  0000 37           PSHB  
  235:  	char data;
  236:  	
  237:  	while( (SC0SR1 & 0x20)==0)
  0001 2007         BRA   *+9 ;abs = 000a
  238:  	{
  239:  	  delay1();
  0003 0700         BSR   delay1
  240:  	  disp_info(menu_page);		//display corresponding menu info 
  0005 e680         LDAB  0,SP
  0007 160000       JSR   disp_info
  000a 4fcc20f5     BRCLR 204,#32,*-7 ;abs = 0003
  241:  	} 
  242:  	data = SC0SR1;
  000e d6cc         LDAB  204
  243:  	return(SC0DRL);
  0010 d6cf         LDAB  207
  244:  }
  0012 32           PULA  
  0013 3d           RTS   
  245:  
  246:  /*******************************************************************
  247:  * Check user abort data display subroutine
  248:  * Description : Checking whether user abort or not
  249:  *			  :
  250:  * Example     : N/A  
  251:  * Input 	  : SC0SR1 empty?
  252:  * Output	  : 3 2 (ascii)
  253:  * Modify      : N/A
  254:  * Return      : status [OK for (DOT or ESC) or NOTOK for others chars]
  255:  ********************************************************************/ 
  256:  byte check_user_abort()
  257:  {

Function: check_user_abort
Source  : D:\Code S12\Utility\S12 Ex5 EEPROM ICD\sources\utility.c
Options : -Env"GENPATH=D:\Code S12\Utility\S12 Ex5 EEPROM ICD;D:\Code S12\Utility\S12 Ex5 EEPROM ICD\bin;D:\Code S12\Utility\S12 Ex5 EEPROM ICD\cmd;D:\Code S12\Utility\S12 Ex5 EEPROM ICD\prm;D:\Code S12\Utility\S12 Ex5 EEPROM ICD\sources;D:\Metrowerks\CodeWarrior MOT_V1.2\lib\HC12c\LIB;D:\Metrowerks\CodeWarrior MOT_V1.2\lib\HC12c\SRC;D:\Metrowerks\CodeWarrior MOT_V1.2\lib\HC12c\INCLUDE" -Env"LIBPATH=D:\Metrowerks\CodeWarrior MOT_V1.2\lib\HC12c\INCLUDE" -Env"OBJPATH=D:\Code S12\Utility\S12 Ex5 EEPROM ICD\bin" -Env"TEXTPATH=D:\Code S12\Utility\S12 Ex5 EEPROM ICD\bin" -Lasm=%n.lst -ObjN="D:\Code S12\Utility\S12 Ex5 EEPROM ICD\S12_Ex5_EEPROM_ICD_Data\Flash_Application\ObjectCode\utility.c.o" -Ol0

  258:  	char data;
  259:  	
  260:  	if((SC0SR1 & 0x20)!=0)
  0000 4fcc200d     BRCLR 204,#32,*+17 ;abs = 0011
  261:      {
  262:         data=SC0DRL;
  0004 d6cf         LDAB  207
  263:         if(data==DOT||data==ESC)
  0006 c12e         CMPB  #46
  0008 2704         BEQ   *+6 ;abs = 000e
  000a c11b         CMPB  #27
  000c 2603         BNE   *+5 ;abs = 0011
  264:           return(OK);
  000e c601         LDAB  #1
  0010 3d           RTS   
  265:         else 
  266:           return(NOTOK);  
  267:      }
  268:      else
  269:        return(NOTOK);
  0011 c7           CLRB  
  270:  }
  0012 3d           RTS   
  271:  
  272:  /*******************************************************************
  273:  * Transmit out 1 char (ASCII) subroutine
  274:  * Description : Transmit out upper and lower 4 bit of char as ascii
  275:  *             : via RS232
  276:  *			  :
  277:  * Example     : 0x32  
  278:  * Input 	  : 0x32 (cdata)
  279:  * Output	  : 3 2 (ascii)
  280:  * Modify      : N/A
  281:  * Return      : void
  282:  ********************************************************************/ 
  283:  void send_asc(byte cdata)
  284:  {

Function: send_asc
Source  : D:\Code S12\Utility\S12 Ex5 EEPROM ICD\sources\utility.c
Options : -Env"GENPATH=D:\Code S12\Utility\S12 Ex5 EEPROM ICD;D:\Code S12\Utility\S12 Ex5 EEPROM ICD\bin;D:\Code S12\Utility\S12 Ex5 EEPROM ICD\cmd;D:\Code S12\Utility\S12 Ex5 EEPROM ICD\prm;D:\Code S12\Utility\S12 Ex5 EEPROM ICD\sources;D:\Metrowerks\CodeWarrior MOT_V1.2\lib\HC12c\LIB;D:\Metrowerks\CodeWarrior MOT_V1.2\lib\HC12c\SRC;D:\Metrowerks\CodeWarrior MOT_V1.2\lib\HC12c\INCLUDE" -Env"LIBPATH=D:\Metrowerks\CodeWarrior MOT_V1.2\lib\HC12c\INCLUDE" -Env"OBJPATH=D:\Code S12\Utility\S12 Ex5 EEPROM ICD\bin" -Env"TEXTPATH=D:\Code S12\Utility\S12 Ex5 EEPROM ICD\bin" -Lasm=%n.lst -ObjN="D:\Code S12\Utility\S12 Ex5 EEPROM ICD\S12_Ex5_EEPROM_ICD_Data\Flash_Application\ObjectCode\utility.c.o" -Ol0

  285:  	if(cdata>9)
  0000 c109         CMPB  #9
  0002 2303         BLS   *+5 ;abs = 0007
  286:  	  tx_char0(cdata+'0'+7);
  0004 cb37         ADDB  #55
  0006 8f           SKIP2 
  287:  	else
  288:  	  tx_char0(cdata+'0');	  	
  0007 cb30         ADDB  #48
  0009 060000       JMP   tx_char0
  289:  }
  290:  
  291:  /*******************************************************************
  292:  * Convert HEX to ASCII subroutine
  293:  * Description : Convert hex to ascii and send out via RS232
  294:  *			  :
  295:  * Example     : 0x32  
  296:  * Input 	  : 0x32 (cdata)
  297:  * Output	  : 3 2 (ascii)
  298:  * Modify      : N/A
  299:  * Return      : void
  300:  ********************************************************************/ 
  301:  void hex_asc(byte cdata)
  302:  {

Function: hex_asc
Source  : D:\Code S12\Utility\S12 Ex5 EEPROM ICD\sources\utility.c
Options : -Env"GENPATH=D:\Code S12\Utility\S12 Ex5 EEPROM ICD;D:\Code S12\Utility\S12 Ex5 EEPROM ICD\bin;D:\Code S12\Utility\S12 Ex5 EEPROM ICD\cmd;D:\Code S12\Utility\S12 Ex5 EEPROM ICD\prm;D:\Code S12\Utility\S12 Ex5 EEPROM ICD\sources;D:\Metrowerks\CodeWarrior MOT_V1.2\lib\HC12c\LIB;D:\Metrowerks\CodeWarrior MOT_V1.2\lib\HC12c\SRC;D:\Metrowerks\CodeWarrior MOT_V1.2\lib\HC12c\INCLUDE" -Env"LIBPATH=D:\Metrowerks\CodeWarrior MOT_V1.2\lib\HC12c\INCLUDE" -Env"OBJPATH=D:\Code S12\Utility\S12 Ex5 EEPROM ICD\bin" -Env"TEXTPATH=D:\Code S12\Utility\S12 Ex5 EEPROM ICD\bin" -Lasm=%n.lst -ObjN="D:\Code S12\Utility\S12 Ex5 EEPROM ICD\S12_Ex5_EEPROM_ICD_Data\Flash_Application\ObjectCode\utility.c.o" -Ol0

  0000 37           PSHB  
  303:  	send_asc((cdata>>4)&0x0f);
  0001 54           LSRB  
  0002 54           LSRB  
  0003 54           LSRB  
  0004 54           LSRB  
  0005 0700         BSR   send_asc
  304:  	send_asc((cdata)&0x0f);	
  0007 e680         LDAB  0,SP
  0009 c40f         ANDB  #15
  000b 0700         BSR   send_asc
  305:  }
  000d 32           PULA  
  000e 3d           RTS   
  306:  
  307:  /*******************************************************************
  308:  * Convert HEX to ASCII with additional spaces subroutine
  309:  * Description : Convert hex to ascii and send out spaces followed
  310:  *             : via RS232
  311:  *			  :
  312:  * Example     : 0x32  
  313:  * Input 	  : 0x32 (cdata), 3(space)
  314:  * Output	  : 3 2 _ _ _ (ascii)
  315:  * Modify      : N/A
  316:  * Return      : void
  317:  ********************************************************************/ 
  318:  void hex_asc_sp(byte cdata, byte space)
  319:  {

Function: hex_asc_sp
Source  : D:\Code S12\Utility\S12 Ex5 EEPROM ICD\sources\utility.c
Options : -Env"GENPATH=D:\Code S12\Utility\S12 Ex5 EEPROM ICD;D:\Code S12\Utility\S12 Ex5 EEPROM ICD\bin;D:\Code S12\Utility\S12 Ex5 EEPROM ICD\cmd;D:\Code S12\Utility\S12 Ex5 EEPROM ICD\prm;D:\Code S12\Utility\S12 Ex5 EEPROM ICD\sources;D:\Metrowerks\CodeWarrior MOT_V1.2\lib\HC12c\LIB;D:\Metrowerks\CodeWarrior MOT_V1.2\lib\HC12c\SRC;D:\Metrowerks\CodeWarrior MOT_V1.2\lib\HC12c\INCLUDE" -Env"LIBPATH=D:\Metrowerks\CodeWarrior MOT_V1.2\lib\HC12c\INCLUDE" -Env"OBJPATH=D:\Code S12\Utility\S12 Ex5 EEPROM ICD\bin" -Env"TEXTPATH=D:\Code S12\Utility\S12 Ex5 EEPROM ICD\bin" -Lasm=%n.lst -ObjN="D:\Code S12\Utility\S12 Ex5 EEPROM ICD\S12_Ex5_EEPROM_ICD_Data\Flash_Application\ObjectCode\utility.c.o" -Ol0

  0000 3b           PSHD  
  0001 37           PSHB  
  320:  	int	i;
  321:  	
  322:  	hex_asc(cdata);
  0002 e685         LDAB  5,SP
  0004 0700         BSR   hex_asc
  323:  	for (i=0;i<space;i++)
  0006 c7           CLRB  
  0007 87           CLRA  
  0008 6c81         STD   1,SP
  000a 200a         BRA   *+12 ;abs = 0016
  324:  		tx_char0(' ');
  000c c620         LDAB  #32
  000e 160000       JSR   tx_char0
  0011 ee81         LDX   1,SP
  0013 08           INX   
  0014 6e81         STX   1,SP
  0016 e680         LDAB  0,SP
  0018 87           CLRA  
  0019 ac81         CPD   1,SP
  001b 2eef         BGT   *-15 ;abs = 000c
  325:  }
  001d 1b83         LEAS  3,SP
  001f 3d           RTS   
  326:  
  327:  /*******************************************************************
  328:  * Input int (dec) subroutine
  329:  * Description : Get the data(word) from user   
  330:  *             :   
  331:  *			  :
  332:  * Example     : N/A 
  333:  * Input 	  : N/A
  334:  * Output	  : *i_ptr
  335:  * Modify      : N/A
  336:  * Return      : status [OK for ('0'-'z') or NOTOK for others chars]
  337:  *********************************************************************/ 
  338:  byte input_int(unsigned int *i_ptr) //3046
  339:  {

Function: input_int
Source  : D:\Code S12\Utility\S12 Ex5 EEPROM ICD\sources\utility.c
Options : -Env"GENPATH=D:\Code S12\Utility\S12 Ex5 EEPROM ICD;D:\Code S12\Utility\S12 Ex5 EEPROM ICD\bin;D:\Code S12\Utility\S12 Ex5 EEPROM ICD\cmd;D:\Code S12\Utility\S12 Ex5 EEPROM ICD\prm;D:\Code S12\Utility\S12 Ex5 EEPROM ICD\sources;D:\Metrowerks\CodeWarrior MOT_V1.2\lib\HC12c\LIB;D:\Metrowerks\CodeWarrior MOT_V1.2\lib\HC12c\SRC;D:\Metrowerks\CodeWarrior MOT_V1.2\lib\HC12c\INCLUDE" -Env"LIBPATH=D:\Metrowerks\CodeWarrior MOT_V1.2\lib\HC12c\INCLUDE" -Env"OBJPATH=D:\Code S12\Utility\S12 Ex5 EEPROM ICD\bin" -Env"TEXTPATH=D:\Code S12\Utility\S12 Ex5 EEPROM ICD\bin" -Lasm=%n.lst -ObjN="D:\Code S12\Utility\S12 Ex5 EEPROM ICD\S12_Ex5_EEPROM_ICD_Data\Flash_Application\ObjectCode\utility.c.o" -Ol0

  0000 3b           PSHD  
  0001 1b91         LEAS  -15,SP
  340:  	byte		echo,cdata,loop=ENABLE;	
  0003 c601         LDAB  #1
  0005 6b8b         STAB  11,SP
  341:  	int			count=0,i,j;
  0007 c7           CLRB  
  0008 87           CLRA  
  0009 6c82         STD   2,SP
  342:  	unsigned int	i_data,i_data1,i_data2;
  343:  	
  344:  	
  345:  	i_data=0;
  000b 6c80         STD   0,SP
  346:  	*i_ptr=0;
  000d ee8f         LDX   15,SP
  000f 6c00         STD   0,X
  347:  	
  348:  	while(loop == ENABLE)
  0011 206c         BRA   *+110 ;abs = 007f
  349:  	{
  350:  	  echo=rx_char0();
  0013 0700         BSR   rx_char0
  0015 6b86         STAB  6,SP
  351:  	  if((echo==ESC)||(echo==DOT)||(echo==CR)) 
  0017 c11b         CMPB  #27
  0019 2708         BEQ   *+10 ;abs = 0023
  001b c12e         CMPB  #46
  001d 2704         BEQ   *+6 ;abs = 0023
  001f c10d         CMPB  #13
  0021 2602         BNE   *+4 ;abs = 0025
  352:  	    loop = DISABLE;			//break the while loop		
  0023 698b         CLR   11,SP
  353:        if (echo==BS || echo==DEL)
  0025 c108         CMPB  #8
  0027 2704         BEQ   *+6 ;abs = 002d
  0029 c17f         CMPB  #127
  002b 2620         BNE   *+34 ;abs = 004d
  354:        {
  355:         	if(count>0) 			//del 4 bit data in buffer
  002d ec82         LDD   2,SP
  002f 2f1c         BLE   *+30 ;abs = 004d
  356:         	{
  357:         	  count--;
  0031 830001       SUBD  #1
  0034 6c82         STD   2,SP
  358:         	  i_data=i_data>>4;
  0036 ec80         LDD   0,SP
  0038 49           LSRD  
  0039 49           LSRD  
  003a 49           LSRD  
  003b 49           LSRD  
  003c 6c80         STD   0,SP
  359:  	      tx_char0(echo);		//send bs the char on screen
  003e e686         LDAB  6,SP
  0040 160000       JSR   tx_char0
  360:  	      tx_char0(' ');		//send space to clear the char
  0043 c620         LDAB  #32
  0045 160000       JSR   tx_char0
  361:  	      tx_char0(echo);		//send bs again to move back the cursor
  0048 e686         LDAB  6,SP
  004a 160000       JSR   tx_char0
  362:  	    }
  363:        }
  364:        if (count<4)				//update 4 bit data to buffer
  004d ec82         LDD   2,SP
  004f 8c0004       CPD   #4
  0052 2c2b         BGE   *+45 ;abs = 007f
  365:        {
  366:  	    if((echo<='9') && (echo>='0')) 
  0054 e686         LDAB  6,SP
  0056 c139         CMPB  #57
  0058 2225         BHI   *+39 ;abs = 007f
  005a c130         CMPB  #48
  005c 2521         BCS   *+35 ;abs = 007f
  367:  	    {
  368:  	      if ((echo>='0') && (echo<='9'))
  005e c139         CMPB  #57
  0060 2204         BHI   *+6 ;abs = 0066
  369:  	  	    cdata=echo-0x30; 
  0062 c030         SUBB  #48
  0064 6b8e         STAB  14,SP
  370:  	      count++; 
  0066 ee82         LDX   2,SP
  0068 08           INX   
  0069 6e82         STX   2,SP
  371:  	      tx_char0(echo);			//send echo to screen

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -