Question: Given an 8 - bit processor with general purpose register set R = { r 0 , r 1 , r 2 , r 4

Given an 8-bit processor with general purpose register set R={r0,r1,r2,r4,r5,r6,r7}, a set of memory variables M={mi|iin{1,2,cdots}} and a set of all possible immediate values I. The instruction set of the target machine contains the following instructions:
MOV x,Y;xlarrY, ADD x,Y;xlarrx+Y, SUB x,Y;xlarrx-Y, MUL x,Y;xlarrx**Y
DIV x,Y;xlarrxY,CMPx,Y; compares the values in x and Y
JGTLl- jump to level Ll if x>Y after the execution of a CMPx,Y; where lin{1,2,cdots}
JMPLl- unconditional jump to level Ll, where lin{1,2,cdots}
For MOV if xinR then YinRMI; if xinM, then YinR.
For ADD,SUB,MUL,DIV and CMP;xinR and YinRMI.
An mi is required whenever there is a shortage of registers during code generation.
(a) Write the 3-address intermediate code the following code fragment. [8]
Given an 8 - bit processor with general purpose

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 Programming Questions!