>     skip( "label constants unimplemented in assembler", 1 );
>     set I4, 42
>     set I5, HERE
>     jump    I5
>     set I4, 1234
> HERE:
>     print   I4
>     end

HERE will be relative, so what you'll really get is * - HERE (where * is
the PC for the set command). Then, when you jump (which is a relative
jump), you won't end up where you'd like. You need to be able to do
some fancy label arithmetic in the assembler if all you are going to
have is relative jumps.

Much better in my opinion is to have some absolute addressing modes for
the jumps. Maybe use 'D' for relative and 'd' for absolute in
opcode_table? If we then had jump_da (jump with absolute destination)
that didn't require a prior set, you're example would be much
simplified.

If we have to/want to put addresses in registers, it will almost always
need to be absolute with a set, but probably having label syntax of
&LABEL for absolute and LABEL for relative (or something) would work.


Regards,

-- Gregor


Reply via email to