Lecture 16 Objectives
At the end of today's class you should
KNOW:
- how to define a subroutine in LC-3 assembly language
- the difference between the two subroutine call instructions, JSR and JSRR
- what is meant by a subroutine's calling protocol
BE ABLE TO:
- write an LC-3 assembly language subroutine given the input and
output specifications for that subroutine
- write an LC-3 assembly language calling program that correctly uses a subroutine,
given only the subroutine's calling protocol
Sample Exam Questions:
Write a complete LC-3 subroutine that takes the OR of two register values.
The two values to be OR'd are passed to the
subroutine in R0 and R1. The subroutine returns the result in R2. Use the label
OR for the subroutine's entry point.