Question: 5. Given the following Super Simple CPU program: LDI 6 ; Load 6 into accumulator SUB ONE ; Subtract the value in memory location ONE
5. Given the following "Super Simple CPU" program: LDI 6 ; Load 6 into accumulator SUB ONE ; Subtract the value in memory location ONE from accumulator ADD TWO ; Add the value in memory location Two to accumulator DONE STO ONE ; Store accumulator in memory location ONE STP ; Stop the program ONE DAT 1 ; A data value, the constant 1 TWO DAT 2 ; A data value, the constant 2 3 a. [4] Trace the code, write the values of Accumulator, Memory (ONE), and Memory (TWO) in a table (sample table is shown below), and record their changes after each instruction. Assembly instruction Accumulator ONE TWO LDI 6 1 2 6 2 b. [4] Write a pseudocode that performs the same program
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
