Numeroted labels, alias, filename generation

Label serie

You can generate numeroted labels from string + variable(s)

Example:

repeat 16,x
inside{x} ldi
rend
ret

; is like inside1 ldi : inside2 ldi : inside3 ldi : inside4 ldi : inside5 ldi : ...

jumptable
repeat 16,x
defw inside{x}
rend

; is like defw inside1,inside2,inside3,inside4,inside5,...

ld hl,inside10
jp (hl)

Alias serie

repeat 4,x
table{x} equ (x-1)*#4000
rend

; is like

table1 equ #0000
table2 equ #4000
table3 equ #8000
table4 equ #C000

Filenames serie

repeat 10,x
filename{x} incbin 'myfile{x}.bin'
rend

; is like

filename1 incbin 'myfile1.bin'
filename2 incbin 'myfile2.bin'
filename3 incbin 'myfile3.bin'
filename4 incbin 'myfile4.bin'
filename5 incbin 'myfile5.bin'
...
Sauf mention contraire, le contenu de cette page est protégé par la licence Creative Commons Attribution-ShareAlike 3.0 License