MGMT 1030 Lecture Notes - Lecture 22: Subroutine

10 views2 pages
MGMT 1030 Lecture 22 Notes Program Control Instructions
Introduction
Rotate instructions take the bits as they exit and rotate them back into the other end of
the register.
Some instructions sets include the carry or overflow bit as part of the rotation.
Some CPUs also allow the rotation to take place between two registers.
Rotate instructions can be used to exchange the 2 bytes of data in a 16-bit word, for
example, by rotating the word by 8 bits.
Program control instructions control the flow of a program.
Program control instructions include jumps and branches, both unconditional and
conditional, and also subroutine CALL and RETURN instructions.
Various conditional tests are provided, including those with which you are already
familiar
Branch on zero, branch on nonzero, branch on positive, branch on negative, branch on
carry, and so on.
CALL instructions, sometimes known as JUMP SUBROUTINE instructions, are used to
implement subroutine, procedure and function calls.
Thus, CALL instructions are important as a means to enable program modularization.
From your programming experience, recall what happens when your program calls a
subroutine or procedure.
The program jumps to the starting location of the subroutine and executes the code in
the subroutine.
When the subroutine is completed, program execution returns to the calling program
and continues with the instruction following the call.
The machine language CALL instruction works the same way.
The bits as they exit and rotate them back into the other end of the register.
Some instructions sets include the carry or overflow bit as part of the rotation.
Some CPUs also allow the rotation to take place between two registers.
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