.
This commit is contained in:
Executable
+75
@@ -0,0 +1,75 @@
|
||||
function Sys.init 0
|
||||
call Math.init 0
|
||||
pop temp 0
|
||||
call Keyboard.init 0
|
||||
pop temp 0
|
||||
call Memory.init 0
|
||||
pop temp 0
|
||||
call Output.init 0
|
||||
pop temp 0
|
||||
call Screen.init 0
|
||||
pop temp 0
|
||||
call Main.main 0
|
||||
pop temp 0
|
||||
call Sys.halt 0
|
||||
pop temp 0
|
||||
function Sys.halt 0
|
||||
label L0
|
||||
push constant 1
|
||||
neg
|
||||
not
|
||||
if-goto L1
|
||||
goto L0
|
||||
label L1
|
||||
function Sys.wait 1
|
||||
label L2
|
||||
push argument 0
|
||||
push constant 0
|
||||
gt
|
||||
not
|
||||
if-goto L3
|
||||
push constant 100
|
||||
pop local 0
|
||||
label L4
|
||||
push local 0
|
||||
push constant 0
|
||||
gt
|
||||
not
|
||||
if-goto L5
|
||||
push local 0
|
||||
push constant 1
|
||||
sub
|
||||
pop local 0
|
||||
goto L4
|
||||
label L5
|
||||
push argument 0
|
||||
push constant 1
|
||||
sub
|
||||
pop argument 0
|
||||
goto L2
|
||||
label L3
|
||||
push constant 0
|
||||
return
|
||||
function Sys.error 1
|
||||
push constant 3
|
||||
call String.new 1
|
||||
pop local 0
|
||||
push local 0
|
||||
push argument 0
|
||||
call String.setInt 2
|
||||
pop temp 0
|
||||
push constant 3
|
||||
call String.new 1
|
||||
push constant 69
|
||||
call String.appendChar 2
|
||||
push constant 82
|
||||
call String.appendChar 2
|
||||
push constant 82
|
||||
call String.appendChar 2
|
||||
call Output.printString 1
|
||||
pop temp 0
|
||||
push local 0
|
||||
call Output.printString 1
|
||||
pop temp 0
|
||||
push constant 0
|
||||
return
|
||||
Reference in New Issue
Block a user