Rev 539 | Blame | Compare with Previous | Last modification | View Log | Download
# file opened: incbin80k.asm1 0000 DEVICE ZXSPECTRUMNEXT1 0000 SLOT 71 0000 LABELSLIST "incbin80k.lbl"2 0000 ; incbin80k.bin is from offset 2 letters 'a' to 't' with linux newlines (byte 10)3 0000 ; for each letter, there's 80 of them + newline, repeated 51 times4 0000 ; such one letter block = 51*81 = 4131 bytes (just over 4ki), there's 20 letters5 0000 ; = 82620 bytes (plus 2 bytes at beginning making it "binary" file for git)6 00007 0000 ; try short incbin (no paging) first into page 208 0000 ORG 0xE0009 E000 MMU 7 n, 2010 E000 short_start:11 E000 INCBIN "incbin80k/incbin80k.bin",2,8112 E051 short_end:13 E051 ASSERT $$ == 20 && $ == 0xE000 + 8114 E051 ASSERT {0xE000} == "aa" && {0xE000+79} == "\na"15 E05116 E051 ; try 3-page long incbin into pages 21, 22, 2317 E051 MMU 7 n, 2118 E051 ORG 0xE00019 E000 p3_start:20 E000 INCBIN "incbin80k/incbin80k.bin",2,81*51*4 ; include four letters (16524 bytes)21 E08C p3_end:22 E08C PAGE 2122 E08C ASSERT {0xE000} == "aa" && {0xE000+79} == "\na" && {0xE000+81*51} == "bb" && {0xFFFE} == "bb"23 E08C PAGE 2223 E08C ASSERT {0xE000} == "bb" && {0xE000+81*102-0x2000-2} == "\nb"24 E08C ASSERT {0xE000+81*102-0x2000} == "cc" && {0xE000+81*153-0x2000-2} == "\nc"25 E08C ASSERT {0xE000+81*153-0x2000} == "dd" && {0xFFFE} == "dd"26 E08C PAGE 2326 E08C ASSERT {0xE000} == "dd" && {0xE000+81*204-0x4000-2} == "\nd"27 E08C ASSERT {0xE000+81*204-0x4000} == 028 E08C29 E08C ; try error by including beyond device RAM range30 E08C MMU 7, 23 ; reset wrapping behaviour for slot 7, keep page 2331 E08C err_start:incbin80k.asm(32): error: Write outside of device memory at: 6553632 E08C INCBIN "incbin80k/incbin80k.bin",2,81*51*2 ; include two letters (8+ki)33 00D2 err_end:34 00D235 00D2 ; try full length 80+ki binary include36 00D2 MMU 7 n, 30 ; map pages 30, 31, 32, .., 40 (11 pages long)37 00D2 ORG 0xE00038 E000 long_start:39 E000 INCBIN "incbin80k/incbin80k.bin",2 ; include 20 letters from offset 240 E2BC long_end:41 E2BC PAGE 3041 E2BC ASSERT {0xE000} == "aa" && {0xE000+79} == "\na" && {0xE000+81*51} == "bb" && {0xFFFE} == "bb"42 E2BC PAGE 3142 E2BC ASSERT {0xE000} == "bb" && {0xE000+81*102-0x2000-2} == "\nb"43 E2BC ASSERT {0xE000+81*102-0x2000} == "cc" && {0xE000+81*153-0x2000-2} == "\nc"44 E2BC ASSERT {0xE000+81*153-0x2000} == "dd" && {0xFFFE} == "dd"45 E2BC PAGE 3245 E2BC ASSERT {0xE000} == "dd" && {0xE000+81*204-0x4000-2} == "\nd"46 E2BC ASSERT {0xE000+81*204-0x4000} == "ee" && {0xE000+81*255-0x4000-2} == "\ne"47 E2BC PAGE 3747 E2BC ASSERT {0xE000} == "nn" && {0xE000+81*51*14-0xE000-2} == "\nn"48 E2BC ASSERT {0xE000+81*51*14-0xE000} == "oo" && {0xE000+81*51*15-0xE000-2} == "\no"49 E2BC ASSERT {0xE000+81*51*15-0xE000} == "pp" && {0xFFFE} == "pp"50 E2BC PAGE 3850 E2BC ASSERT {0xE000} == "pp" && {0xE000+81*51*16-0x10000-2} == "\np"51 E2BC ASSERT {0xE000+81*51*16-0x10000} == "qq" && {0xE000+81*51*17-0x10000-2} == "\nq"52 E2BC ASSERT {0xE000+81*51*17-0x10000} == "rr" && {0xFFFE} == "rr"53 E2BC PAGE 4053 E2BC ASSERT {0xE000} == "tt" && {0xE000+81*51*20-0x14000-2} == "\nt"54 E2BC ASSERT {0xE000+81*51*20-0x14000} == 0 && {0xFFFE} == 055 E2BC56 E2BC ; incbin in no-device mode: includes whole file, addressing goes into 16+ bit realm57 E2BC DEVICE NONE58 E2BC ORG 0xE00059 E000 nodevice_start:incbin80k.asm(60): warning: RAM limit exceeded 0x10000 by ORG60 E000 INCBIN "incbin80k/incbin80k.bin",2 ; include 20 letters from offset 261 22BC nodevice_end: ; emits warning about going over 0x1000062 22BC63 22BC ; switch back to ZX Next to produce labels list64 22BC ORG 064 0000 DEVICE ZXSPECTRUMNEXT ; slot 7 is still in "wrap", but $ is beyond (error) => org 0 needed65 000066 0000 ; one more test of case when even wrapping MMU runs out of next pages67 0000 MMU 7 n, 222 ; two pages left: 222, 223, try to include 3 pages68 0000 ORG 0xE00069 E000 noram_start: ; emit error of running out of free memory pagesincbin80k.asm(70): error: No more memory pages to map next one into slot: 770 E000 INCBIN "incbin80k/incbin80k.bin",2,81*51*4 ; include four letters (16524 bytes)71 008C noram_end:72 008C PAGE 22272 008C ASSERT {0xE000} == "aa" && {0xE000+79} == "\na" && {0xE000+81*51} == "bb" && {0xFFFE} == "bb"73 008C PAGE 22373 008C ASSERT {0xE000} == "bb" && {0xE000+81*102-0x2000-2} == "\nb"74 008C ASSERT {0xE000+81*102-0x2000} == "cc" && {0xE000+81*153-0x2000-2} == "\nc"75 008C ASSERT {0xE000+81*153-0x2000} == "dd" && {0xFFFE} == "dd"76 008Cincbin80k.asm(77): error: Write outside of device memory at: 6567677 008C 00 nop ; check error message wording in case of further write78 008D# file closed: incbin80k.asmValue Label------ - -----------------------------------------------------------0x100D2 X err_end0xE08C X err_start0xE2BC X long_end0xE000 X long_start0x222BC X nodevice_end0xE000 X nodevice_start0x1008C X noram_end0xE000 X noram_start0xE08C X p3_end0xE000 X p3_start0xE051 X short_end0xE000 X short_start