Rev 539 | Blame | Compare with Previous | Last modification | View Log | Download
# file opened: tapout_test.asm1 0000 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2 0000 ;; Test source for TAPOUT / TAPEND / OUTPUT / OUTEND ;;3 0000 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4 00005 0000 DEFINE tape_file "tapout_test.tap"6 0000 DEFINE pure_code "tapout_test.bin"7 00008 0000 01 01 01 01 db 1,1,1,19 000410 0004 EMPTYTAP "tapout_test.tap" ;; Create empty TAP file11 000412 0004 02 02 02 02 db 2,2,2,213 000814 0008 TAPOUT "tapout_test.tap",0 ;; Basic header15 000816 0008 00 db 0x00 ;; Header type = basic17 0009 48 65 6C 6C db 'HelloWorld' ;; File name17 000D 6F 57 6F 7217 0011 6C 6418 0013 1B 00 dw baslen ;; Total length19 0015 01 00 dw 1 ;; Start line20 0017 1B 00 dw baslen ;; Length of pure basic21 001922 0019 TAPEND ;; End of tape block23 001924 0019 03 03 03 03 db 3,3,3,325 001D26 001D TAPOUT "tapout_test.tap" ;; Basic body27 001D28 001D CODE = 0xAF29 001D USR = 0xC030 001D LOAD = 0xEF31 001D RANDOMIZE = 0xF932 001D33 001D 00 01 basic db 0,1 ;; Line 134 001F 05 00 dw l1len ;; Length of line 135 0021 EF 22 22 AF line1 db LOAD,'""',CODE ;; LOAD "" CODE36 0025 0D db 0x0D ;; End of line 137 002638 0026 l1len = $-line139 002640 0026 00 02 db 0,2 ;; Line 241 0028 0E 00 dw l2len ;; Length of line 242 002A F9 C0 line2 db RANDOMIZE,USR ;; RANDOMIZE USR43 002C44 002C LUA ALLPASS ;; Digits of number45 002C ~ _pc('db "' .. tostring(_c("start")) .. '"')46 002C 33 32 37 36 db "32768"46 0030 3846 0031 ENDLUA47 003148 0031 0E db 0x0E ;; Number follows49 0032 00 00 db 0x00,0x00 ;; 5 bytes of internal50 0034 00 80 dw start ;; number representation51 0036 00 db 0x0052 0037 0D db 0x0D ;; End of line 253 003854 0038 l2len = $-line255 0038 baslen = $-basic56 003857 0038 TAPEND ;; End of tape block58 003859 0038 04 04 04 04 db 4,4,4,460 003C61 003C TAPOUT "tapout_test.tap",0 ;; Bytes header62 003C63 003C 03 db 0x03 ;; Header type = bytes64 003D 48 65 6C 6C db 'HelloWorld' ;; File name64 0041 6F 57 6F 7264 0045 6C 6465 0047 20 00 dw codlen ;; Total length66 0049 00 80 dw start ;; Start address67 004B 00 80 dw 0x800068 004D69 004D TAPEND ;; End of tape block70 004D71 004D 05 05 05 05 db 5,5,5,572 005173 0051 TAPOUT "tapout_test.tap" ;; Bytes body74 0051 OUTPUT "tapout_test.bin" ;; Pure data file75 005176 0051 org 0x8000 ;; Start address of code77 800078 8000 3E 02 start ld a,0x02 ;; Channel 279 8002 CD 01 16 call 0x1601 ;; is opened80 8005 11 0E 80 ld de,text ;; Address of text81 8008 01 12 00 ld bc,txtlen ;; Length of text82 800B C3 3C 20 jp 0x203C ;; Jump to print text83 800E84 800E 0D text db 13 ;; Cursor to next line85 800F 13 01 db 19,1 ;; BRIGHT 186 8011 12 01 db 18,1 ;; FLASH 187 8013 48 65 6C 6C db 'Hello world !' ;; Text87 8017 6F 20 77 6F87 801B 72 6C 64 2087 801F 2188 802089 8020 txtlen = $-text90 8020 codlen = $-start91 802092 8020 OUTEND ;; End of pure data file93 8020 TAPEND ;; End of tape block94 802095 8020 06 06 06 06 db 6,6,6,696 802497 8024 ;; Error cases98 8024tapout_test.asm(99): error: SAVETAP only allowed in real device emulation mode (See DEVICE)99 8024 SAVETAP "nothing",start ;; No DEVICE defined100 8024tapout_test.asm(101): error: [TAPOUT] Missing flagbyte value: TAPOUT "tapout_test.tap",101 8024 TAPOUT "tapout_test.tap", ;; No flagbytetapout_test.asm(102): error: opening file for write:102 8024 TAPOUT ;; No parameters103 8024104 8024 ;; End of test file105 8024# file closed: tapout_test.asmValue Label------ - -----------------------------------------------------------0x001D basic0x001B baslen0x00AF CODE0x0020 codlen0x0005 l1len0x000E l2len0x0021 line10x002A line20x00EF LOAD0x00F9 RANDOMIZE0x8000 start0x800E text0x0012 txtlen0x00C0 USR