If my code has
jmp 0x12345678
the assembler calculates the distance from the end of that opcode to the absolute address specified, and then writes a relative jump, that goes from the end of that opcode to the intended destination. However I want to be able to directly code a relative jump. I wish it were possible to do something like this
jmp relative 0x0100
So that if I already, at design time, know exactly how many bytes I will need to jump to get to a certain destination, I would be able to simply type in that relative offset myself. Unfortunately I can't figure out the correct opcode (or compiler directive that would instruct the compiler to treat the parameter after "jmp" as a relative address, rather than an absolute address). As it stands now, it treats the address 0x0100 as a shortened version of 0x00000100, which is of course an absolute address. It even treats it as the absolute address 0x00000100 such when I SPECIFICALLY let it know to treat it as a 2-byte address with the "word" directive like this "jmp word 0x0100" (despite the fact that a 2 byte address could NEVER be an absolute address, and must be a relative address). Is there any way to tell the compiler to take the address parameter in a specific instance of the "jmp" mnemonic as a relative address, rather than an absolute address? I already tried the above mentioned pseudo code "jmp relative 0x0100" in hopes that by pure chance the "relative" directive actually was what I needed. But it wasn't. So I don't know how to do what I'm trying to do.