8051 - RET instruction and the number of bytes popped off the stack

BillO

Joined Nov 24, 2008
992
When you execute a call, what is saved on the stack is an address, not an instruction.

Specifically, the address of the next instruction to be executed on return is saved, not the next instruction itself.

Then when the RET is executed, it restores the address that was saved when the call was made and begins execution at that address.

Address are always two bytes.
 
Top