1
votes

This is probally a really stupid question but how do you call a memory address in ASM? I am using the code call dword 557054 (557054 is were code is located...) but I figure that it is calling 557054 + were ever the program got loaded into into memory. I need this for my executable loader...

1
Specifically what architecutre? x86, SPARC, PPC, etc...?Jesus Ramos
x86 using nasm assembleruser1454902

1 Answers

3
votes

There are two ways to do this, you can use CALL or you can use JMP, the second is more flexible but requires you to do a little more work if you want some compatibility with C-style code

Simple c-function call using CALL

push eax ; push args to stack
push ebx
call my_func ; my_func can be a c exported function or defined as a macro or asm function