Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What does 'ret' stands for?

Status
Not open for further replies.

nurv

Instructor
Feb 6, 2004
1
US
What does 'ret' stands for in asm?
Thank you!
 
Programs are set in motion by the operating system. When the program is finished, it must return control to the operating system. RET does this. Subprograms also use RET to return control to a calling program. RET works using the stack. It stands for RETURN.
 
Each time a function (or procedure) is called (with CALL) a memory address is pushed upon the stack.
When the function has finished it executes a RETurn, which pops the address from the stack and continues execution at this address.

;Main
...
CALL proc ;push this address and jump to proc
...

;proc
...
RET ;pop 4 bytes (the return address if stack well maintained) and jump to this address
Regards,
Bert Vingerhoets
vingerhoetsbert@hotmail.com
Don't worry what people think about you. They're too busy wondering what you think about them.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top