Rev 539 | Blame | Compare with Previous | Last modification | View Log | Download
# file opened: low_mem_access_warning.asm1 0000 ;;;;;;; warning emitting test (for all affected instructions) ;;;;;;;;;;2 0000 OPT reset -Wrdlow ; default syntax, enable rdlow warning3 0000 ; round parentheses memory access to low address 0..255 emits warninglow_mem_access_warning.asm(4): warning[rdlow]: Reading memory at low address: 14 0000 3A 01 00 ld a,(1)low_mem_access_warning.asm(5): warning[rdlow]: Reading memory at low address: 25 0003 2A 02 00 ld hl,(2)low_mem_access_warning.asm(6): warning[rdlow]: Reading memory at low address: 36 0006 ED 4B 03 00 ld bc,(3)low_mem_access_warning.asm(7): warning[rdlow]: Reading memory at low address: 47 000A ED 5B 04 00 ld de,(4)low_mem_access_warning.asm(8): warning[rdlow]: Reading memory at low address: 58 000E ED 7B 05 00 ld sp,(5)low_mem_access_warning.asm(9): warning[rdlow]: Reading memory at low address: 69 0012 DD 2A 06 00 ld ix,(6)low_mem_access_warning.asm(10): warning[rdlow]: Reading memory at low address: 710 0016 FD 2A 07 00 ld iy,(7)11 001A ; addresses 256+ are of course OK by default12 001A 3A 01 01 ld a,(0x101)13 001D 2A 02 01 ld hl,(0x102)14 0020 ED 4B 03 01 ld bc,(0x103)15 0024 ED 5B 04 01 ld de,(0x104)16 0028 ED 7B 05 01 ld sp,(0x105)17 002C DD 2A 06 01 ld ix,(0x106)18 0030 FD 2A 07 01 ld iy,(0x107)19 0034 ; square brackets are without warning20 0034 3A 01 00 ld a,[1]21 0037 2A 02 00 ld hl,[2]22 003A ED 4B 03 00 ld bc,[3]23 003E ED 5B 04 00 ld de,[4]24 0042 ED 7B 05 00 ld sp,[5]25 0046 DD 2A 06 00 ld ix,[6]26 004A FD 2A 07 00 ld iy,[7]27 004E ; immediates are also ok28 004E 3E 01 ld a,129 0050 21 02 00 ld hl,230 0053 01 03 00 ld bc,331 0056 11 04 00 ld de,432 0059 31 05 00 ld sp,533 005C DD 21 06 00 ld ix,634 0060 FD 21 07 00 ld iy,735 006436 0064 OPT reset --syntax=b ; syntax "b" (round parentheses mark memory access only)37 0064 ; should behave identically to default ("b" doesn't affect these)38 0064 ; round parentheses memory access to low address 0..255 emits warninglow_mem_access_warning.asm(39): warning[rdlow]: Reading memory at low address: 139 0064 3A 01 00 ld a,(1)low_mem_access_warning.asm(40): warning[rdlow]: Reading memory at low address: 240 0067 2A 02 00 ld hl,(2)low_mem_access_warning.asm(41): warning[rdlow]: Reading memory at low address: 341 006A ED 4B 03 00 ld bc,(3)low_mem_access_warning.asm(42): warning[rdlow]: Reading memory at low address: 442 006E ED 5B 04 00 ld de,(4)low_mem_access_warning.asm(43): warning[rdlow]: Reading memory at low address: 543 0072 ED 7B 05 00 ld sp,(5)low_mem_access_warning.asm(44): warning[rdlow]: Reading memory at low address: 644 0076 DD 2A 06 00 ld ix,(6)low_mem_access_warning.asm(45): warning[rdlow]: Reading memory at low address: 745 007A FD 2A 07 00 ld iy,(7)46 007E ; addresses 256+ are of course OK by default47 007E 3A 01 01 ld a,(0x101)48 0081 2A 02 01 ld hl,(0x102)49 0084 ED 4B 03 01 ld bc,(0x103)50 0088 ED 5B 04 01 ld de,(0x104)51 008C ED 7B 05 01 ld sp,(0x105)52 0090 DD 2A 06 01 ld ix,(0x106)53 0094 FD 2A 07 01 ld iy,(0x107)54 0098 ; square brackets are without warning55 0098 3A 01 00 ld a,[1]56 009B 2A 02 00 ld hl,[2]57 009E ED 4B 03 00 ld bc,[3]58 00A2 ED 5B 04 00 ld de,[4]59 00A6 ED 7B 05 00 ld sp,[5]60 00AA DD 2A 06 00 ld ix,[6]61 00AE FD 2A 07 00 ld iy,[7]62 00B2 ; immediates are also ok63 00B2 3E 01 ld a,164 00B4 21 02 00 ld hl,265 00B7 01 03 00 ld bc,366 00BA 11 04 00 ld de,467 00BD 31 05 00 ld sp,568 00C0 DD 21 06 00 ld ix,669 00C4 FD 21 07 00 ld iy,770 00C871 00C8 OPT reset --syntax=B ; syntax "B" (square brackets only for memory access)72 00C8 ; should turn round parentheses into immediates = no warning73 00C8 ; immediates in round parentheses74 00C8 3E 01 ld a,(1)75 00CA 21 02 00 ld hl,(2)76 00CD 01 03 00 ld bc,(3)77 00D0 11 04 00 ld de,(4)78 00D3 31 05 00 ld sp,(5)79 00D6 DD 21 06 00 ld ix,(6)80 00DA FD 21 07 00 ld iy,(7)81 00DE ; still immediateslow_mem_access_warning.asm(82): warning: value 0x101 is truncated to 8bit value: 0x0182 00DE 3E 01 ld a,(0x101) ; correct warning about truncating value83 00E0 21 02 01 ld hl,(0x102)84 00E3 01 03 01 ld bc,(0x103)85 00E6 11 04 01 ld de,(0x104)86 00E9 31 05 01 ld sp,(0x105)87 00EC DD 21 06 01 ld ix,(0x106)88 00F0 FD 21 07 01 ld iy,(0x107)89 00F4 ; square brackets are without warning90 00F4 3A 01 00 ld a,[1]91 00F7 2A 02 00 ld hl,[2]92 00FA ED 4B 03 00 ld bc,[3]93 00FE ED 5B 04 00 ld de,[4]94 0102 ED 7B 05 00 ld sp,[5]95 0106 DD 2A 06 00 ld ix,[6]96 010A FD 2A 07 00 ld iy,[7]97 010E ; immediates are also ok98 010E 3E 01 ld a,199 0110 21 02 00 ld hl,2100 0113 01 03 00 ld bc,3101 0116 11 04 00 ld de,4102 0119 31 05 00 ld sp,5103 011C DD 21 06 00 ld ix,6104 0120 FD 21 07 00 ld iy,7105 0124106 0124107 0124 ;;;;;;; warning suppression mechanisms ;;;;;;;;;;108 0124 OPT reset --syntax=abfw109 0124 ; warning not suppressed or wrongly suppressed -> emit warninglow_mem_access_warning.asm(110): error: Reading memory at low address: 1110 0124 3A 01 00 ld a,(1)low_mem_access_warning.asm(111): error: Reading memory at low address: 1111 0127 3A 01 00 ld a,(1) ;low_mem_access_warning.asm(112): error: Reading memory at low address: 1112 012A 3A 01 00 ld a,(1) ;low_mem_access_warning.asm(113): error: Reading memory at low address: 1113 012D 3A 01 00 ld a,(1) ;rdlowlow_mem_access_warning.asm(114): error: Reading memory at low address: 1114 0130 3A 01 00 ld a,(1) ;rdlow-low_mem_access_warning.asm(115): error: Reading memory at low address: 1115 0133 3A 01 00 ld a,(1) ;rdlow-olow_mem_access_warning.asm(116): error: Reading memory at low address: 1116 0136 3A 01 00 ld a,(1) ;rdlow-Oklow_mem_access_warning.asm(117): error: Reading memory at low address: 1117 0139 3A 01 00 ld a,(1) ;rdlow-0klow_mem_access_warning.asm(118): error: Reading memory at low address: 1118 013C 3A 01 00 ld a,(1) ;RDLOW-OK (big capitals don't work!)low_mem_access_warning.asm(119): error: Reading memory at low address: 1119 013F 3A 01 00 ld a,(1) ;rdlow-oKlow_mem_access_warning.asm(120): error: Reading memory at low address: 1120 0142 3A 01 00 ld a,(1) ;RDLOW-oklow_mem_access_warning.asm(121): error: Reading memory at low address: 1121 0145 3A 01 00 ld a,(1) ;Rdlow-oklow_mem_access_warning.asm(122): error: Reading memory at low address: 1122 0148 3A 01 00 ld a,(1) ;rdlow-OKlow_mem_access_warning.asm(123): error: Reading memory at low address: 1123 014B 3A 01 00 ld a,(1) ;Rdlow-Ok124 014E125 014E ; warning suppressed correctly126 014E 3A 01 00 ld a,(1) ;rdlow-ok127 0151 3A 01 00 ld a,(1) ;;;;;;;;;;;rdlow-ok128 0154 3A 01 00 ld a,(1) //rdlow-ok129 0157 3A 01 00 ld a,(1) /////rdlow-ok130 015A131 015A ; with whitespace and letters ahead of suppressing text132 015A 3A 01 00 ld a,(1) ; blabla rdlow-ok133 015D 3A 01 00 ld a,(1) ;;;;;;;;;;; blabla rdlow-ok134 0160 3A 01 00 ld a,(1) // blabla rdlow-ok135 0163 3A 01 00 ld a,(1) ///// blabla rdlow-ok136 0166137 0166 ; following include TABs (mixed with spaces)! (make sure they stay there)138 0166 3A 01 00 ld a,(1) ; rdlow-ok139 0169 3A 01 00 ld a,(1) ;;;;;;;;;;; rdlow-ok140 016C 3A 01 00 ld a,(1) // rdlow-ok141 016F 3A 01 00 ld a,(1) ///// rdlow-ok142 0172143 0172 3A 01 00 ld a,(1) ;rdlow-ok.144 0175 3A 01 00 ld a,(1) ;rdlow-ok?145 0178 3A 01 00 ld a,(1) ;rdlow-ok!146 017B 3A 01 00 ld a,(1) ;rdlow-ok+147 017E 3A 01 00 ld a,(1) ;rdlow-ok blabla148 0181149 0181150 0181 ;;;;;;; test suppression for fake instructions ;;;;;;;;;;151 0181 OPT reset --syntax=abflow_mem_access_warning.asm(152): warning[fake]: Fake instruction: ldi a,(hl)152 0181 7E 23 ldi a,(hl) ; warning153 0183 7E 23 ldi a,(hl) ; this is "fake" instruction (warning suppressed by "fake")154 0185 7E 23 ldi a,(hl) ; iz fakeish instruztione (substring can be anywhere)155 0187 ; the "ok" way is removed since v1.19.0, use "fake"156 0187157 0187 ;;;;;;; docs-grade example ;;;;;;;;;;158 0187low_mem_access_warning.asm(159): warning[rdlow]: Reading memory at low address: 20159 0187 3A 14 00 ld a,(16|4) ;warning when accidentally using parentheses around 0..255 value160 018A161 018A 3A C8 00 ld a,(200) ; rdlow-ok Intentionally accessing ROM data at address 200162 018D ; the "rdlow-ok" in the end-of-line-comment does suppress the warning163 018D# file closed: low_mem_access_warning.asmValue Label------ - -----------------------------------------------------------