We have 4 normal registers, r0, r1, r2, r3, whose initial values are all zeros. This CPU has 7 kinds of instructions, MOV, ADD, SUB, CMP, JMP, JLE, JG, whose formats are specified as follows.
: Any register, r1, r2, r3, r4
: positive integer
MOV , copy the constant to the register
MOV , copy the value stored in the register 2 to the register 1
ADD , add the constant to the register
ADD , add the value stored in the register 2 to the register 1
SUB , minus the constant value to the register
SUB , minus the value stored in the register 2 to the register 1
CMP ,
JLE
CMP ,
JLE
CMP ,
JG
CMP ,
JG
JMP
Please fill in the following assembly code which is a translation of the following c code using these introduced instructions and store variable “a” in r0, variable “b” in r1, variable "c" in r2, variable "d" in r3.
We will give you some hints and one "something missing" means one instruction.