Question: QUESTION 3: (a) The following arithmetic expression has to be evaluated. H = [D-(B+C)]/[(E*F)-G] Assume that you cannot use B, C, D, E, F, G

 QUESTION 3: (a) The following arithmetic expression has to be evaluated.

QUESTION 3: (a) The following arithmetic expression has to be evaluated. H = [D-(B+C)]/[(E*F)-G] Assume that you cannot use B, C, D, E, F, G for storing the results of an instruction. You can use temporary registers R1, R2. Write an assembly language program for a hypothetical computer using (iii) (3 marks) (0) Three-address instructions (ii) One-address instructions Zero-address instructions The instructions available for use are as follows: Three address One address LOAD X ADD X,Y,Z STORE X SUB X,Y,Z ADD X MUL X,Y, Z SUB X DIV X, Y, Z MUL X DIV X Symbolic Representation and interpretation for n-address instructions are given below. Number of Addresses 3 2 Symbolic Representation OP A, B, C OP A,B OP A OP Interpretation A - B OPC A- A OP B AC ACOPA T- (T-1) OPT 1 0 AC = accumulator T = top of stack (T-1) = second element of stack A,B,C = memory or register locations Continued... QUESTION 3: (a) The following arithmetic expression has to be evaluated. H = [D-(B+C)]/[(E*F)-G] Assume that you cannot use B, C, D, E, F, G for storing the results of an instruction. You can use temporary registers R1, R2. Write an assembly language program for a hypothetical computer using (iii) (3 marks) (0) Three-address instructions (ii) One-address instructions Zero-address instructions The instructions available for use are as follows: Three address One address LOAD X ADD X,Y,Z STORE X SUB X,Y,Z ADD X MUL X,Y, Z SUB X DIV X, Y, Z MUL X DIV X Symbolic Representation and interpretation for n-address instructions are given below. Number of Addresses 3 2 Symbolic Representation OP A, B, C OP A,B OP A OP Interpretation A - B OPC A- A OP B AC ACOPA T- (T-1) OPT 1 0 AC = accumulator T = top of stack (T-1) = second element of stack A,B,C = memory or register locations Continued

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!