📄 exchange.lis
字号:
.module exchange.c
.area data(ram, con, rel)
0000 _tx_index::
0000 .blkb 1
.area idata
0000 FE .byte 254
.area data(ram, con, rel)
0001 .dbfile ./exchange.c
0001 .dbsym e tx_index _tx_index X
0001 _tx_count::
0001 .blkb 1
.area idata
0001 00 .byte 0
.area data(ram, con, rel)
0002 .dbfile ./exchange.c
0002 .dbsym e tx_count _tx_count c
.area lit(rom, con, rel)
0000 _hex_table::
0000 3031 .byte 48,49
0002 3233 .byte 50,51
0004 3435 .byte 52,53
0006 3637 .byte 54,55
0008 3839 .byte 56,57
000A 4142 .byte 'A,'B
000C 4344 .byte 'C,'D
000E 4546 .byte 'E,'F
0010 .dbsym e hex_table _hex_table A[16:16]c
.area text(rom, con, rel)
0000 .dbfile ./exchange.c
0000 .dbfunc e Echange_Stop _Echange_Stop fV
0000 _Echange_Stop::
0000 .dbline -1
0000 .dbline 28
0000 ; #include "PSoCApi.h"
0000 ; #include <m8c.h>
0000 ; #include "exchange.h"
0000 ; #include "stdlib.h"
0000 ; #include "utils.h"
0000 ;
0000 ; #define BIM_CONTROL_PORT PRT1DR
0000 ; #define BIM_TX_SEL_BIT 3
0000 ; #define BIM_RX_SEL_BIT 2
0000 ;
0000 ; #define TX_FUNCTION_REG_MODE1_BIT 4
0000 ;
0000 ; #define START_BYTE 'S'
0000 ; #define STOP_BYTE 'P'
0000 ; #define XOR_MASK 0x00
0000 ; #define INDEX_START_BYTE -1
0000 ; #define INDEX_COMPLETE -2
0000 ;
0000 ; volatile CHAR tx_index = INDEX_COMPLETE;
0000 ; BYTE tx_count = 0;
0000 ; BYTE *tx_buffer;
0000 ;
0000 ; const char hex_table [] =
0000 ; {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};
0000 ;
0000 ;
0000 ; void Echange_Stop(void)
0000 ; {
0000 .dbline 29
0000 ; TX_SERIAL_Stop();
0000 10 push X
0001 7C0000 xcall _TX_SERIAL_Stop
0004 .dbline 30
0004 ; Baud_Start();
0004 7C0000 xcall _Baud_Start
0007 20 pop X
0008 .dbline -2
0008 .dbline 31
0008 ; }
0008 L1:
0008 .dbline 0 ; func end
0008 7F ret
0009 .dbend
0009 .dbfunc e Exchange_SendBuf _Exchange_SendBuf fV
0009 ; count -> X-6
0009 ; p_tx -> X-5
0009 _Exchange_SendBuf::
0009 .dbline -1
0009 10 push X
000A 4F mov X,SP
000B .dbline 34
000B ;
000B ; void Exchange_SendBuf(char *p_tx, BYTE count)
000B ; {
000B L3:
000B .dbline 35
000B L4:
000B .dbline 35
000B ; while (INDEX_COMPLETE != tx_index);
000B 3C00FE cmp [_tx_index],-2
000E BFFC jnz L3
0010 .dbline 37
0010 ;
0010 ; tx_count = count << 1;
0010 52FA mov A,[X-6]
0012 5300 mov [__r0],A
0014 6500 asl [__r0]
0016 5F0100 mov [_tx_count],[__r0]
0019 .dbline 39
0019 ;
0019 ; tx_buffer = p_tx;
0019 52FC mov A,[X-4]
001B 5301 mov [_tx_buffer+1],A
001D 52FB mov A,[X-5]
001F 5300 mov [_tx_buffer],A
0021 .dbline 40
0021 ; tx_index = INDEX_START_BYTE;
0021 5500FF mov [_tx_index],-1
0024 .dbline -2
0024 .dbline 41
0024 ; }
0024 L2:
0024 20 pop X
0025 .dbline 0 ; func end
0025 7F ret
0026 .dbsym l count 0 I
0026 .dbsym l count -6 c
0026 .dbsym l p_tx -5 pc
0026 .dbend
0026 .dbfunc e Exchange_Start _Exchange_Start fV
0026 _Exchange_Start::
0026 .dbline -1
0026 .dbline 44
0026 ;
0026 ; void Exchange_Start(void)
0026 ; {
0026 .dbline 45
0026 ; Baud_Start();
0026 10 push X
0027 7C0000 xcall _Baud_Start
002A 20 pop X
002B .dbline 46
002B ; CLEARBIT(TX_SERIAL_FUNC_REG, TX_FUNCTION_REG_MODE1_BIT); //set TX reg empty interrupt
002B 7110 or F,0x10 ; iopage = 1
002D 4138EF and REG[56],-17
0030 70EF and F,0xEF ; iopage = 0
0032 .dbline 47
0032 ; TX_SERIAL_Start(TX8_PARITY_NONE);
0032 10 push X
0033 5000 mov A,0
0035 7C0000 xcall _TX_SERIAL_Start
0038 20 pop X
0039 .dbline 49
0039 ;
0039 ; tx_index = INDEX_COMPLETE;
0039 5500FE mov [_tx_index],-2
003C .dbline 50
003C ; TX_SERIAL_EnableInt();
003C 10 push X
003D 7C0000 xcall _TX_SERIAL_EnableInt
0040 20 pop X
0041 .dbline 51
0041 ; TX_SERIAL_TX_BUFFER_REG = XOR_MASK;
0041 623900 mov REG[57],0
0044 .dbline -2
0044 .dbline 52
0044 ; }
0044 L6:
0044 .dbline 0 ; func end
0044 7F ret
0045 .dbend
0045 .dbfunc e Exchange_Stop _Exchange_Stop fV
0045 _Exchange_Stop::
0045 .dbline -1
0045 .dbline 55
0045 ;
0045 ; void Exchange_Stop(void)
0045 ; {
0045 .dbline 56
0045 ; TX_SERIAL_DisableInt();
0045 10 push X
0046 7C0000 xcall _TX_SERIAL_DisableInt
0049 .dbline 57
0049 ; TX_SERIAL_Stop();
0049 7C0000 xcall _TX_SERIAL_Stop
004C 20 pop X
004D .dbline -2
004D .dbline 58
004D ; }
004D L7:
004D .dbline 0 ; func end
004D 7F ret
004E .dbend
004E .dbfunc e TX_SERIAL_handler _TX_SERIAL_handler fV
004E _TX_SERIAL_handler::
004E .dbline -1
004E 08 push A
004F 5100 mov A,[__r0]
0051 08 push A
0052 5100 mov A,[__r1]
0054 08 push A
0055 10 push X
0056 4F mov X,SP
0057 3802 add SP,2
0059 .dbline 62
0059 ;
0059 ; #pragma interrupt_handler TX_SERIAL_handler;
0059 ; void TX_SERIAL_handler (void)
0059 ; {
0059 .dbline 63
0059 ; if (INDEX_COMPLETE == tx_index)
0059 3C00FE cmp [_tx_index],-2
005C B006 jnz L9
005E .dbline 64
005E ; {
005E .dbline 65
005E ; TX_SERIAL_TX_BUFFER_REG = XOR_MASK;
005E 623900 mov REG[57],0
0061 .dbline 66
0061 ; }
0061 80BD xjmp L10
0063 L9:
0063 .dbline 68
0063 ; else
0063 ; if (INDEX_START_BYTE == tx_index)
0063 3C00FF cmp [_tx_index],-1
0066 B008 jnz L11
0068 .dbline 69
0068 ; {
0068 .dbline 70
0068 ; TX_SERIAL_TX_BUFFER_REG = XOR_MASK ^ START_BYTE;
0068 623953 mov REG[57],83
006B .dbline 71
006B ; tx_index++;
006B 7600 inc [_tx_index]
006D .dbline 72
006D ; }
006D 80B1 xjmp L12
006F L11:
006F .dbline 74
006F ; else
006F ; if (tx_index < tx_count)
006F 5100 mov A,[_tx_index]
0071 3A01 cmp A,[_tx_count]
0073 D08C jnc L13
0075 X0:
0075 .dbline 75
0075 ; {
0075 .dbline 76
0075 ; TX_SERIAL_TX_BUFFER_REG = XOR_MASK ^((tx_index & 0x01) ?
0075 470001 tst [_tx_index],1
0078 A03C jz L16
007A 5F0000 mov [__r1],[_tx_index]
007D 550000 mov [__r0],0
0080 470080 tst [__r1],-128
0083 A004 jz X1
0085 5500FF mov [__r0],-1
0088 X1:
0088 6800 asr [__r0]
008A 6E00 rrc [__r1]
008C 5101 mov A,[_tx_buffer+1]
008E 0400 add [__r1],A
0090 5100 mov A,[_tx_buffer]
0092 0C00 adc [__r0],A
0094 3E00 mvi A,[__r1]
0096 5300 mov [__r1],A
0098 550000 mov [__r0],0
009B 26000F and [__r1],15
009E 260000 and [__r0],0
00A1 060000 add [__r1],<_hex_table
00A4 0E0000 adc [__r0],>_hex_table
00A7 5100 mov A,[__r0]
00A9 10 push X
00AA 5800 mov X,[__r1]
00AC 28 romx
00AD 20 pop X
00AE 5401 mov [X+1],A
00B0 560000 mov [X+0],0
00B3 8044 xjmp L17
00B5 L16:
00B5 5F0000 mov [__r1],[_tx_index]
00B8 550000 mov [__r0],0
00BB 470080 tst [__r1],-128
00BE A004 jz X2
00C0 5500FF mov [__r0],-1
00C3 X2:
00C3 6800 asr [__r0]
00C5 6E00 rrc [__r1]
00C7 5101 mov A,[_tx_buffer+1]
00C9 0400 add [__r1],A
00CB 5100 mov A,[_tx_buffer]
00CD 0C00 adc [__r0],A
00CF 3E00 mvi A,[__r1]
00D1 5300 mov [__r1],A
00D3 550000 mov [__r0],0
00D6 6800 asr [__r0]
00D8 6E00 rrc [__r1]
00DA 6800 asr [__r0]
00DC 6E00 rrc [__r1]
00DE 6800 asr [__r0]
00E0 6E00 rrc [__r1]
00E2 6800 asr [__r0]
00E4 6E00 rrc [__r1]
00E6 060000 add [__r1],<_hex_table
00E9 0E0000 adc [__r0],>_hex_table
00EC 5100 mov A,[__r0]
00EE 10 push X
00EF 5800 mov X,[__r1]
00F1 28 romx
00F2 20 pop X
00F3 5401 mov [X+1],A
00F5 560000 mov [X+0],0
00F8 L17:
00F8 5201 mov A,[X+1]
00FA 6039 mov REG[57],A
00FC .dbline 79
00FC ; (hex_table[tx_buffer[tx_index >> 1] & 0x0F]):((hex_table[tx_buffer[tx_index >>1] >> 4])));
00FC ;
00FC ; tx_index++;
00FC 7600 inc [_tx_index]
00FE .dbline 80
00FE ; }
00FE 8020 xjmp L14
0100 L13:
0100 .dbline 82
0100 ; else
0100 ; if (tx_index == tx_count)
0100 5100 mov A,[_tx_index]
0102 3A01 cmp A,[_tx_count]
0104 B008 jnz L18
0106 .dbline 83
0106 ; {
0106 .dbline 84
0106 ; TX_SERIAL_TX_BUFFER_REG = XOR_MASK ^ STOP_BYTE;
0106 623950 mov REG[57],80
0109 .dbline 85
0109 ; tx_index++;
0109 7600 inc [_tx_index]
010B .dbline 86
010B ; }
010B 8013 xjmp L19
010D L18:
010D .dbline 88
010D ; else
010D ; if (tx_index == (tx_count+1))
010D 5101 mov A,[_tx_count]
010F 0101 add A,1
0111 5300 mov [__r0],A
0113 5100 mov A,[_tx_index]
0115 3A00 cmp A,[__r0]
0117 B007 jnz L20
0119 .dbline 89
0119 ; {
0119 .dbline 90
0119 ; tx_index = INDEX_COMPLETE;
0119 5500FE mov [_tx_index],-2
011C .dbline 91
011C ; TX_SERIAL_TX_BUFFER_REG = XOR_MASK;
011C 623900 mov REG[57],0
011F .dbline 92
011F ; }
011F L20:
011F L19:
011F L14:
011F L12:
011F L10:
011F .dbline -2
011F .dbline 93
011F ; }
011F L8:
011F 38FE add SP,-2
0121 20 pop X
0122 18 pop A
0123 5300 mov [__r1],A
0125 18 pop A
0126 5300 mov [__r0],A
0128 18 pop A
0129 .dbline 0 ; func end
0129 7E reti
012A .dbend
.area bss(ram, con, rel)
0000 .dbfile ./exchange.c
0000 _tx_buffer::
0000 .blkb 2
0002 .dbsym e tx_buffer _tx_buffer pc
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -