Question: Read three integers x , y , and z . If x > y then Set x to x + z - y Output x

Read three integers x,y, and z.
If x>y then
Set x to x+z-y
Output x
Else
Output 0
(12 points) Consider the following Assembly program and the opcode table in Fig-
ure 1.
(a) What does the program do? Explain this by writing an algorithm in pseudocode
that is equivalent to this assembly code.
(b) Assuming the machine instruction is composed of a 4-bit opcode and a 5-bit
address field; give the binary machine code for the first 3 instructions only.
(c) What value is entered in the symbol table for the symbols LOOP, SUB, DONE, X, Y,
and ZERO in the previous assembly program? (Assume that the program is loaded
beginning with memory location 0).
Figure 1: Typical assembly language instruction set
 Read three integers x,y, and z. If x>y then Set x

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!