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

📄 level4.lst

📁 此程序为利用mage8 AVR 和EM4094实现读取ISO15693类型卡的C程序、读卡稳定、这个项目我们做了好久、非常不错的程序、很适合做这方面产品的朋友们参考
💻 LST
📖 第 1 页 / 共 5 页
字号:
GAS LISTING C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccyKbaaa.s 			page 1


   1               		.file	"level4.c"
   2               		.arch atmega8
   3               	__SREG__ = 0x3f
   4               	__SP_H__ = 0x3e
   5               	__SP_L__ = 0x3d
   6               	__tmp_reg__ = 0
   7               	__zero_reg__ = 1
   8               		.global __do_copy_data
   9               		.global __do_clear_bss
  10               		.stabs	"E:\\PROJECT_GCC\\ISO15693_OK/",100,0,0,.Ltext0
  11               		.stabs	"level4.c",100,0,0,.Ltext0
  12               		.text
  13               	.Ltext0:
  14               		.stabs	"gcc2_compiled.",60,0,0,0
  15               		.stabs	"int:t(0,1)=r(0,1);-32768;32767;",128,0,0,0
  16               		.stabs	"char:t(0,2)=@s8;r(0,2);0;255;",128,0,0,0
  17               		.stabs	"long int:t(0,3)=@s32;r(0,3);0020000000000;0017777777777;",128,0,0,0
  18               		.stabs	"unsigned int:t(0,4)=r(0,4);0000000000000;0000000177777;",128,0,0,0
  19               		.stabs	"long unsigned int:t(0,5)=@s32;r(0,5);0000000000000;0037777777777;",128,0,0,0
  20               		.stabs	"long long int:t(0,6)=@s64;r(0,6);01000000000000000000000;0777777777777777777777;",128,0,0,
  21               		.stabs	"long long unsigned int:t(0,7)=@s64;r(0,7);0000000000000;01777777777777777777777;",128,0,0,
  22               		.stabs	"short int:t(0,8)=r(0,8);-32768;32767;",128,0,0,0
  23               		.stabs	"short unsigned int:t(0,9)=r(0,9);0000000000000;0000000177777;",128,0,0,0
  24               		.stabs	"signed char:t(0,10)=@s8;r(0,10);-128;127;",128,0,0,0
  25               		.stabs	"unsigned char:t(0,11)=@s8;r(0,11);0;255;",128,0,0,0
  26               		.stabs	"float:t(0,12)=r(0,1);4;0;",128,0,0,0
  27               		.stabs	"double:t(0,13)=r(0,1);4;0;",128,0,0,0
  28               		.stabs	"long double:t(0,14)=r(0,1);4;0;",128,0,0,0
  29               		.stabs	"complex int:t(0,15)=s4real:(0,1),0,16;imag:(0,1),16,16;;",128,0,0,0
  30               		.stabs	"complex float:t(0,16)=R3;8;0;",128,0,0,0
  31               		.stabs	"complex double:t(0,17)=R3;8;0;",128,0,0,0
  32               		.stabs	"complex long double:t(0,18)=R3;8;0;",128,0,0,0
  33               		.stabs	"__builtin_va_list:t(0,19)=*(0,20)=(0,20)",128,0,0,0
  34               		.stabs	"_Bool:t(0,21)=@s8;-16;",128,0,0,0
  35               		.stabs	"level4.c",130,0,0,0
  36               		.stabs	"C:/WinAVR/avr/include/avr/io.h",130,0,0,0
  37               		.stabs	"C:/WinAVR/avr/include/avr/sfr_defs.h",130,0,0,0
  38               		.stabs	"C:/WinAVR/avr/include/inttypes.h",130,0,0,0
  39               		.stabs	"int8_t:t(4,1)=(0,10)",128,0,67,0
  40               		.stabs	"uint8_t:t(4,2)=(0,11)",128,0,72,0
  41               		.stabs	"int16_t:t(4,3)=(0,1)",128,0,90,0
  42               		.stabs	"uint16_t:t(4,4)=(0,4)",128,0,95,0
  43               		.stabs	"int32_t:t(4,5)=(0,3)",128,0,106,0
  44               		.stabs	"uint32_t:t(4,6)=(0,5)",128,0,111,0
  45               		.stabs	"int64_t:t(4,7)=(0,6)",128,0,124,0
  46               		.stabs	"uint64_t:t(4,8)=(0,7)",128,0,129,0
  47               		.stabs	"intptr_t:t(4,9)=(4,3)",128,0,141,0
  48               		.stabs	"uintptr_t:t(4,10)=(4,4)",128,0,146,0
  49               		.stabn	162,0,0,0
  50               		.stabn	162,0,0,0
  51               		.stabs	"C:/WinAVR/avr/include/avr/iom8.h",130,0,0,0
  52               		.stabn	162,0,0,0
  53               		.stabs	"C:/WinAVR/avr/include/avr/portpins.h",130,0,0,0
  54               		.stabn	162,0,0,0
  55               		.stabn	162,0,0,0
  56               		.stabs	"C:/WinAVR/avr/include/avr/interrupt.h",130,0,0,0
  57               		.stabn	162,0,0,0
