It's about "load" instruction.
macro jmp arg
{
jmp arg
load x byte from arg
if x = 0xEB
load y byte from arg+1
store byte ((arg+y)-$+2) and 0xFF at $-1
end if
}
This code works fine only if jmp tryes to jmp on before assembled code. I.e.
main:
nop
l1: jmp main
nop
jmp l1
This will produse jmp on main, not on l1.
But if i try to do "forward" jmp
main:
jmp l1
nop
l1: jmp l2
nop
l2: hlt
- I have an error. "error: value out of range."
I think, that if I will detect first assemble pass, and on this pass I simple do jmp arg, but on next pass I do load - it will be work. Is it correct?
And how i can detect first assembly pass?