adplus-dvertising
frame-decoration

Question

Consider the grammar rule E → E1 - E2 for arith­metic expressions. The code generated is targeted to a CPU having a single user register. The sub­traction operation requires the first operand to be in the register. If E1 and E2 do not have any com­mon sub expression, in order to get the shortest possible code

a.

E1 should be evaluated first

b.

E2 should be evaluated first

c.

Evaluation of E1 and E2 should necessarily be interleaved

d.

Order of evaluation of E1 and E2 is of no consequence

Answer: (b).E2 should be evaluated first

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. Consider the grammar rule E → E1 - E2 for arith­metic expressions. The code generated is targeted to a CPU having a single user register. The sub­traction operation requires the...

Similar Questions

Discover Related MCQs

Q. If 73x (in base-x number system) is equal to 54y (in base-y number system), the possible values of x and y are

Q. Which of the following addressing modes are suitable for program relocation at run time ?

(i) Absolute addressing
(ii) Based addressing
(iii) Relative addressing
(iv) Indirect addressing

Q. Let A = 1111 1010 and B = 0000 1010 be two 8-bit 2's complement numbers. Their product in 2's complement is

Q. A 4-stage pipeline has the stage delays as 150, 120, 160 and 140 nanoseconds respectively. Registers that are used between the stages have a delay of 5 nanoseconds each. Assuming constant clocking rate, the total time taken to process 1000 data items on this pipeline will be

Q. Spatial locality refers to the problem that once a location is referenced

Q. The Principle of locality justifies the use of

Q. A system that has a lot of crashes, data should be written to the disk using?

Q. Which addressing mode is suitable for a high-level language statement?

Q. Which memory unit has the lowest access time?

Q. In a 16-bit instruction code format 3-bit operation code, 12-bit address, and 1 bit is assigned for address mode designation. For indirect addressing, the mode bit is

Q. A 32-bit address bus allows access to a memory of capability

Q. Pipelining improves CPU performance due to?

Q. The system bus consists of

Q. An instruction cycle refers to

Q. A hardware interrupt is

Q. Which of the following is not involved in a memory write operation?

Q. To prevent signals from colliding on the bus, ……………….. Prioritize access to memory by I/o channels and processors.

Q. …………… improve system performance by temporarily storing data during transfers s/w devices or processers that operate at different speeds.

Q. Addressing mode is …………………

Q. Which of the following is not a valid class of interrupts?
1) Program
2) Timer
3) I/o
4) Hardware failure