;-------------------------------------------------------- ; File Created by SDCC : free open source ANSI-C Compiler ; Version 3.6.0 #9615 (Linux) ;-------------------------------------------------------- ; PIC port for the 14-bit core ;-------------------------------------------------------- ; .file "bug01.c" list p=16f1718 radix dec include "p16f1718.inc" ;-------------------------------------------------------- ; external declarations ;-------------------------------------------------------- extern _LATA extern _LATB extern __sdcc_gsinit_startup ;-------------------------------------------------------- ; global declarations ;-------------------------------------------------------- global _main global PSAVE global SSAVE global WSAVE global STK12 global STK11 global STK10 global STK09 global STK08 global STK07 global STK06 global STK05 global STK04 global STK03 global STK02 global STK01 global STK00 sharebank udata_ovr 0x0070 PSAVE res 1 SSAVE res 1 WSAVE res 1 STK12 res 1 STK11 res 1 STK10 res 1 STK09 res 1 STK08 res 1 STK07 res 1 STK06 res 1 STK05 res 1 STK04 res 1 STK03 res 1 STK02 res 1 STK01 res 1 STK00 res 1 ;-------------------------------------------------------- ; global definitions ;-------------------------------------------------------- ;-------------------------------------------------------- ; absolute symbol definitions ;-------------------------------------------------------- ;-------------------------------------------------------- ; compiler-defined variables ;-------------------------------------------------------- ;-------------------------------------------------------- ; initialized data ;-------------------------------------------------------- ID_bug01_0 idata _cond db 0x00 ID_bug01_1 idata 0x0220 _at0x220 db 0x00 ID_bug01_2 idata 0x0221 _at0x221 db 0xff ;-------------------------------------------------------- ; overlayable items in internal ram ;-------------------------------------------------------- ; udata_ovr ;-------------------------------------------------------- ; reset vector ;-------------------------------------------------------- STARTUP code 0x0000 nop pagesel __sdcc_gsinit_startup goto __sdcc_gsinit_startup ;-------------------------------------------------------- ; code ;-------------------------------------------------------- code_bug01 code ;*** ; pBlock Stats: dbName = M ;*** ;has an exit ;; Starting pCode block S_bug01__main code _main: ; 2 exit points _00112_DS_: ; .line 31; "bug01.c" if (at0x220) { BANKSEL _at0x220 MOVF (_at0x220 + 0),W IORWF (_at0x220 + 1),W BTFSC STATUS,2 GOTO _00106_DS_ ; .line 32; "bug01.c" LATA = 0x11; MOVLW 0x11 BANKSEL _LATA MOVWF _LATA GOTO _00107_DS_ _00106_DS_: ; .line 34; "bug01.c" LATA = 0x22; MOVLW 0x22 BANKSEL _LATA MOVWF _LATA _00107_DS_: ; .line 37; "bug01.c" if (cond) { MOVLW 0x00 BANKSEL _cond IORWF _cond,W BTFSC STATUS,2 GOTO _00109_DS_ ; .line 38; "bug01.c" LATB = 0x33; MOVLW 0x33 BANKSEL _LATB MOVWF _LATB GOTO _00112_DS_ _00109_DS_: ; .line 40; "bug01.c" LATB = 0x44; MOVLW 0x44 BANKSEL _LATB MOVWF _LATB GOTO _00112_DS_ RETURN ; exit point of _main ; code size estimation: ; 20+ 6 = 26 instructions ( 64 byte) end