Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; 128 = 80h = z80, 32988 = 80DCh = z80unDoC
- notZ80 function cpu,(cpu<>128)&&(cpu<>32988)
- ; make org safer (impossible to overwrite previously assembled bytes) and count padding
- ; and also make it work in Z80 code without creating a new segment
- org macro address
- if notZ80(MOMCPU)
- if address < *
- if assembleZ80SoundDriver
- error "too much stuff before org $\{address} ($\{(*-address)} bytes)"
- else
- error "too much stuff before org $\{address} ($\{(*-address)} bytes) ... try setting assembleZ80SoundDriver=1 in the asm file"
- endif
- elseif address > *
- paddingSoFar set paddingSoFar + address - *
- !org address
- endif
- else
- if address < $
- error "too much stuff before org 0\{address}h (0\{($-address)}h bytes)"
- else
- while address > $
- db 0
- endm
- endif
- endif
- endm
- ; define the cnop pseudo-instruction
- cnop macro offset,alignment
- if notZ80(MOMCPU)
- org (*-1+(alignment)-((*-1+(-(offset)))#(alignment)))
- else
- org ($-1+(alignment)-(($-1+(-(offset)))#(alignment)))
- endif
- endm
Advertisement