CSCE 2214 Lecture Notes - Lecture 15: Calling Convention, Program Counter

35 views3 pages

Document Summary

Execution of a procedure / calling convention / The code shows the address of the instructions. 80012 bne , , exit (the immediate jump value is 2) 80020 j loop (the immediate jump value is 20000) When the branch target is too far away. When the branch target is too far to encode with a simple 16-bit offset then assembler rewrites the code into two instructions. If the target l1 is too far the code will be translated to the following: The address pc+8 (program counter plus 8) is saved in register to have a link to the second instruction following the jump instruction for the procedure to return to. Then the procedure can do a jump on register, which simply returns with no linking. Set of rules which define where data is placed during function calls, who saves/restores data, and what data should be stored. All calling conventions have something in common.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents