NASM - The Netwide Assembler

NASM Forum => Using NASM => Topic started by: suncowiam on July 20, 2024, 12:22:24 AM

Title: Call abs_addr-$
Post by: suncowiam on July 20, 2024, 12:22:24 AM
Is there an argument to calculate the target address - next inst to help calculate relative addresses?

I need to compile a specific relative address in a call or jmp instruction.
Title: Re: Call abs_addr-$
Post by: suncowiam on July 20, 2024, 04:45:03 AM
I found a possible solution:

SECTION .text
  call 60000h-next_addr-$$
next_addr:
  mov rax, 1

When compiled, the relative offset will equate to 60000h.  Does anyone else have any better solutions?

Thanks