LAB 8 - PAUL GONZALES BME 303 LAB SESSION 14345 ; Program:...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
PAUL GONZALES BME 303 LAB SESSION 14345 ; Program: Problem 1 ; Authors: Jignesh Shah, Mickey Moore ; Last modified: 03/21/2005 ; ; Understand what the code is doing and explain it to the TA .ORIG x3000; (starting point at x3000) ; Initialization AND R2, R2, x0; (clearing R2) LD R4, Number1; A LD R5, Number2; B ; Iteration Test (R5 = 0?) Again BRz Done (if the value in R5 is zero, then it will not continue to next line, if it is zero, then you're done) ADD R2, R2, R4; (add R2 and R4, and place in R2) ADD R5, R5, #-1 ; Decrement loop counter (add negative one to R5, store in R5) BR Again (loops back to the beginning BRz, checking if the value is zero) Done HALT (end of the program) ; Data storage Number1 .FILL x0005 (fill the value A with the value x0005) Number2 .FILL x0003 (fill the value B with the value x0003)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
PAUL GONZALES BME 303 LAB SESSION 14345 Problem 2 Write an LC-3 machine language program that performs a bitwise Larger/Smaller-Of- Two of R1=A and R2=B, with the selector R0=S, storing the results in R3=Z, following
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

LAB 8 - PAUL GONZALES BME 303 LAB SESSION 14345 ; Program:...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online