Blame | Last modification | View Log | Download
# file opened: relocation_mem_read.asm1 0000 DEVICE ZXSPECTRUM482 0000 ORG $80003 80004 8000 ; generally speaking, the `{<adr>}` operator is cancelling relocation5 8000 ; of <adr> expression and operates in absolute way with the assembling-time6 8000 ; address and memory content - seems this way it yields most logical outcomes7 80008 8000 RELOCATE_START9 8000 34 12 label1: DW 0x123410 8002 00 80 label2: DW label1 ; should be relocated11 800412 8004 IF 0x1234 == {label1} ; should be true13 8004 21 02 80 ld hl,label2 ; should be relocated14 8007 ENDIF15 8007 IF label1 == {label2} ; should be true (relocation unstability doesn't matter)16 8007 11 00 80 ld de,label1 ; should be relocated17 800A ENDIF18 800A19 800A 21 34 12 ld hl,{label1} ; regular 0x1234 value (reads the correct one always)20 800D21 800D ; ! this lost "needs relocation" property by indirection: be careful when using {adr}22 800D 11 00 80 ld de,{label2}23 801024 8010 ; this should always evaluate to true (not affected by relocation juggling)25 8010 FF DB 0x1234 == {label1}26 801127 8011 34 92 DW {label1} + label1 ; should be relocated (0x1234 + label1)relocation_mem_read.asm(28): warning[relunstable]: Relocation makes one of the expressions unstable, resulting machine code is not relocatable28 8013 34 DB low ({label1} + label1) ; should warn (byte(0x1234 + label1) is affected)29 801430 8014 ; byte-reading variants use the same technique31 8014 FF DB 0x34 == {b label1} ; should be true32 8015 34 80 DW {b label1} + label1 ; should be relocatedrelocation_mem_read.asm(33): warning[relunstable]: Relocation makes one of the expressions unstable, resulting machine code is not relocatable33 8017 34 DB low ({b label1} + label1) ; should warn34 801835 8018 RELOCATE_END36 801837 8018 02 80 05 80 RELOCATE_TABLE37 801C 08 80 11 8037 8020 15 8038 8022# file closed: relocation_mem_read.asmValue Label------ - -----------------------------------------------------------0x8000 label10x8002 label20x0005 X relocate_count0x000A X relocate_size