MGMT 1030 Lecture Notes - Lecture 23: Return Statement, Program Counter, Radix

10 views2 pages
MGMT 1030 Lecture 23 Notes Nie’s Decial ad 1’s Biary Copleetary
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
Unlock document

This preview shows half of the first page of the document.
Unlock all 2 pages and 3 million more documents.

Already have an account? Log in

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents