List of Intermediate Code Quadruples
for Projects 2 and 3

Note:

QUADRUPLEMEANING
Copying and Converting Scalars
COPYBb1b3 b3 := b1
COPYIi1i3 i3 := i1
COPYRr1r3 r3 := r1
COPYI2Ri1 r3r3 := i1 converted to a real number.
COPYR2Ir1 i3i3 := r1 converted to an integer.
Reading and Writing Array Elements
LDBi1b2b3 b3 := b2[i1]
LDIi1i2i3 i3 := i2[i1]
LDRi1r2r3 r3 := r2[i1]
STBi1b2b3 b3[i1] := b2
STIi1i2i3 i3[i1] := i2
STRi1r2r3 r3[i1] := r2
Integer Arithmetic
ADDIi1i2i3 i3 := i1 + i2
SUBIi1i2i3 i3 := i1 - i2
MULIi1i2i3 i3 := i1 * i2
DIVIi1i2i3 i3 := i1 / i2
MODi1i2i3 i3 := i1 mod i2
Real Arithmetic
ADDRr1r2 r3r3 := r1 + r2
SUBRr1r2 r3r3 := r1 - r2
MULRr1r2 r3r3 := r1 * r2
DIVRr1r2 r3r3 := r1 / r2
Relational Operators
LTIi1i2b3 set b3 to true if i1 < i2, else set b3 false.
LTEQIi1i2 b3 set b3 to true if i1 < i2 or i1 = i2, else set b3 false.
EQIi1i2b3 set b3 to true if i1 = i2, else set b3 false.
NEQIi1i2b3 set b3 to false if i1 = i2, else set b3 true.
LTRr1r2b3 set b3 to true if r1 < r2, else set b3 false.
LTEQRr1r2 b3 set b3 to true if r1 < r2 or r1 = r2, else set b3 false.
EQRr1r2b3 set b3 to true if r1 = r2, else set b3 false.
NEQRr1r2 b3set b3 to false if r1 = r2, else set b3 true.
Logical Operators
ANDb1b2b3 b3 := b1 and b2
ORb1b2b3 b3 := b1 or b2
NOTb1b3 b3 := not b1
Branches, Jumps, and Labels
BFALSEb1L2 branch to L2 if b1 is false.
JUMPL1 jump to L1.
LABELL1 mark location of label L1.
Procedure and Function Calls
PARAMBb1 b1 is an argument in the next CALL, CALLB, CALLI, or CALLR quadruple.
PARAMIi1 i1 is an argument in the next CALL, CALLB, CALLI, or CALLR quadruple.
PARAMRr1 r1 is an argument in the next CALL, CALLB, CALLI, or CALLR quadruple.
CALLnL2 call procedure L2 using the previous n arguments.
CALLBnL2 b3call Boolean function L2 using the previous n arguments and put returned value in b3.
CALLInL2 i3call integer function L2 using the previous n arguments and put returned value in i3.
CALLRnL2 r3call real function L2 using the previous n arguments and put returned value in r3.
Procedure, Function, and Main Program Returns
RET return from a procedure.
RETBb1 return from a Boolean function with b1 as the returned value.
RETIi1 return from an integer function with i1 as the returned value.
RETRr1 return from a real function with r1 as the returned value.
EXIT exit from main program.

Kenneth E. Batcher - 9/17/2001