The call
instruction actually does this for you. For example call my_func
would do something like:
push ret_address
jmp my_func
A subsequent ret
call would just use the address you just pushed to jmp
back in a sense. Is there a specific reason that you don’t want to use call
or is it not available for you?
For current position in memory you can try to read the eip
register (can’t write to it).