GAS LISTING C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccyKbaaa.s 			page 2


  58               		.stabs	"C:/WinAVR/avr/include/avr/signal.h",130,0,0,0
  59               		.stabn	162,0,0,0
  60               		.stabs	"C:/WinAVR/avr/include/avr/wdt.h",130,0,0,0
  61               		.stabn	162,0,0,0
  62               		.stabs	"level4.h",130,0,0,0
  63               		.stabn	162,0,0,0
  64               		.stabs	"level3.h",130,0,0,0
  65               		.stabn	162,0,0,0
  66               		.stabs	"level2.h",130,0,0,0
  67               		.stabs	"TCAPTURE:T(12,1)=s256capture_data:(12,2)=ar(12,3)=r(12,3);0000000000000;0000000177777;;0;1
  68               		.stabs	"TCAPTURE:t(12,4)=(12,1)",128,0,89,0
  69               		.stabn	162,0,0,0
  70               		.stabs	"level1.h",130,0,0,0
  71               		.stabn	162,0,0,0
  72               		.stabs	"UARTIni:F(0,20)",36,0,89,UARTIni
  73               	.global	UARTIni
  74               		.type	UARTIni, @function
  75               	UARTIni:
   1:level4.c      **** 
   2:level4.c      **** 
   3:level4.c      **** #include <avr/io.h>
   4:level4.c      **** #include <inttypes.h>
   5:level4.c      **** #include <avr/interrupt.h>
   6:level4.c      **** #include <avr/signal.h>
   7:level4.c      **** #include <avr/wdt.h>
   8:level4.c      **** #include "level4.h"
   9:level4.c      **** #include "level3.h"
  10:level4.c      **** #include "level2.h"
  11:level4.c      **** #include "level1.h"
  12:level4.c      **** 
  13:level4.c      **** //--------------------------------------------------------------
  14:level4.c      **** //global declarations
  15:level4.c      **** 
  16:level4.c      **** 
  17:level4.c      **** uint8_t volatile uart_command;          // command handshake value
  18:level4.c      ****                                         // set by UART RECV
  19:level4.c      ****                                         // reset by main() when done
  20:level4.c      **** 
  21:level4.c      **** uint8_t cmd_message[ 32 ];                // maximum
  22:level4.c      **** uint8_t cmd_message_len;                // length of current cmd_message
  23:level4.c      **** uint8_t message_flags;                  // current message flags 
  24:level4.c      **** uint8_t expectedResponseLen;            // expected number of response bits
  25:level4.c      **** 
  26:level4.c      **** uint8_t read_tag_memory_word_flags;     // first byte of message
  27:level4.c      **** uint8_t read_tag_memory_word_address;   // address of Read cmd
  28:level4.c      **** uint8_t read_tag_memory_word_blocks;    // number of blocks to send
  29:level4.c      **** 
  30:level4.c      **** uint16_t read_tag_memory_word_low;      // Read Cmd content low
  31:level4.c      **** uint16_t read_tag_memory_word_hi;       // Read Cmd content hi
  32:level4.c      **** 
  33:level4.c      **** uint16_t write_tag_memory_word_address; // address of Write Tag cmd
  34:level4.c      **** uint16_t write_tag_memory_word_low;     // low word of Write Tag cmd
  35:level4.c      **** uint16_t write_tag_memory_word_hi;      // hi word of Write Tag cmd
  36:level4.c      **** uint16_t write_tag_memory_delay;        // time delay before eof/response
  37:level4.c      **** 
  38:level4.c      **** uint16_t write_tag_memory_login_low;    // low word of Login cmd
  39:level4.c      **** uint16_t write_tag_memory_login_hi;     // hi word of Login cmd
