function Screen.init 0
push constant 0
not
pop static 1
push constant 16
call Array.new 1
pop static 0
push constant 0
push static 0
add
push constant 1
pop temp 0
pop pointer 1
push temp 0
pop that 0
push constant 1
push static 0
add
push constant 2
pop temp 0
pop pointer 1
push temp 0
pop that 0
push constant 2
push static 0
add
push constant 4
pop temp 0
pop pointer 1
push temp 0
pop that 0
push constant 3
push static 0
add
push constant 8
pop temp 0
pop pointer 1
push temp 0
pop that 0
push constant 4
push static 0
add
push constant 16
pop temp 0
pop pointer 1
push temp 0
pop that 0
push constant 5
push static 0
add
push constant 32
pop temp 0
pop pointer 1
push temp 0
pop that 0
push constant 6
push static 0
add
push constant 64
pop temp 0
pop pointer 1
push temp 0
pop that 0
push constant 7
push static 0
add
push constant 128
pop temp 0
pop pointer 1
push temp 0
pop that 0
push constant 8
push static 0
add
push constant 256
pop temp 0
pop pointer 1
push temp 0
pop that 0
push constant 9
push static 0
add
push constant 512
pop temp 0
pop pointer 1
push temp 0
pop that 0
push constant 10
push static 0
add
push constant 1024
pop temp 0
pop pointer 1
push temp 0
pop that 0
push constant 11
push static 0
add
push constant 2048
pop temp 0
pop pointer 1
push temp 0
pop that 0
push constant 12
push static 0
add
push constant 4096
pop temp 0
pop pointer 1
push temp 0
pop that 0
push constant 13
push static 0
add
push constant 8192
pop temp 0
pop pointer 1
push temp 0
pop that 0
push constant 14
push static 0
add
push constant 16384
pop temp 0
pop pointer 1
push temp 0
pop that 0
push constant 15
push static 0
add
push constant 16384
push constant 16384
add
pop temp 0
pop pointer 1
push temp 0
pop that 0
push constant 0
return
function Screen.clearScreen 3
push constant 0
pop local 0
push constant 0
pop local 1
push static 1
pop local 2
push constant 0
pop static 1
label WHILE_EXP0
push local 0
push constant 256
lt
not
if-goto WHILE_END0
label WHILE_EXP1
push local 1
push constant 512
lt
not
if-goto WHILE_END1
push local 0
push local 1
call Screen.drawPixel 2
pop temp 0
push local 1
push constant 1
add
pop local 1
goto WHILE_EXP1
label WHILE_END1
push local 0
push constant 1
add
pop local 0
goto WHILE_EXP0
label WHILE_END0
push local 2
pop static 1
push constant 0
return
function Screen.setColor 0
push argument 0
pop static 1
push constant 0
return
function Screen.drawPixel 2
push constant 32
push argument 1
call Math.multiply 2
push argument 0
push constant 16
call Math.divide 2
add
pop local 0
push constant 16384
push local 0
add
call Memory.peek 1
pop local 1
push static 1
if-goto IF_TRUE0
goto IF_FALSE0
label IF_TRUE0
push local 1
push argument 0
push constant 15
and
push static 0
add
pop pointer 1
push that 0
or
pop local 1
goto IF_END0
label IF_FALSE0
push local 1
push argument 0
push constant 15
and
push static 0
add
pop pointer 1
push that 0
not
and
pop local 1
label IF_END0
push constant 16384
push local 0
add
push local 1
call Memory.poke 2
pop temp 0
push constant 0
return
function Screen.drawLine 5
push argument 2
push argument 0
sub
pop local 0
push argument 3
push argument 1
sub
pop local 1
push constant 0
pop local 2
push constant 0
pop local 3
push constant 0
pop local 4
push local 0
push constant 0
eq
if-goto IF_TRUE0
goto IF_FALSE0
label IF_TRUE0
label WHILE_EXP0
push local 1
push constant 0
eq
not
not
if-goto WHILE_END0
push argument 0
push argument 1
push local 1
add
call Screen.drawPixel 2
pop temp 0
push local 1
push constant 0
gt
if-goto IF_TRUE1
goto IF_FALSE1
label IF_TRUE1
push local 1
push constant 1
sub
pop local 1
goto IF_END1
label IF_FALSE1
push local 1
push constant 1
add
pop local 1
label IF_END1
goto WHILE_EXP0
label WHILE_END0
push constant 0
return
label IF_FALSE0
push local 1
push constant 0
eq
if-goto IF_TRUE2
goto IF_FALSE2
label IF_TRUE2
label WHILE_EXP1
push local 0
push constant 0
eq
not
not
if-goto WHILE_END1
push argument 0
push local 0
add
push argument 1
call Screen.drawPixel 2
pop temp 0
push local 0
push constant 0
gt
if-goto IF_TRUE3
goto IF_FALSE3
label IF_TRUE3
push local 0
push constant 1
sub
pop local 0
goto IF_END3
label IF_FALSE3
push local 0
push constant 1
add
pop local 0
label IF_END3
goto WHILE_EXP1
label WHILE_END1
push constant 0
return
label IF_FALSE2
label WHILE_EXP2
push local 2
call Math.abs 1
push local 0
call Math.abs 1
gt
not
push local 3
call Math.abs 1
push local 1
call Math.abs 1
gt
not
and
not
if-goto WHILE_END2
push argument 0
push local 2
add
push argument 1
push local 3
add
call Screen.drawPixel 2
pop temp 0
push local 4
push constant 0
lt
if-goto IF_TRUE4
goto IF_FALSE4
label IF_TRUE4
push local 0
push constant 0
gt
if-goto IF_TRUE5
goto IF_FALSE5
label IF_TRUE5
push local 2
push constant 1
add
pop local 2
label IF_FALSE5
push local 0
push constant 0
lt
if-goto IF_TRUE6
goto IF_FALSE6
label IF_TRUE6
push local 2
push constant 1
sub
pop local 2
label IF_FALSE6
push local 4
push local 1
call Math.abs 1
add
pop local 4
goto IF_END4
label IF_FALSE4
push local 1
push constant 0
gt
if-goto IF_TRUE7
goto IF_FALSE7
label IF_TRUE7
push local 3
push constant 1
add
pop local 3
label IF_FALSE7
push local 1
push constant 0
lt
if-goto IF_TRUE8
goto IF_FALSE8
label IF_TRUE8
push local 3
push constant 1
sub
pop local 3
label IF_FALSE8
push local 4
push local 0
call Math.abs 1
sub
pop local 4
label IF_END4
goto WHILE_EXP2
label WHILE_END2
push constant 0
return
function Screen.drawRectangle 1
push argument 3
push argument 1
sub
pop local 0
label WHILE_EXP0
push local 0
call Math.abs 1
push constant 0
eq
not
not
if-goto WHILE_END0
push local 0
push constant 0
gt
if-goto IF_TRUE0
goto IF_FALSE0
label IF_TRUE0
push argument 0
push argument 1
push local 0
add
push argument 2
push argument 1
push local 0
add
call Screen.drawLine 4
pop temp 0
push local 0
push constant 1
sub
pop local 0
goto IF_END0
label IF_FALSE0
push argument 0
push argument 1
push local 0
add
push argument 2
push argument 1
push local 0
add
call Screen.drawLine 4
pop temp 0
push local 0
push constant 1
add
pop local 0
label IF_END0
goto WHILE_EXP0
label WHILE_END0
push constant 0
return
function Screen.drawCircle 1
push argument 2
neg
pop local 0
push argument 2
push constant 181
gt
if-goto IF_TRUE0
goto IF_FALSE0
label IF_TRUE0
push constant 0
return
label IF_FALSE0
label WHILE_EXP0
push local 0
push argument 2
push constant 1
add
lt
not
if-goto WHILE_END0
push argument 0
push argument 2
push argument 2
call Math.multiply 2
push local 0
push local 0
call Math.multiply 2
sub
call Math.sqrt 1
sub
push argument 1
push local 0
add
push argument 0
push argument 2
push argument 2
call Math.multiply 2
push local 0
push local 0
call Math.multiply 2
sub
call Math.sqrt 1
add
push argument 1
push local 0
add
call Screen.drawLine 4
pop temp 0
push local 0
push constant 1
add
pop local 0
goto WHILE_EXP0
label WHILE_END0
push constant 0
return
