VAR k: FLOAT;
BEGIN
k:=4.2;
COUT << k + 2.5;
RETURN 0;
END.
Compile: success.
/*
* Generated Tue Jun 05 15:57:59 PDT 2007
*/
.section ".rodata"
NL: .asciz "\n"
intFmt: .asciz "%d"
strFmt: .asciz "%s"
boolT: .asciz "TRUE"
boolF: .asciz "FALSE"
.section ".data"
.align 4
id0: .single 0 ! Setting up variable: id0 == k
.section ".text"
.align 4
.global main
main:
set main.SIZE, %g1
save %sp, %g1, %sp ! Setting up MAIN header
.section ".data"
.align 4
id1: .single 4.2
.section ".text"
.align 4
set id1, %l0 ! store 4.2 into register
st %l0, [%fp-4] ! store 4.2 into memory
set id0, %l0 ! doing final assignment of op
ld [%fp-4], %f0 ! loading what we want to save
st %f0, [%l0] ! storing it up
.section ".data"
.align 4
id2: .single 2.5
.section ".text"
.align 4
set id2, %l0 ! store 2.5 into register
st %l0, [%fp-8] ! store 2.5 into memory
set id0, %l0
ld [%l0], %f0 ! setting first variable into register
ld [%fp-8], %f1 ! setting second variable into register
fadds %f0, %f1, %f0 ! adding floats
st %f0, [%fp-12] ! storing
ld [%fp-12], %f0
call printFLOAT
nop ! printing float
set 0, %l0 ! store 0 into register
ld [%l0], %l0 ! store 0 into register
st %l0, [%fp-16] ! store 0 into memory
ld [%fp-16], %i0
ret
restore
main.SIZE = -(92 + 0 + 16) & -8 ! Setting up MAIN tail with local and temp offset