MGMT 1030 Lecture Notes - Lecture 23: Return Statement, Program Counter, Radix
![](https://new-preview-html.oneclass.com/vDJXRW43rKxVjzOLeB3RNwgy7pB8eGMq/bg1.png)
MGMT 1030 Lecture 23 Notes – Nie’s Decial ad 1’s Biary Copleetary
Representations
Introduction
• A jump to the starting location of the subroutine occurs, and execution continues from
that point.
• The only difference between a CALL instruction and a normal JUMP instruction is that
the CALL instruction must also save somewhere the program counter address from
which the jump occurred.
• So that the program may return to the instruction in the calling program following the
call after the subroutine is completed.
• The RETURN instruction restores the original value to the program counter, and the
calling program proceeds from where it left off.
• Operation of the CALL and RETURN instructions are illustrated.
• Different computers use different methods to save the return address.
• One common method is to store the return address on a memory stack
• The RETURN instruction operates by removing the address from the stack and moving it
to the program counter.
• The use of stacks is discussed briefly in the next section.
• Another method for performing CALLs and RETURNs is explored.
• For most purposes, computers use a different method of representing signed integers
known as complementary representation.
• With this method, the sign of the number is a natural result of the method and does not
need to be handled separately.
• Also, calculations using complementary representation are consistent for all different
signed combinations of input numbers.
• There are two forms of complementary representation in common use.
• One, known as the radix complement, is discussed
• The starting location of the subroutine occurs, and execution continues from that point.
find more resources at oneclass.com
find more resources at oneclass.com