GAS LISTING C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccyKbaaa.s 			page 3


  40:level4.c      **** 
  41:level4.c      **** uint16_t read_only_word_low;            // Read Only Cmd content low
  42:level4.c      **** uint16_t read_only_word_hi;             // Read Only Cmd content hi
  43:level4.c      **** 
  44:level4.c      **** uint16_t write_4094_low;                // low word of SPI configuration word
  45:level4.c      **** uint16_t write_4094_hi;                 // hi word of SPI configuration word
  46:level4.c      **** 
  47:level4.c      **** 
  48:level4.c      **** uint8_t * read_ptr;                     //debug capture pulse lengths uart data pointer
  49:level4.c      **** uint8_t volatile read_pos;              //debug capture pulse lengths uart read counter
  50:level4.c      **** 
  51:level4.c      **** uint8_t debug_mode;
  52:level4.c      **** 
  53:level4.c      **** uint8_t tx_number;           //received data byte number of raw data from PC;
  54:level4.c      **** uint8_t rx_number;
  55:level4.c      **** 
  56:level4.c      **** uint8_t uart_in_command;
  57:level4.c      **** uint8_t uart_in_param;
  58:level4.c      **** uint8_t valid_data_flag ;
  59:level4.c      **** //--------------------------------------------------------------
  60:level4.c      **** //local declarations
  61:level4.c      **** 
  62:level4.c      **** register uint8_t captured_byte asm ("r6");      //store_bit current capture bits
  63:level4.c      **** register uint8_t captured_valid asm ("r7");     //store_bit current capture valid bits
  64:level4.c      **** register uint8_t capture_cnt asm ("r8");        //store_bit current capture byte index
  65:level4.c      **** register uint8_t captured_bit_count asm ("r9"); //store_bit current capture bit counter
  66:level4.c      **** 
  67:level4.c      **** #define UART_IN_BUFFER_SIZE  32         // incoming data uart buffer reserved size
  68:level4.c      **** 
  69:level4.c      **** void Copy(uint8_t *dst , uint8_t *src , uint8_t len);
  70:level4.c      **** void SendByte( uint8_t byte );
  71:level4.c      **** void Send_Weigan0( void );
  72:level4.c      **** void Send_Weigan1( void );
  73:level4.c      **** void Send_Weigan26( uint8_t * data );
  74:level4.c      **** void Send_Weigan34( uint8_t * data );
  75:level4.c      **** void Send_Weigan36( uint8_t * data );
  76:level4.c      **** void Send_Weigan44( uint8_t * data );
  77:level4.c      **** void Send_9600( uint8_t * data );
  78:level4.c      **** void Send_Card_ID( uint8_t format , uint8_t *data );
  79:level4.c      **** 
  80:level4.c      **** 
  81:level4.c      **** 
  82:level4.c      ****  
  83:level4.c      **** 
  84:level4.c      **** 
  85:level4.c      **** // ==================================================================
  86:level4.c      **** // uart init routine
  87:level4.c      **** 
  88:level4.c      **** void UARTIni( void ) 
  89:level4.c      **** {
  76               		.stabn 68,0,89,.LM1-UARTIni
  77               	.LM1:
  78               	/* prologue: frame size=0 */
  79               	/* prologue end (size=0) */
  90:level4.c      ****    // UCSRA is not necessary to set up, using initial valuses         
  91:level4.c      ****    // no double transmission speed, no multi-processor mode           
  92:level4.c      **** 
GAS LISTING C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccyKbaaa.s 			page 4


  93:level4.c      ****     UCSRB  = ( 1 << RXCIE ) | ( 0 << UDRIE) | ( 1 << RXEN ) | ( 1 << TXEN ); 
  80               		.stabn 68,0,93,.LM2-UARTIni
  81               	.LM2:
  82 0000 88E9      		ldi r24,lo8(-104)
  83 0002 8AB9      		out 42-0x20,r24
  94:level4.c      ****                        // set up : RXCIE, UDRIE, RXEN, TXEN           
  95:level4.c      ****                        // (interrupt enable from receiver,            
  96:level4.c      ****                        // UART receiver enable, UART transmit enable) 
  97:level4.c      **** 
  98:level4.c      ****     UCSRC = ( 1 << URSEL ) | ( 1 << UCSZ1 ) | ( 1 << UCSZ0 ); 
  84               		.stabn 68,0,98,.LM3-UARTIni
  85               	.LM3:
  86 0004 86E8      		ldi r24,lo8(-122)
  87 0006 80BD      		out 64-0x20,r24
  99:level4.c      ****                        // asynchronous operation, 8 data bits,        
 100:level4.c      ****                        // no parity, 1 stop bit                       
 101:level4.c      **** 
 102:level4.c      ****     UBRRL = 103;         // baud rate - see UBRR register setting table 
  88               		.stabn 68,0,102,.LM4-UARTIni
  89               	.LM4:
  90 0008 87E6      		ldi r24,lo8(103)
  91 000a 89B9      		out 41-0x20,r24
 103:level4.c      ****                        //             in AVR ATmega8 specification    
 104:level4.c      ****                        // UBRRH - using initial values                
 105:level4.c      ****                        // UBRRL - 25 for 38k4Bd and frequency f=16 MHz 
 106:level4.c      ****                        // (using SINGLE transmission speed)           
 107:level4.c      ****     rx_number = 0;
  92               		.stabn 68,0,107,.LM5-UARTIni
  93               	.LM5:
  94 000c 1092 0000 		sts rx_number,__zero_reg__
 108:level4.c      ****     tx_number = 0;
  95               		.stabn 68,0,108,.LM6-UARTIni
  96               	.LM6:
  97 0010 1092 0000 		sts tx_number,__zero_reg__
 109:level4.c      ****     valid_data_flag = 0;
  98               		.stabn 68,0,109,.LM7-UARTIni
  99               	.LM7:
 100 0014 1092 0000 		sts valid_data_flag,__zero_reg__
 110:level4.c      **** }
 101               		.stabn 68,0,110,.LM8-UARTIni
 102               	.LM8:
 103               	/* epilogue: frame size=0 */
 104 0018 0895      		ret
 105               	/* epilogue end (size=1) */
 106               	/* function UARTIni size 13 (12) */
 107               		.size	UARTIni, .-UARTIni
 108               	.Lscope0:
 109               		.stabs	"",36,0,0,.Lscope0-UARTIni
 110               		.stabs	"__vector_11:F(0,20)",36,0,116,__vector_11
 111               	.global	__vector_11
 112               		.type	__vector_11, @function
 113               	__vector_11:
 111:level4.c      **** 
 112:level4.c      **** // ==================================================================
 113:level4.c      **** // uart byte receive interrupt
 114:level4.c      **** 
 115:level4.c      **** SIGNAL ( SIG_UART_RECV )
GAS LISTING C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccyKbaaa.s 			page 5


 116:level4.c      **** {
 114               		.stabn 68,0,116,.LM9-__vector_11
 115               	.LM9:
 116               	/* prologue: frame size=0 */
 117 001a 1F92      		push __zero_reg__
 118 001c 0F92      		push __tmp_reg__
 119 001e 0FB6      		in __tmp_reg__,__SREG__
 120 0020 0F92      		push __tmp_reg__
 121 0022 1124      		clr __zero_reg__
 122 0024 2F93      		push r18
 123 0026 3F93      		push r19
 124 0028 8F93      		push r24
 125 002a 9F93      		push r25
 126               	/* prologue end (size=9) */
 117:level4.c      **** 	  uint8_t temp;
 118:level4.c      **** 	  uint8_t error;
 119:level4.c      **** 	  error = UCSRA & ( ( 1 << FE ) | ( 1 << DOR ) | ( 1 << PE ) ); 
 127               		.stabn 68,0,119,.LM10-__vector_11
 128               	.LM10:
 129               	.LBB2:
 130 002c 8BB1      		in r24,43-0x20
 131 002e 8C71      		andi r24,lo8(28)
 120:level4.c      ****     temp = UDR;               //store byte into cyclic buffer
 132               		.stabn 68,0,120,.LM11-__vector_11
 133               	.LM11:
 134 0030 2CB1      		in r18,44-0x20
 121:level4.c      ****     if ( error != 0 )
 135               		.stabn 68,0,121,.LM12-__vector_11
 136               	.LM12:
 137 0032 8823      		tst r24
 138 0034 19F0      		breq .L3
 122:level4.c      ****     {
 123:level4.c      ****         rx_number = 0 ;
 139               		.stabn 68,0,123,.LM13-__vector_11
 140               	.LM13:
 141 0036 1092 0000 		sts rx_number,__zero_reg__
 124:level4.c      ****             
 125:level4.c      ****         return;
 142               		.stabn 68,0,125,.LM14-__vector_11
 143               	.LM14:
 144 003a 48C0      		rjmp .L2
 145               	.L3:
 126:level4.c      ****     }
 127:level4.c      ****     if ( valid_data_flag != 0 )
 146               		.stabn 68,0,127,.LM15-__vector_11
 147               	.LM15:
 148 003c 3091 0000 		lds r19,valid_data_flag
 149 0040 3323      		tst r19
 150 0042 09F0      		breq .+2
 151 0044 43C0      		rjmp .L2
 128:level4.c      ****     	  return;
 129:level4.c      ****     switch( rx_number )
 152               		.stabn 68,0,129,.LM16-__vector_11
 153               	.LM16:

⌨️ 快捷键说明

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