Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Return statement
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Call/return sequences== {{main|Calling convention}} A number of possible call/return sequences are possible depending on the hardware instruction set, including the following: # The <code>CALL</code> instruction pushes address of the <em>next</em> instruction on the stack and branches to the specified address. The <code>RETURN</code> instruction pops the return address from the stack into the instruction pointer and execution resumes at that address. (Examples: [[x86]], [[PDP-11]]) In architectures such as the [[Motorola 96000]], the stack area may be allocated in a separate address space, which is called 'Stack Memory Space',<ref>{{cite web |url=https://www.nxp.com/docs/en/user-guide/DSP96002UM.pdf#page=27 |title=DSP96002 32-BIT DIGITAL SIGNAL PROCESSOR USER'S MANUAL |page=27(3 - 4) |accessdate=2023-12-24}}</ref> distinct from the main memory address space.<ref>{{cite web |url=https://www.nxp.com/docs/en/user-guide/DSP96002UM.pdf#page=50 |title=DSP96002 32-BIT DIGITAL SIGNAL PROCESSOR USER'S MANUAL |page=50(4 - 11) |accessdate=2023-12-24}}</ref> The [[NEC μPD7720]] also features a stack with its own separate address space.<ref>{{Cite web |url=https://www.datasheetarchive.com/datasheet?id=71b7ef54b1f0964332c3db2035de7589c6d319&type=M&term=upd7720 |title=μPD77C20A, 7720A, 77P20 Digital Signal Processor |page=4(3a-4) |accessdate=2023-12-25}}</ref> # The <code>CALL</code> instruction places address of the <em>next</em> instruction in a register and branches to the specified address. The <code>RETURN</code> instruction sequence places the return address from the register into the instruction pointer and execution resumes at that address. (Examples: [[IBM System/360]] and successors through [[z/Architecture]], most [[reduced instruction set computing|RISC]] architectures) # The <code>CALL</code> instruction places address of the <em>next</em> (or <em>current</em>) instruction in the storage location at the call address and branches to the specified address+1. The <code>RETURN</code> instruction sequence branches to the return address by an [[indirection|indirect]] jump to the first instruction of the subroutine. (Examples: [[IBM 1130]], [[SDS 9 Series|SDS 9XX]], [[PDP-8]])
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)