Rev 539 | Blame | Compare with Previous | Last modification | View Log | Download
# file opened: ifused_test.asm1 0000 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2 0000 ;; Test case for IFUSED / IFNUSED ;;3 0000 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4 00005 0000 ;; Compilation:6 0000 ;; sjasmplus.exe ifused_test.asm --lstlab --lst=ifused_test.lst7 0000 ;;8 0000 ;; After compilation, please check the listing file "ifused_test.lst"9 000010 000011 0000 ;; This must generate syntax errors12 0000ifused_test.asm(13): error: [IFUSED/IFNUSED] no label defined ahead13 0000 IFUSED ; in commentsifused_test.asm(14): error: [IFUSED/IFNUSED] no label defined ahead14 0000 IFNUSED ; in comments15 000016 0000 ;; All rest of code must be compiled without errors17 000018 0000 start19 000020 0000 ;; Some little user program :)21 000022 0000 CD 0E 00 .noused call EnableInt23 0003 CD 10 00 .used call Wait24 0006 18 FB jr .used25 000826 0008 ;; Some little direct tests27 000828 0008 IFUSED ; in comments29 0008 6F 6B db 'ok'30 000A ELSE31 000A ~ fail32 000A ENDIF33 000A34 000A IFNUSED ; in comments35 000A ~ fail36 000A ELSE37 000A 6F 6B db 'ok'38 000C ENDIF39 000C40 000C IFUSED .used ; in comments41 000C 6F 6B db 'ok'42 000E ELSE43 000E ~ fail44 000E ENDIF45 000E IFUSED start.used ; in comments46 000E org $-246 000C 6F 6B db 'ok'47 000E ELSE48 000E ~ fail49 000E ENDIF50 000E IFUSED @start.used ; in comments51 000E org $-251 000C 6F 6B db 'ok'52 000E ELSE53 000E ~ fail54 000E ENDIF55 000E56 000E IFUSED .noused ; in comments57 000E ~ fail58 000E ENDIF59 000E IFUSED start.noused ; in comments60 000E ~ fail61 000E ENDIF62 000E IFUSED @start.noused ; in comments63 000E ~ fail64 000E ENDIF65 000E66 000E IFUSED not_defined_label ; in comments67 000E ~ fail68 000E ENDIF69 000E70 000E ;; Some little library :)71 000E72 000E EnableInt73 000E IFUSED EnableInt74 000E FB ei75 000F C9 ret76 0010 ENDIF77 001078 0010 Wait IFUSED79 0010 06 FF ld b,#FF80 0012 .loop81 0012 IFUSED EnableInt82 0012 76 .halter halt83 0013 ELSE84 0013 ~ ld c,#FF ;; When the "call EnableInt" is commented out,85 0013 ~ .cycle dec c ;; this branch after ELSE must be generated.86 0013 ~ jr nz,.cycle87 0013 ENDIF ;; End of IFUSED EnableInt88 001389 0013 10 FD djnz .loop90 0015 C9 ret91 0016 ENDIF ;; End of IFUSED Wait92 001693 0016 ;; ADDENDUM: different code path to generate some more syntax errorsifused_test.asm(94): error: Unexpected: &Label94 0016 IFUSED Invalid&Labelifused_test.asm(95): error: Unexpected: %Label95 0016 IFNUSED Invalid%Labelifused_test.asm(96): error: Invalid labelname: .InvalidLabel96 0016 IFUSED ..InvalidLabelifused_test.asm(97): error: Invalid labelname: .InvalidLabel97 0016 IFNUSED ..InvalidLabel98 0016# file closed: ifused_test.asmValue Label------ - -----------------------------------------------------------0x000E EnableInt0x0000 X start0x0000 X start.noused0x0003 start.used0x0010 Wait0x0012 X Wait.halter0x0012 Wait.loop