Rev 126 | Blame | Compare with Previous | Last modification | View Log | Download
# file opened: make_djnz_dot_assemble.asm1 0000 ;; while trying to compile one larger legacy code written with Zeus syntax on mind,2 0000 ;; I run into lines "DJNZ .", which are basically the same thing as "DJNZ $" in sjasmplus3 0000 ;; To avoid editing whole file and replacing those on each occurence, I managed to get4 0000 ;; them fixed by defining this macro at beginning of the file:5 00006 0000 ;; fix "DJNZ ." to "DJNZ $"7 0000 MACRO DJNZ arg0?8 0000 ~ DEFINE .._arg0?9 0000 ~ IFDEF .._.10 0000 ~ djnz $11 0000 ~ ELSE12 0000 ~ djnz arg0?13 0000 ~ ENDIF14 0000 ~ IFDEF .._ ;; extra test for "$" argument, that one produces ".._" define15 0000 ~ UNDEFINE .._16 0000 ~ ELSE17 0000 ~ UNDEFINE .._arg0?18 0000 ~ ENDIF19 0000 ENDM20 000021 0000 ;; let's see it in action22 000023 0000 OrdinaryLabelDjnz DJNZ OrdinaryLabelDjnz23 0000 > DEFINE .._arg0?23 0000 > IFDEF .._.23 0000 ~ > djnz $23 0000 > ELSE23 0000 10 FE > djnz OrdinaryLabelDjnz23 0002 > ENDIF23 0002 > IFDEF .._ ;; extra test for "$" argument, that one produces ".._" define23 0002 ~ > UNDEFINE .._23 0002 > ELSE23 0002 > UNDEFINE .._OrdinaryLabelDjnz23 0002 > ENDIF24 000225 0002 DJNZ $ ;; sjasmplus syntax25 0002 > DEFINE .._arg0?25 0002 > IFDEF .._.25 0002 ~ > djnz $25 0002 > ELSE25 0002 10 FE > djnz $25 0004 > ENDIF25 0004 > IFDEF .._ ;; extra test for "$" argument, that one produces ".._" define25 0004 > UNDEFINE .._25 0004 > ELSE25 0004 ~ > UNDEFINE .._arg0?25 0004 > ENDIF26 000427 0004 DJNZ . ;; Zeus syntax, will be corrected by the macro "DJNZ"27 0004 > DEFINE .._arg0?27 0004 > IFDEF .._.27 0004 10 FE > djnz $27 0006 > ELSE27 0006 ~ > djnz arg0?27 0006 > ENDIF27 0006 > IFDEF .._ ;; extra test for "$" argument, that one produces ".._" define27 0006 ~ > UNDEFINE .._27 0006 > ELSE27 0006 > UNDEFINE .._.27 0006 > ENDIF28 000629 0006 10 FE djnz $ ;; avoid macro by using lowercase :D30 0008# file closed: make_djnz_dot_assemble.asmValue Label------ - -----------------------------------------------------------0x0000 OrdinaryLabelDjnz