CPSC1050 Lab 4
CPSC1050 Lab 4
Lab Instructions
Lab Questions
3. [8 points] Given the following assembly program, consider three different values for
INPUT (1, 2, or 3). For each input value, trace the code by writing the values of
Accumulator, Memory (ONE), Memory (TWO), and OUTPUT in a table (shown below)
and recording their changes after each instruction. You should have 3 trace tables for 3
different values of input.
1
CPSC 1050: Lab 4
LDI 6
COUNT JZR DONE
OUT
SUB ONE
JMP COUNT
DONE STP
ONE DAT 1
Set num to 10
WHILE (num is greater than 0)
Print num
Set num to num – 2
END WHILE
Lab Submission
You must only submit one pdf file. Save your file as yourName_Lab4.pdf and submit to
Brightspace.