Given the following table for a simple CPU Operation OP_Code Symbol Add 000 ADD
ID: 3539259 • Letter: G
Question
Given the following table for a simple CPU
Operation
OP_Code
Symbol
Add
000
ADD
Subtract
001
SUB
NAND
010
NND
NOR
011
NOR
LOAD
100
LOD
STORE
101
STR
JUMP
110
JMP
HALT
111
HLT
there are three numbers stored at Locations 20, 21, and 22. Lets name these locations X, Y, and Z. Lets name Location 23, RESULT. Write the assembly-language code to perform the equation: RESULT = X - Y - Z;
Operation
OP_Code
Symbol
Add
000
ADD
Subtract
001
SUB
NAND
010
NND
NOR
011
NOR
LOAD
100
LOD
STORE
101
STR
JUMP
110
JMP
HALT
111
HLT
Explanation / Answer
LOD X ; put X in the working register
SUB Y ; substract Y from the working register
SUB Z ; substract Z from the working register
STR RESULT ; store the value of the working register to RESULT
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.