I have the following basic assembly program to call a function that sets the return value as 22
and then exits:
.globl _start
_start:
call update_value
mov $1, %rax
int $0x80
update_value:
mov $22, %rbx
ret
Without using the call
, ret
instructions, how would this be done? I think conceptually it translates to:
# call update_value
push <return_address>
jmp update_value
# ret
pop
jmp <return_address>
But how would this actually be done in valid assembly?