entry main.enter; import "../IMPORT/register.h"; import "../IMPORT/callsys.h"; import "../IMPORT/proc.h"; import "../IMPORT/invoc.h"; import "../IMPORT/callsys.lib.s"; import "../IMPORT/memory.lib.s"; public block lowData { data { public address: } } import "../IMPORT/string.lib.s"; import "../IMPORT/number.lib.s"; import "../IMPORT/bool.lib.s"; import "../IMPORT/io.lib.s"; import "../IMPORT/dString.lib.s"; import "../IMPORT/array.lib.s"; import "../IMPORT/INST.s"; public block main uses register { public block subClass { } public block static { public block field { data { } } public block method { } } public block static { public block init extends proc.sav0 uses proc { local { public max: } code { public enter: lda $sp, -max($sp); stq $ra, savRA($sp); clr $ip; clr $nip; mov $sp, $fp; { ldiq $t0, 0; mov $t0, $a0; mov 10, $a1; bsr Number.toSigned.enter; mov $v0, $a0; bsr Array.fromString.enter; mov $v0, $t0; mov $t0, $a0; bsr Array.toString.enter; mov $v0, $a0; bsr IO.println.enter; } { ldit $ft0, 0.0; fmov $ft0, $fa0; mov 6, $a1; bsr Number.doubleToString.enter; mov $v0, $a0; bsr Array.fromString.enter; mov $v0, $t0; mov $t0, $a0; bsr Array.toString.enter; mov $v0, $a0; bsr IO.println.enter; } { ldit $ft0, 123.456; fmov $ft0, $fa0; mov 6, $a1; bsr Number.doubleToString.enter; mov $v0, $a0; bsr Array.fromString.enter; mov $v0, $t0; mov $t0, $a0; bsr Array.toString.enter; mov $v0, $a0; bsr IO.println.enter; } { ldit $ft0, 10.0; ldit $ft1, 5.0; addt $ft0, $ft1, $ft0; fmov $ft0, $fa0; mov 6, $a1; bsr Number.doubleToString.enter; mov $v0, $a0; bsr Array.fromString.enter; mov $v0, $t0; mov $t0, $a0; bsr Array.toString.enter; mov $v0, $a0; bsr IO.println.enter; } { ldit $ft0, 10.0; ldit $ft1, 5.0; subt $ft0, $ft1, $ft0; fmov $ft0, $fa0; mov 6, $a1; bsr Number.doubleToString.enter; mov $v0, $a0; bsr Array.fromString.enter; mov $v0, $t0; mov $t0, $a0; bsr Array.toString.enter; mov $v0, $a0; bsr IO.println.enter; } { ldit $ft0, 10.0; ldit $ft1, 5.0; mult $ft0, $ft1, $ft0; fmov $ft0, $fa0; mov 6, $a1; bsr Number.doubleToString.enter; mov $v0, $a0; bsr Array.fromString.enter; mov $v0, $t0; mov $t0, $a0; bsr Array.toString.enter; mov $v0, $a0; bsr IO.println.enter; } { ldit $ft0, 10.0; ldit $ft1, 5.0; divt $ft0, $ft1, $ft0; fmov $ft0, $fa0; mov 6, $a1; bsr Number.doubleToString.enter; mov $v0, $a0; bsr Array.fromString.enter; mov $v0, $t0; mov $t0, $a0; bsr Array.toString.enter; mov $v0, $a0; bsr IO.println.enter; } { ldit $ft0, 5.0; negt $ft0, $ft0; fmov $ft0, $fa0; mov 6, $a1; bsr Number.doubleToString.enter; mov $v0, $a0; bsr Array.fromString.enter; mov $v0, $t0; mov $t0, $a0; bsr Array.toString.enter; mov $v0, $a0; bsr IO.println.enter; } { { if: ldit $ft0, 10.0; ldit $ft1, 5.0; cmptle $ft0, $ft1, $ft0; fbne $ft0, else; then: mov 1, $t0; br end; else: mov 0, $t0; end: } mov $t0, $a0; bsr Bool.toString.enter; mov $v0, $a0; bsr Array.fromString.enter; mov $v0, $t0; mov $t0, $a0; bsr Array.toString.enter; mov $v0, $a0; bsr IO.println.enter; } ldq $ra, savRA($sp); lda $sp, +max($sp); ret; } } } code { public enter: clr $ip; clr $nip; ldiq $a0, lowData.address; ldiq $a1, highData.address; mov $sp, $a2; bsr Memory.initialise.enter; bsr static.init.enter; mov 0, $a0; bsr Sys.exit.enter; } } public block highData { data { public address: } }