;-------------------------------------------------------- ; File Created by SDCC : free open source ANSI-C Compiler ; Version 3.2.0 #8008 (Jul 6 2012) (MINGW32) ; This file was generated Mon Oct 19 17:27:13 2015 ;-------------------------------------------------------- .module test_sio .optsdcc -mmcs51 --model-small ;-------------------------------------------------------- ; Public variables in this module ;-------------------------------------------------------- .globl _main .globl _SetVector .globl _SIO_ISR .globl _TIMER_KB .globl _TIMER_T2 .globl _fantom_mis .globl _mistake .globl _moderes .globl _ScanKBOnce .globl _getQ .globl _insertQ .globl _read_max .globl _write_max .globl _readdip .globl _leds .globl _init_sio_timer .globl _type .globl _SPR0 .globl _SPR1 .globl _CPHA .globl _CPOL .globl _SPIM .globl _SPE .globl _WCOL .globl _ISPI .globl _I2CI .globl _I2CTX .globl _I2CRS .globl _I2CM .globl _MDI .globl _MCO .globl _MDE .globl _MDO .globl _CS0 .globl _CS1 .globl _CS2 .globl _CS3 .globl _SCONV .globl _CCONV .globl _DMA .globl _ADCI .globl _P .globl _F1 .globl _OV .globl _RS0 .globl _RS1 .globl _F0 .globl _AC .globl _CY .globl _CAP2 .globl _CNT2 .globl _TR2 .globl _XEN .globl _TCLK .globl _RCLK .globl _EXF2 .globl _TF2 .globl _WDE .globl _WDS .globl _WDR2 .globl _WDR1 .globl _PRE0 .globl _PRE1 .globl _PRE2 .globl _PX0 .globl _PT0 .globl _PX1 .globl _PT1 .globl _PS .globl _PT2 .globl _PADC .globl _PSI .globl _RXD .globl _TXD .globl _INT0 .globl _INT1 .globl _T0 .globl _T1 .globl _WR .globl _RD .globl _EX0 .globl _ET0 .globl _EX1 .globl _ET1 .globl _ES .globl _ET2 .globl _EADC .globl _EA .globl _RI .globl _TI .globl _RB8 .globl _TB8 .globl _REN .globl _SM2 .globl _SM1 .globl _SM0 .globl _T2 .globl _T2EX .globl _IT0 .globl _IE0 .globl _IT1 .globl _IE1 .globl _TR0 .globl _TF0 .globl _TR1 .globl _TF1 .globl _DACCON .globl _DAC1H .globl _DAC1L .globl _DAC0H .globl _DAC0L .globl _SPICON .globl _SPIDAT .globl _ADCCON3 .globl _ADCGAINH .globl _ADCGAINL .globl _ADCOFSH .globl _ADCOFSL .globl _B .globl _ADCCON1 .globl _I2CCON .globl _ACC .globl _PSMCON .globl _ADCDATAH .globl _ADCDATAL .globl _ADCCON2 .globl _DMAP .globl _DMAH .globl _DMAL .globl _PSW .globl _TH2 .globl _TL2 .globl _RCAP2H .globl _RCAP2L .globl _T2CON .globl _EADRL .globl _WDCON .globl _EDATA4 .globl _EDATA3 .globl _EDATA2 .globl _EDATA1 .globl _ETIM3 .globl _ETIM2 .globl _ETIM1 .globl _ECON .globl _IP .globl _P3 .globl _IE2 .globl _IE .globl _P2 .globl _I2CADD .globl _I2CDAT .globl _SBUF .globl _SCON .globl _P1 .globl _TH1 .globl _TH0 .globl _TL1 .globl _TL0 .globl _TMOD .globl _TCON .globl _PCON .globl _DPP .globl _DPH .globl _DPL .globl _SP .globl _P0 .globl _KBTable .globl _colnum .globl _dipmod .globl _endQ .globl _frontQ .globl _queue .globl _temo .globl _temp .globl _time_count .globl _drebezg .globl _d2 .globl _d1 .globl _result .globl _mode ;-------------------------------------------------------- ; special function registers ;-------------------------------------------------------- .area RSEG (ABS,DATA) .org 0x0000 _P0 = 0x0080 _SP = 0x0081 _DPL = 0x0082 _DPH = 0x0083 _DPP = 0x0084 _PCON = 0x0087 _TCON = 0x0088 _TMOD = 0x0089 _TL0 = 0x008a _TL1 = 0x008b _TH0 = 0x008c _TH1 = 0x008d _P1 = 0x0090 _SCON = 0x0098 _SBUF = 0x0099 _I2CDAT = 0x009a _I2CADD = 0x009b _P2 = 0x00a0 _IE = 0x00a8 _IE2 = 0x00a9 _P3 = 0x00b0 _IP = 0x00b8 _ECON = 0x00b9 _ETIM1 = 0x00ba _ETIM2 = 0x00bb _ETIM3 = 0x00c4 _EDATA1 = 0x00bc _EDATA2 = 0x00bd _EDATA3 = 0x00be _EDATA4 = 0x00bf _WDCON = 0x00c0 _EADRL = 0x00c6 _T2CON = 0x00c8 _RCAP2L = 0x00ca _RCAP2H = 0x00cb _TL2 = 0x00cc _TH2 = 0x00cd _PSW = 0x00d0 _DMAL = 0x00d2 _DMAH = 0x00d3 _DMAP = 0x00d4 _ADCCON2 = 0x00d8 _ADCDATAL = 0x00d9 _ADCDATAH = 0x00da _PSMCON = 0x00df _ACC = 0x00e0 _I2CCON = 0x00e8 _ADCCON1 = 0x00ef _B = 0x00f0 _ADCOFSL = 0x00f1 _ADCOFSH = 0x00f2 _ADCGAINL = 0x00f3 _ADCGAINH = 0x00f4 _ADCCON3 = 0x00f5 _SPIDAT = 0x00f7 _SPICON = 0x00f8 _DAC0L = 0x00f9 _DAC0H = 0x00fa _DAC1L = 0x00fb _DAC1H = 0x00fc _DACCON = 0x00fd ;-------------------------------------------------------- ; special function bits ;-------------------------------------------------------- .area RSEG (ABS,DATA) .org 0x0000 _TF1 = 0x008f _TR1 = 0x008e _TF0 = 0x008d _TR0 = 0x008c _IE1 = 0x008b _IT1 = 0x008a _IE0 = 0x0089 _IT0 = 0x0088 _T2EX = 0x0091 _T2 = 0x0090 _SM0 = 0x009f _SM1 = 0x009e _SM2 = 0x009d _REN = 0x009c _TB8 = 0x009b _RB8 = 0x009a _TI = 0x0099 _RI = 0x0098 _EA = 0x00af _EADC = 0x00ae _ET2 = 0x00ad _ES = 0x00ac _ET1 = 0x00ab _EX1 = 0x00aa _ET0 = 0x00a9 _EX0 = 0x00a8 _RD = 0x00b7 _WR = 0x00b6 _T1 = 0x00b5 _T0 = 0x00b4 _INT1 = 0x00b3 _INT0 = 0x00b2 _TXD = 0x00b1 _RXD = 0x00b0 _PSI = 0x00bf _PADC = 0x00be _PT2 = 0x00bd _PS = 0x00bc _PT1 = 0x00bb _PX1 = 0x00ba _PT0 = 0x00b9 _PX0 = 0x00b8 _PRE2 = 0x00c7 _PRE1 = 0x00c6 _PRE0 = 0x00c5 _WDR1 = 0x00c3 _WDR2 = 0x00c2 _WDS = 0x00c1 _WDE = 0x00c0 _TF2 = 0x00cf _EXF2 = 0x00ce _RCLK = 0x00cd _TCLK = 0x00cc _XEN = 0x00cb _TR2 = 0x00ca _CNT2 = 0x00c9 _CAP2 = 0x00c8 _CY = 0x00d7 _AC = 0x00d6 _F0 = 0x00d5 _RS1 = 0x00d4 _RS0 = 0x00d3 _OV = 0x00d2 _F1 = 0x00d1 _P = 0x00d0 _ADCI = 0x00df _DMA = 0x00de _CCONV = 0x00dd _SCONV = 0x00dc _CS3 = 0x00db _CS2 = 0x00da _CS1 = 0x00d9 _CS0 = 0x00d8 _MDO = 0x00ef _MDE = 0x00ee _MCO = 0x00ed _MDI = 0x00ec _I2CM = 0x00eb _I2CRS = 0x00ea _I2CTX = 0x00e9 _I2CI = 0x00e8 _ISPI = 0x00ff _WCOL = 0x00fe _SPE = 0x00fd _SPIM = 0x00fc _CPOL = 0x00fb _CPHA = 0x00fa _SPR1 = 0x00f9 _SPR0 = 0x00f8 ;-------------------------------------------------------- ; overlayable register banks ;-------------------------------------------------------- .area REG_BANK_0 (REL,OVR,DATA) .ds 8 ;-------------------------------------------------------- ; overlayable bit register bank ;-------------------------------------------------------- .area BIT_BANK (REL,OVR,DATA) bits: .ds 1 b0 = bits[0] b1 = bits[1] b2 = bits[2] b3 = bits[3] b4 = bits[4] b5 = bits[5] b6 = bits[6] b7 = bits[7] ;-------------------------------------------------------- ; internal ram data ;-------------------------------------------------------- .area DSEG (DATA) _mode:: .ds 1 _result:: .ds 1 _d1:: .ds 1 _d2:: .ds 1 _drebezg:: .ds 16 _time_count:: .ds 32 _temp:: .ds 1 _temo:: .ds 1 _queue:: .ds 20 _frontQ:: .ds 1 _endQ:: .ds 1 _dipmod:: .ds 1 _colnum:: .ds 1 _KBTable:: .ds 17 ;-------------------------------------------------------- ; overlayable items in internal ram ;-------------------------------------------------------- ;-------------------------------------------------------- ; Stack segment in internal ram ;-------------------------------------------------------- .area SSEG (DATA) __start__stack: .ds 1 ;-------------------------------------------------------- ; indirectly addressable internal ram data ;-------------------------------------------------------- .area ISEG (DATA) ;-------------------------------------------------------- ; absolute internal ram data ;-------------------------------------------------------- .area IABS (ABS,DATA) .area IABS (ABS,DATA) ;-------------------------------------------------------- ; bit data ;-------------------------------------------------------- .area BSEG (BIT) ;-------------------------------------------------------- ; paged external ram data ;-------------------------------------------------------- .area PSEG (PAG,XDATA) ;-------------------------------------------------------- ; external ram data ;-------------------------------------------------------- .area XSEG (XDATA) ;-------------------------------------------------------- ; absolute external ram data ;-------------------------------------------------------- .area XABS (ABS,XDATA) ;-------------------------------------------------------- ; external initialized ram data ;-------------------------------------------------------- .area XISEG (XDATA) .area HOME (CODE) .area GSINIT0 (CODE) .area GSINIT1 (CODE) .area GSINIT2 (CODE) .area GSINIT3 (CODE) .area GSINIT4 (CODE) .area GSINIT5 (CODE) .area GSINIT (CODE) .area GSFINAL (CODE) .area CSEG (CODE) ;-------------------------------------------------------- ; interrupt vector ;-------------------------------------------------------- .area HOME (CODE) __interrupt_vect: ljmp __sdcc_gsinit_startup reti .ds 7 reti .ds 7 ljmp _TIMER_KB .ds 5 ljmp _TIMER_T2 .ds 5 ljmp _SIO_ISR ;-------------------------------------------------------- ; global & static initialisations ;-------------------------------------------------------- .area HOME (CODE) .area GSINIT (CODE) .area GSFINAL (CODE) .area GSINIT (CODE) .globl __sdcc_gsinit_startup .globl __sdcc_program_startup .globl __start__stack .globl __mcs51_genXINIT .globl __mcs51_genXRAMCLEAR .globl __mcs51_genRAMCLEAR ; SRC/test_sio.c:43: unsigned char temo = 0x00; mov _temo,#0x00 ; SRC/test_sio.c:47: char frontQ = -1; mov _frontQ,#0xFF ; SRC/test_sio.c:48: char endQ = -1; mov _endQ,#0xFF ; SRC/test_sio.c:49: char dipmod=0; mov _dipmod,#0x00 ; SRC/test_sio.c:51: unsigned char colnum=3; mov _colnum,#0x03 ; SRC/test_sio.c:52: char KBTable[]="147*2580369#ABCD"; mov _KBTable,#0x31 mov (_KBTable + 0x0001),#0x34 mov (_KBTable + 0x0002),#0x37 mov (_KBTable + 0x0003),#0x2A mov (_KBTable + 0x0004),#0x32 mov (_KBTable + 0x0005),#0x35 mov (_KBTable + 0x0006),#0x38 mov (_KBTable + 0x0007),#0x30 mov (_KBTable + 0x0008),#0x33 mov (_KBTable + 0x0009),#0x36 mov (_KBTable + 0x000a),#0x39 mov (_KBTable + 0x000b),#0x23 mov (_KBTable + 0x000c),#0x41 mov (_KBTable + 0x000d),#0x42 mov (_KBTable + 0x000e),#0x43 mov (_KBTable + 0x000f),#0x44 mov (_KBTable + 0x0010),#0x00 .area GSFINAL (CODE) ljmp __sdcc_program_startup ;-------------------------------------------------------- ; Home ;-------------------------------------------------------- .area HOME (CODE) .area HOME (CODE) __sdcc_program_startup: lcall _main ; return from main will lock up sjmp . ;-------------------------------------------------------- ; code ;-------------------------------------------------------- .area CSEG (CODE) ;------------------------------------------------------------ ;Allocation info for local variables in function 'insertQ' ;------------------------------------------------------------ ;a Allocated to registers r7 ;------------------------------------------------------------ ; SRC/test_sio.c:54: void insertQ(unsigned char a) { ; ----------------------------------------- ; function insertQ ; ----------------------------------------- _insertQ: ar7 = 0x07 ar6 = 0x06 ar5 = 0x05 ar4 = 0x04 ar3 = 0x03 ar2 = 0x02 ar1 = 0x01 ar0 = 0x00 mov r7,dpl ; SRC/test_sio.c:55: if (frontQ == 19) mov a,#0x13 cjne a,_frontQ,00102$ ; SRC/test_sio.c:56: frontQ = -1; mov _frontQ,#0xFF 00102$: ; SRC/test_sio.c:57: queue[++frontQ] = a; inc _frontQ mov a,_frontQ add a,#_queue mov r0,a mov @r0,ar7 ret ;------------------------------------------------------------ ;Allocation info for local variables in function 'getQ' ;------------------------------------------------------------ ;symbol Allocated to registers ;------------------------------------------------------------ ; SRC/test_sio.c:60: unsigned char getQ() { ; ----------------------------------------- ; function getQ ; ----------------------------------------- _getQ: ; SRC/test_sio.c:62: if (endQ == 19) mov a,#0x13 cjne a,_endQ,00102$ ; SRC/test_sio.c:63: endQ = -1; mov _endQ,#0xFF 00102$: ; SRC/test_sio.c:64: symbol = queue[++endQ]; inc _endQ mov a,_endQ add a,#_queue mov r1,a mov dpl,@r1 ; SRC/test_sio.c:65: return symbol; ret ;------------------------------------------------------------ ;Allocation info for local variables in function 'ScanKBOnce' ;------------------------------------------------------------ ;row Allocated to registers r7 ;col Allocated to registers r7 ;rownum Allocated to stack - _bp +3 ;i Allocated to stack - _bp +4 ;------------------------------------------------------------ ; SRC/test_sio.c:69: unsigned char ScanKBOnce() ; ----------------------------------------- ; function ScanKBOnce ; ----------------------------------------- _ScanKBOnce: ; SRC/test_sio.c:74: if (colnum==3) mov a,#0x03 cjne a,_colnum,00102$ ; SRC/test_sio.c:75: colnum=0; mov _colnum,#0x00 sjmp 00103$ 00102$: ; SRC/test_sio.c:77: colnum++; inc _colnum 00103$: ; SRC/test_sio.c:78: col = 0x1 << colnum; //0001,0010,0100,1000,0001,... mov b,_colnum inc b mov a,#0x01 sjmp 00112$ 00110$: add a,acc 00112$: djnz b,00110$ ; SRC/test_sio.c:80: write_max(KB, ~col); //11111110,11111101,11111011,11110111,11111110,... cpl a mov r7,a push ar7 mov dptr,#0x0000 lcall _write_max dec sp ; SRC/test_sio.c:82: row=read_max(KB) & (0xF0); mov dptr,#0x0000 lcall _read_max mov r7,dpl anl ar7,#0xF0 ; SRC/test_sio.c:83: row=~row>>4; mov ar5,r7 mov r6,#0x00 mov a,r5 cpl a mov r5,a mov a,r6 cpl a mov r6,a swap a xch a,r5 swap a anl a,#0x0F xrl a,r5 xch a,r5 anl a,#0x0F xch a,r5 xrl a,r5 xch a,r5 jnb acc.3,00113$ orl a,#0xF0 00113$: mov ar7,r5 ; SRC/test_sio.c:84: return row; mov dpl,r7 ret ;------------------------------------------------------------ ;Allocation info for local variables in function 'moderes' ;------------------------------------------------------------ ; SRC/test_sio.c:88: void moderes() { ; ----------------------------------------- ; function moderes ; ----------------------------------------- _moderes: ; SRC/test_sio.c:89: mode = 1; mov _mode,#0x01 ; SRC/test_sio.c:90: d1 = 0xFF; mov _d1,#0xFF ; SRC/test_sio.c:91: d2 = 0xFF; mov _d2,#0xFF ; SRC/test_sio.c:92: result = 0xFF; mov _result,#0xFF ret ;------------------------------------------------------------ ;Allocation info for local variables in function 'mistake' ;------------------------------------------------------------ ; SRC/test_sio.c:96: void mistake() { ; ----------------------------------------- ; function mistake ; ----------------------------------------- _mistake: ; SRC/test_sio.c:97: EA = 0; //блокируем прерывания clr _EA ; SRC/test_sio.c:98: ES = 0; clr _ES ; SRC/test_sio.c:99: type ("Mistake has happend\n"); mov dptr,#__str_0 mov b,#0x80 lcall _type ; SRC/test_sio.c:100: leds(0xFF); mov dpl,#0xFF lcall _leds ; SRC/test_sio.c:101: frontQ=-1; mov _frontQ,#0xFF ; SRC/test_sio.c:102: endQ=-1; mov _endQ,#0xFF ; SRC/test_sio.c:103: moderes(); lcall _moderes ; SRC/test_sio.c:104: EA = 1; setb _EA ; SRC/test_sio.c:105: ES = 1;// разрешаем прерывания от таймера для опроса setb _ES ret ;------------------------------------------------------------ ;Allocation info for local variables in function 'fantom_mis' ;------------------------------------------------------------ ;i Allocated to registers r7 ;j Allocated to registers r4 ;------------------------------------------------------------ ; SRC/test_sio.c:107: void fantom_mis(){ ; ----------------------------------------- ; function fantom_mis ; ----------------------------------------- _fantom_mis: ; SRC/test_sio.c:109: EA=0; clr _EA ; SRC/test_sio.c:110: type("fantom mistake\n"); mov dptr,#__str_1 mov b,#0x80 lcall _type ; SRC/test_sio.c:112: for(i=0;i<4;i++) mov r7,#0x00 00105$: cjne r7,#0x04,00121$ 00121$: jnc 00108$ ; SRC/test_sio.c:113: for(j=0;j<4;j++){ mov a,r7 add a,r7 add a,acc add a,#_drebezg mov r6,a mov a,r7 swap a rr a anl a,#0xF8 add a,#_time_count mov r5,a mov r4,#0x00 00101$: cjne r4,#0x04,00123$ 00123$: jnc 00107$ ; SRC/test_sio.c:114: drebezg[i][j]=0; mov a,r4 add a,r6 mov r0,a mov @r0,#0x00 ; SRC/test_sio.c:115: time_count[i][j]=0; mov a,r4 add a,r4 mov r3,a add a,r5 mov r0,a mov @r0,#0x00 inc r0 mov @r0,#0x00 ; SRC/test_sio.c:113: for(j=0;j<4;j++){ inc r4 sjmp 00101$ 00107$: ; SRC/test_sio.c:112: for(i=0;i<4;i++) inc r7 sjmp 00105$ 00108$: ; SRC/test_sio.c:117: EA=1; setb _EA ret ;------------------------------------------------------------ ;Allocation info for local variables in function 'TIMER_T2' ;------------------------------------------------------------ ; SRC/test_sio.c:120: void TIMER_T2(void) __interrupt( 3 ){ ; ----------------------------------------- ; function TIMER_T2 ; ----------------------------------------- _TIMER_T2: push bits push acc push b push dpl push dph push (0+7) push (0+6) push (0+5) push (0+4) push (0+3) push (0+2) push (0+1) push (0+0) push psw mov psw,#0x00 ; SRC/test_sio.c:121: EA = 0; clr _EA ; SRC/test_sio.c:128: TH2 = 0xFE; mov _TH2,#0xFE ; SRC/test_sio.c:129: TL2 = 0x00; mov _TL2,#0x00 ; SRC/test_sio.c:130: leds(0xFF); mov dpl,#0xFF lcall _leds ; SRC/test_sio.c:131: EA = 1; setb _EA pop psw pop (0+0) pop (0+1) pop (0+2) pop (0+3) pop (0+4) pop (0+5) pop (0+6) pop (0+7) pop dph pop dpl pop b pop acc pop bits reti ;------------------------------------------------------------ ;Allocation info for local variables in function 'TIMER_KB' ;------------------------------------------------------------ ;i Allocated to registers r4 ;j Allocated to registers r7 ;count Allocated to registers r5 ;input Allocated to stack - _bp +1 ;rownum Allocated to registers r6 ;------------------------------------------------------------ ; SRC/test_sio.c:134: void TIMER_KB(void) __interrupt( 2 ){ ; ----------------------------------------- ; function TIMER_KB ; ----------------------------------------- _TIMER_KB: push bits push acc push b push dpl push dph push (0+7) push (0+6) push (0+5) push (0+4) push (0+3) push (0+2) push (0+1) push (0+0) push psw mov psw,#0x00 push _bp mov _bp,sp inc sp ; SRC/test_sio.c:138: input=ScanKBOnce();//&(0x0f) lcall _ScanKBOnce mov r7,dpl mov r0,_bp inc r0 mov @r0,ar7 ; SRC/test_sio.c:140: for(rownum=0;rownum<4;rownum++) mov r6,#0x00 00132$: cjne r6,#0x04,00173$ 00173$: jc 00174$ ljmp 00135$ 00174$: ; SRC/test_sio.c:142: count=0; mov r5,#0x00 ; SRC/test_sio.c:143: if(input&(0x01<0) mov a,_colnum add a,_colnum add a,acc mov r4,a add a,#_drebezg add a,r6 mov r1,a mov ar3,@r1 clr c clr a xrl a,#0x80 mov b,r3 xrl b,#0x80 subb a,b jnc 00109$ ; SRC/test_sio.c:153: drebezg[colnum][rownum]--; mov a,r4 add a,#_drebezg add a,r6 mov r1,a mov a,@r1 mov r3,a dec a mov @r1,a sjmp 00148$ 00109$: ; SRC/test_sio.c:154: else if (drebezg[colnum][rownum]==0) mov a,r4 add a,#_drebezg mov r4,a add a,r6 mov r1,a mov a,@r1 jnz 00148$ ; SRC/test_sio.c:155: if(time_count[colnum][rownum]>0) mov a,_colnum swap a rr a anl a,#0xF8 mov r4,a add a,#_time_count mov r3,a mov a,r6 add a,r6 mov r2,a add a,r3 mov r1,a mov ar3,@r1 inc r1 mov ar7,@r1 dec r1 clr c clr a subb a,r3 clr a xrl a,#0x80 mov b,r7 xrl b,#0x80 subb a,b jnc 00148$ ; SRC/test_sio.c:156: time_count[colnum][rownum]=0; mov a,r4 add a,#_time_count mov r4,a add a,r2 mov r0,a mov @r0,#0x00 inc r0 mov @r0,#0x00 ; SRC/test_sio.c:160: for(i=0;i<4;i++) 00148$: mov r4,#0x00 00128$: cjne r4,#0x04,00184$ 00184$: jnc 00131$ ; SRC/test_sio.c:161: for(j=0;j<4;j++) mov a,r4 add a,r4 add a,acc add a,#_drebezg mov r3,a mov ar2,r5 mov r7,#0x00 00124$: cjne r7,#0x04,00186$ 00186$: jnc 00154$ ; SRC/test_sio.c:162: if(drebezg[i][j] == 5) push ar2 mov a,r7 add a,r3 mov r1,a mov ar2,@r1 cjne r2,#0x05,00188$ sjmp 00189$ 00188$: pop ar2 sjmp 00126$ 00189$: pop ar2 ; SRC/test_sio.c:163: count = count + 1; //for multyple pushed buttons*/ inc r2 00126$: ; SRC/test_sio.c:161: for(j=0;j<4;j++) inc r7 sjmp 00124$ 00154$: mov ar5,r2 ; SRC/test_sio.c:160: for(i=0;i<4;i++) inc r4 sjmp 00128$ 00131$: ; SRC/test_sio.c:166: if(count > MAX_KEYS_PRESSED) //sSHIIIEEEET mov a,r5 add a,#0xff - 0x03 jnc 00122$ ; SRC/test_sio.c:167: fantom_mis(); push ar6 lcall _fantom_mis pop ar6 ljmp 00134$ 00122$: ; SRC/test_sio.c:171: if(time_count[colnum][rownum]==1 && drebezg[colnum][rownum]==5) //first enterance mov a,_colnum swap a rr a anl a,#0xF8 add a,#_time_count mov r7,a mov a,r6 add a,r6 mov r5,a add a,r7 mov r1,a mov ar4,@r1 inc r1 mov ar7,@r1 dec r1 cjne r4,#0x01,00117$ cjne r7,#0x00,00117$ mov a,_colnum add a,_colnum add a,acc mov r7,a add a,#_drebezg add a,r6 mov r1,a mov ar4,@r1 cjne r4,#0x05,00117$ ; SRC/test_sio.c:173: insertQ(KBTable[colnum*4+rownum]); mov a,r6 add a,r7 add a,#_KBTable mov r1,a mov dpl,@r1 push ar6 push ar5 lcall _insertQ pop ar5 pop ar6 00117$: ; SRC/test_sio.c:175: if(time_count[colnum][rownum]==100) mov a,_colnum swap a rr a anl a,#0xF8 add a,#_time_count add a,r5 mov r1,a mov ar4,@r1 inc r1 mov ar7,@r1 dec r1 cjne r4,#0x64,00134$ cjne r7,#0x00,00134$ ; SRC/test_sio.c:177: insertQ(KBTable[colnum*4+rownum]); mov a,_colnum add a,_colnum add a,acc add a,r6 add a,#_KBTable mov r1,a mov dpl,@r1 push ar6 push ar5 lcall _insertQ pop ar5 pop ar6 ; SRC/test_sio.c:178: time_count[colnum][rownum]=80; //once 250 mov a,_colnum swap a rr a anl a,#0xF8 add a,#_time_count mov r7,a add a,r5 mov r0,a mov @r0,#0x50 inc r0 mov @r0,#0x00 00134$: ; SRC/test_sio.c:140: for(rownum=0;rownum<4;rownum++) inc r6 ljmp 00132$ 00135$: ; SRC/test_sio.c:183: TH0 = 0xFE; // Инициализация таймера 0 d8 fe mov _TH0,#0xFE ; SRC/test_sio.c:184: TL0 = 0xB0; //частота=10кГц(1 в 10млсек) mov _TL0,#0xB0 dec sp pop _bp pop psw pop (0+0) pop (0+1) pop (0+2) pop (0+3) pop (0+4) pop (0+5) pop (0+6) pop (0+7) pop dph pop dpl pop b pop acc pop bits reti ;------------------------------------------------------------ ;Allocation info for local variables in function 'SIO_ISR' ;------------------------------------------------------------ ; SRC/test_sio.c:191: void SIO_ISR( void ) __interrupt ( 4 ) ; ----------------------------------------- ; function SIO_ISR ; ----------------------------------------- _SIO_ISR: push bits push acc push b push dpl push dph push (0+7) push (0+6) push (0+5) push (0+4) push (0+3) push (0+2) push (0+1) push (0+0) push psw mov psw,#0x00 ; SRC/test_sio.c:193: if(TI) jb _TI,00167$ ljmp 00130$ 00167$: ; SRC/test_sio.c:195: if(dipmod==0){ //just send mov a,_dipmod jnz 00127$ ; SRC/test_sio.c:196: temp=getQ(); lcall _getQ ; SRC/test_sio.c:197: leds(temp); mov _temp,dpl lcall _leds ; SRC/test_sio.c:198: SBUF=temp; mov _SBUF,_temp ; SRC/test_sio.c:199: TI=0; clr _TI ; SRC/test_sio.c:200: while(!TI); 00101$: jnb _TI,00101$ ; SRC/test_sio.c:201: ES=0; clr _ES ; SRC/test_sio.c:202: ET0=1; setb _ET0 sjmp 00130$ 00127$: ; SRC/test_sio.c:204: else if (dipmod==1){ mov a,#0x01 cjne a,_dipmod,00130$ ; SRC/test_sio.c:205: if ( result != DEFAULT_VAL ) mov a,#0xFF cjne a,_result,00172$ sjmp 00122$ 00172$: ; SRC/test_sio.c:209: if ( result > MAX_RESULT ) mov a,_result add a,#0xff - 0x63 jnc 00119$ ; SRC/test_sio.c:211: SBUF = NEWLINE; mov _SBUF,#0x0A ; SRC/test_sio.c:212: moderes(); lcall _moderes ; SRC/test_sio.c:213: TI=0; clr _TI ; SRC/test_sio.c:214: while(!TI); 00104$: jnb _TI,00104$ ; SRC/test_sio.c:215: ES=0; clr _ES ; SRC/test_sio.c:216: ET0=1; setb _ET0 sjmp 00130$ 00119$: ; SRC/test_sio.c:219: else if ( result >= 10 ) clr c mov a,_result subb a,#0x0A clr a rlc a mov r7,a jnz 00116$ ; SRC/test_sio.c:222: SBUF = ( result / 10 ) + 0x30; mov b,#0x0A mov a,_result div ab add a,#0x30 mov _SBUF,a ; SRC/test_sio.c:223: result = result % 10; mov b,#0x0A mov a,_result div ab mov _result,b ; SRC/test_sio.c:224: TI = 0; clr _TI ; SRC/test_sio.c:225: while(!TI); 00107$: jb _TI,00130$ sjmp 00107$ 00116$: ; SRC/test_sio.c:228: else if (result <10) mov a,r7 jz 00130$ ; SRC/test_sio.c:230: SBUF = result + 0x30; mov a,#0x30 add a,_result mov _SBUF,a ; SRC/test_sio.c:231: result = 0xAA; mov _result,#0xAA ; SRC/test_sio.c:232: TI = 0; clr _TI ; SRC/test_sio.c:233: while(!TI); 00110$: jnb _TI,00110$ sjmp 00130$ 00122$: ; SRC/test_sio.c:237: else TI=0; clr _TI 00130$: ; SRC/test_sio.c:243: if(RI) jnb _RI,00133$ ; SRC/test_sio.c:245: leds(0xAA); mov dpl,#0xAA lcall _leds 00133$: pop psw pop (0+0) pop (0+1) pop (0+2) pop (0+3) pop (0+4) pop (0+5) pop (0+6) pop (0+7) pop dph pop dpl pop b pop acc pop bits reti ;------------------------------------------------------------ ;Allocation info for local variables in function 'SetVector' ;------------------------------------------------------------ ;Vector Allocated to stack - _bp -5 ;Address Allocated to registers r6 r7 ;TmpVector Allocated to registers r6 r7 ;------------------------------------------------------------ ; SRC/test_sio.c:251: void SetVector(unsigned char __xdata * Address, void * Vector) ; ----------------------------------------- ; function SetVector ; ----------------------------------------- _SetVector: push _bp mov _bp,sp ; SRC/test_sio.c:256: *Address = 0x02; mov r6,dpl mov r7,dph mov a,#0x02 movx @dptr,a ; SRC/test_sio.c:258: TmpVector = (unsigned char __xdata *) (Address + 1); inc r6 cjne r6,#0x00,00103$ inc r7 00103$: ; SRC/test_sio.c:259: *TmpVector = (unsigned char) ((unsigned short)Vector >> 8); mov a,_bp add a,#0xfb mov r0,a mov ar4,@r0 inc r0 mov ar5,@r0 mov ar4,r5 mov dpl,r6 mov dph,r7 mov a,r4 movx @dptr,a inc dptr mov r6,dpl mov r7,dph ; SRC/test_sio.c:260: ++TmpVector; ; SRC/test_sio.c:261: *TmpVector = (unsigned char) Vector; mov a,_bp add a,#0xfb mov r0,a mov ar5,@r0 mov dpl,r6 mov dph,r7 mov a,r5 movx @dptr,a pop _bp ret ;------------------------------------------------------------ ;Allocation info for local variables in function 'main' ;------------------------------------------------------------ ;c Allocated to registers r6 r7 ;i Allocated to stack - _bp +3 ;dipval Allocated to stack - _bp +4 ;------------------------------------------------------------ ; SRC/test_sio.c:268: void main( void ) ; ----------------------------------------- ; function main ; ----------------------------------------- _main: ; SRC/test_sio.c:274: SetVector( 0x2023, (void *)SIO_ISR ); mov r5,#_SIO_ISR mov r6,#(_SIO_ISR >> 8) mov r7,#0x80 push ar5 push ar6 push ar7 mov dptr,#0x2023 lcall _SetVector dec sp dec sp dec sp ; SRC/test_sio.c:275: SetVector( 0x200B, (void *)TIMER_KB); mov r5,#_TIMER_KB mov r6,#(_TIMER_KB >> 8) mov r7,#0x80 push ar5 push ar6 push ar7 mov dptr,#0x200B lcall _SetVector dec sp dec sp dec sp ; SRC/test_sio.c:276: SetVector( 0x202B, (void *)TIMER_T2); mov r5,#_TIMER_T2 mov r6,#(_TIMER_T2 >> 8) mov r7,#0x80 push ar5 push ar6 push ar7 mov dptr,#0x202B lcall _SetVector dec sp dec sp dec sp ; SRC/test_sio.c:277: init_sio_timer( S2400 ); mov dpl,#0xF4 lcall _init_sio_timer ; SRC/test_sio.c:279: moderes(); lcall _moderes ; SRC/test_sio.c:281: while(1){ 00145$: ; SRC/test_sio.c:282: if(readdip()==0x01){ //CALC lcall _readdip mov r7,dpl cjne r7,#0x01,00185$ sjmp 00186$ 00185$: ljmp 00142$ 00186$: ; SRC/test_sio.c:283: dipmod=1; mov _dipmod,#0x01 ; SRC/test_sio.c:284: if(frontQ!=endQ){ mov a,_endQ cjne a,_frontQ,00187$ ljmp 00136$ 00187$: ; SRC/test_sio.c:286: ET0=0; //запрещем прерывания таймера. clr _ET0 ; SRC/test_sio.c:287: c = getQ(); //считываем значения из буфера lcall _getQ ; SRC/test_sio.c:288: leds(c); mov r6,dpl mov r7,#0x00 push ar7 push ar6 lcall _leds pop ar6 pop ar7 ; SRC/test_sio.c:290: if (c>=0x30 &&c<=0x39 ) { clr c mov a,r6 subb a,#0x30 mov a,r7 xrl a,#0x80 subb a,#0x80 jnc 00188$ ljmp 00132$ 00188$: clr c mov a,#0x39 subb a,r6 clr a xrl a,#0x80 mov b,r7 xrl b,#0x80 subb a,b jc 00132$ ; SRC/test_sio.c:291: switch (mode) { mov a,#0x01 cjne a,_mode,00190$ sjmp 00101$ 00190$: mov a,#0x02 ; SRC/test_sio.c:292: case 1: cjne a,_mode,00115$ sjmp 00108$ 00101$: ; SRC/test_sio.c:293: if (d1 == 0xFF) mov a,#0xFF cjne a,_d1,00106$ ; SRC/test_sio.c:294: d1 = (c-0x30); mov ar5,r6 mov a,r5 add a,#0xD0 mov _d1,a sjmp 00145$ 00106$: ; SRC/test_sio.c:295: else if (d1 < 10) { mov a,#0x100 - 0x0A add a,_d1 jc 00103$ ; SRC/test_sio.c:296: d1 *= 10; mov a,_d1 mov b,#0x0A mul ab mov _d1,a ; SRC/test_sio.c:297: d1 += (c - 0x30); mov ar5,r6 mov a,r5 add a,#0xD0 mov r5,a mov r4,_d1 add a,r4 mov _d1,a ljmp 00145$ 00103$: ; SRC/test_sio.c:300: mistake(); lcall _mistake ; SRC/test_sio.c:301: break; ljmp 00145$ ; SRC/test_sio.c:303: case 2: 00108$: ; SRC/test_sio.c:304: if (d2 == 0xFF) mov a,#0xFF cjne a,_d2,00113$ ; SRC/test_sio.c:305: d2 = (c-0x30); mov ar5,r6 mov a,r5 add a,#0xD0 mov _d2,a ljmp 00145$ 00113$: ; SRC/test_sio.c:306: else if (d2 < 10){ mov a,#0x100 - 0x0A add a,_d2 jc 00110$ ; SRC/test_sio.c:307: d2 *= 10; mov a,_d2 mov b,#0x0A mul ab mov _d2,a ; SRC/test_sio.c:308: d2 += (c - 0x30); mov ar5,r6 mov a,r5 add a,#0xD0 mov r5,a mov r4,_d2 add a,r4 mov _d2,a ljmp 00145$ 00110$: ; SRC/test_sio.c:311: mistake(); lcall _mistake ; SRC/test_sio.c:312: break; ljmp 00145$ ; SRC/test_sio.c:313: default: 00115$: ; SRC/test_sio.c:314: mistake(); lcall _mistake ; SRC/test_sio.c:316: } ljmp 00145$ 00132$: ; SRC/test_sio.c:319: else if (c == 'D') { //replace to D cjne r6,#0x44,00129$ cjne r7,#0x00,00129$ ; SRC/test_sio.c:320: if(mode!=2) mov a,#0x02 cjne a,_mode,00200$ sjmp 00118$ 00200$: ; SRC/test_sio.c:321: mode = 2; mov _mode,#0x02 ljmp 00145$ 00118$: ; SRC/test_sio.c:323: mistake(); lcall _mistake ljmp 00145$ 00129$: ; SRC/test_sio.c:325: else if (c == '#') { cjne r6,#0x23,00126$ cjne r7,#0x00,00126$ ; SRC/test_sio.c:326: if ( d1 < 100 && d2 > 0 && d2 < 100 ){ mov a,#0x100 - 0x64 add a,_d1 jc 00121$ mov a,_d2 jz 00121$ mov a,#0x100 - 0x64 add a,_d2 jc 00121$ ; SRC/test_sio.c:327: result = d1/d2; mov b,_d2 mov a,_d1 div ab mov _result,a ; SRC/test_sio.c:328: leds(result); mov dpl,_result lcall _leds ; SRC/test_sio.c:329: ES=1; setb _ES ; SRC/test_sio.c:330: TI=1; setb _TI ljmp 00145$ 00121$: ; SRC/test_sio.c:334: mistake(); lcall _mistake ljmp 00145$ 00126$: ; SRC/test_sio.c:341: moderes(); lcall _moderes ljmp 00145$ 00136$: ; SRC/test_sio.c:348: ES=0; clr _ES ; SRC/test_sio.c:349: ET0=1; setb _ET0 ljmp 00145$ 00142$: ; SRC/test_sio.c:354: dipmod=0; mov _dipmod,#0x00 ; SRC/test_sio.c:355: if(frontQ!=endQ){ mov a,_endQ cjne a,_frontQ,00206$ sjmp 00139$ 00206$: ; SRC/test_sio.c:356: ES=1; setb _ES ; SRC/test_sio.c:357: ET0=0; clr _ET0 ; SRC/test_sio.c:358: TI=1; setb _TI ljmp 00145$ 00139$: ; SRC/test_sio.c:361: ES=0; clr _ES ; SRC/test_sio.c:362: ET0=1; setb _ET0 ljmp 00145$ .area CSEG (CODE) .area CONST (CODE) __str_0: .ascii "Mistake has happend" .db 0x0A .db 0x00 __str_1: .ascii "fantom mistake" .db 0x0A .db 0x00 .area XINIT (CODE) .area CABS (ABS,CODE)