436 lines
5.5 KiB
Plaintext
Executable File
436 lines
5.5 KiB
Plaintext
Executable File
function Ball.new 0
|
|
push constant 15
|
|
call Memory.alloc 1
|
|
pop pointer 0
|
|
push argument 0
|
|
pop this 0
|
|
push argument 1
|
|
pop this 1
|
|
push argument 2
|
|
pop this 10
|
|
push argument 3
|
|
push constant 6
|
|
sub
|
|
pop this 11
|
|
push argument 4
|
|
pop this 12
|
|
push argument 5
|
|
push constant 6
|
|
sub
|
|
pop this 13
|
|
push constant 0
|
|
pop this 14
|
|
push pointer 0
|
|
call Ball.show 1
|
|
pop temp 0
|
|
push pointer 0
|
|
return
|
|
function Ball.dispose 0
|
|
push argument 0
|
|
pop pointer 0
|
|
push pointer 0
|
|
call Memory.deAlloc 1
|
|
pop temp 0
|
|
push constant 0
|
|
return
|
|
function Ball.show 0
|
|
push argument 0
|
|
pop pointer 0
|
|
push constant 1
|
|
neg
|
|
call Screen.setColor 1
|
|
pop temp 0
|
|
push pointer 0
|
|
call Ball.draw 1
|
|
pop temp 0
|
|
push constant 0
|
|
return
|
|
function Ball.hide 0
|
|
push argument 0
|
|
pop pointer 0
|
|
push constant 0
|
|
call Screen.setColor 1
|
|
pop temp 0
|
|
push pointer 0
|
|
call Ball.draw 1
|
|
pop temp 0
|
|
push constant 0
|
|
return
|
|
function Ball.draw 0
|
|
push argument 0
|
|
pop pointer 0
|
|
push this 0
|
|
push this 1
|
|
push this 0
|
|
push constant 5
|
|
add
|
|
push this 1
|
|
push constant 5
|
|
add
|
|
call Screen.drawRectangle 4
|
|
pop temp 0
|
|
push constant 0
|
|
return
|
|
function Ball.getLeft 0
|
|
push argument 0
|
|
pop pointer 0
|
|
push this 0
|
|
return
|
|
function Ball.getRight 0
|
|
push argument 0
|
|
pop pointer 0
|
|
push this 0
|
|
push constant 5
|
|
add
|
|
return
|
|
function Ball.setDestination 3
|
|
push argument 0
|
|
pop pointer 0
|
|
push argument 1
|
|
push this 0
|
|
sub
|
|
pop this 2
|
|
push argument 2
|
|
push this 1
|
|
sub
|
|
pop this 3
|
|
push this 2
|
|
call Math.abs 1
|
|
pop local 0
|
|
push this 3
|
|
call Math.abs 1
|
|
pop local 1
|
|
push local 0
|
|
push local 1
|
|
lt
|
|
pop this 7
|
|
push this 7
|
|
not
|
|
if-goto L0
|
|
push local 0
|
|
pop local 2
|
|
push local 1
|
|
pop local 0
|
|
push local 2
|
|
pop local 1
|
|
push this 1
|
|
push argument 2
|
|
lt
|
|
pop this 8
|
|
push this 0
|
|
push argument 1
|
|
lt
|
|
pop this 9
|
|
goto L1
|
|
label L0
|
|
push this 0
|
|
push argument 1
|
|
lt
|
|
pop this 8
|
|
push this 1
|
|
push argument 2
|
|
lt
|
|
pop this 9
|
|
label L1
|
|
push constant 2
|
|
push local 1
|
|
call Math.multiply 2
|
|
push local 0
|
|
sub
|
|
pop this 4
|
|
push constant 2
|
|
push local 1
|
|
call Math.multiply 2
|
|
pop this 5
|
|
push constant 2
|
|
push local 1
|
|
push local 0
|
|
sub
|
|
call Math.multiply 2
|
|
pop this 6
|
|
push constant 0
|
|
return
|
|
function Ball.move 0
|
|
push argument 0
|
|
pop pointer 0
|
|
push pointer 0
|
|
call Ball.hide 1
|
|
pop temp 0
|
|
push this 4
|
|
push constant 0
|
|
lt
|
|
not
|
|
if-goto L2
|
|
push this 4
|
|
push this 5
|
|
add
|
|
pop this 4
|
|
goto L3
|
|
label L2
|
|
push this 4
|
|
push this 6
|
|
add
|
|
pop this 4
|
|
push this 9
|
|
not
|
|
if-goto L4
|
|
push this 7
|
|
not
|
|
if-goto L5
|
|
push this 0
|
|
push constant 4
|
|
add
|
|
pop this 0
|
|
goto L6
|
|
label L5
|
|
push this 1
|
|
push constant 4
|
|
add
|
|
pop this 1
|
|
label L6
|
|
goto L7
|
|
label L4
|
|
push this 7
|
|
not
|
|
if-goto L8
|
|
push this 0
|
|
push constant 4
|
|
sub
|
|
pop this 0
|
|
goto L9
|
|
label L8
|
|
push this 1
|
|
push constant 4
|
|
sub
|
|
pop this 1
|
|
label L9
|
|
label L7
|
|
label L3
|
|
push this 8
|
|
not
|
|
if-goto L10
|
|
push this 7
|
|
not
|
|
if-goto L11
|
|
push this 1
|
|
push constant 4
|
|
add
|
|
pop this 1
|
|
goto L12
|
|
label L11
|
|
push this 0
|
|
push constant 4
|
|
add
|
|
pop this 0
|
|
label L12
|
|
goto L13
|
|
label L10
|
|
push this 7
|
|
not
|
|
if-goto L14
|
|
push this 1
|
|
push constant 4
|
|
sub
|
|
pop this 1
|
|
goto L15
|
|
label L14
|
|
push this 0
|
|
push constant 4
|
|
sub
|
|
pop this 0
|
|
label L15
|
|
label L13
|
|
push this 0
|
|
push this 10
|
|
gt
|
|
not
|
|
not
|
|
if-goto L16
|
|
push constant 1
|
|
pop this 14
|
|
push this 10
|
|
pop this 0
|
|
goto L17
|
|
label L16
|
|
label L17
|
|
push this 0
|
|
push this 11
|
|
lt
|
|
not
|
|
not
|
|
if-goto L18
|
|
push constant 2
|
|
pop this 14
|
|
push this 11
|
|
pop this 0
|
|
goto L19
|
|
label L18
|
|
label L19
|
|
push this 1
|
|
push this 12
|
|
gt
|
|
not
|
|
not
|
|
if-goto L20
|
|
push constant 3
|
|
pop this 14
|
|
push this 12
|
|
pop this 1
|
|
goto L21
|
|
label L20
|
|
label L21
|
|
push this 1
|
|
push this 13
|
|
lt
|
|
not
|
|
not
|
|
if-goto L22
|
|
push constant 4
|
|
pop this 14
|
|
push this 13
|
|
pop this 1
|
|
goto L23
|
|
label L22
|
|
label L23
|
|
push pointer 0
|
|
call Ball.show 1
|
|
pop temp 0
|
|
push this 14
|
|
return
|
|
function Ball.bounce 5
|
|
push argument 0
|
|
pop pointer 0
|
|
push this 2
|
|
push constant 10
|
|
call Math.divide 2
|
|
pop local 2
|
|
push this 3
|
|
push constant 10
|
|
call Math.divide 2
|
|
pop local 3
|
|
push argument 1
|
|
push constant 0
|
|
eq
|
|
not
|
|
if-goto L24
|
|
push constant 10
|
|
pop local 4
|
|
goto L25
|
|
label L24
|
|
push this 2
|
|
push constant 0
|
|
lt
|
|
not
|
|
push argument 1
|
|
push constant 1
|
|
eq
|
|
and
|
|
push this 2
|
|
push constant 0
|
|
lt
|
|
push argument 1
|
|
push constant 1
|
|
neg
|
|
eq
|
|
and
|
|
or
|
|
not
|
|
if-goto L26
|
|
push constant 20
|
|
pop local 4
|
|
goto L27
|
|
label L26
|
|
push constant 5
|
|
pop local 4
|
|
label L27
|
|
label L25
|
|
push this 14
|
|
push constant 1
|
|
eq
|
|
not
|
|
if-goto L28
|
|
push constant 506
|
|
pop local 0
|
|
push local 3
|
|
push constant 50
|
|
neg
|
|
call Math.multiply 2
|
|
push local 2
|
|
call Math.divide 2
|
|
pop local 1
|
|
push this 1
|
|
push local 1
|
|
push local 4
|
|
call Math.multiply 2
|
|
add
|
|
pop local 1
|
|
goto L29
|
|
label L28
|
|
push this 14
|
|
push constant 2
|
|
eq
|
|
not
|
|
if-goto L30
|
|
push constant 0
|
|
pop local 0
|
|
push local 3
|
|
push constant 50
|
|
call Math.multiply 2
|
|
push local 2
|
|
call Math.divide 2
|
|
pop local 1
|
|
push this 1
|
|
push local 1
|
|
push local 4
|
|
call Math.multiply 2
|
|
add
|
|
pop local 1
|
|
goto L31
|
|
label L30
|
|
push this 14
|
|
push constant 3
|
|
eq
|
|
not
|
|
if-goto L32
|
|
push constant 250
|
|
pop local 1
|
|
push local 2
|
|
push constant 25
|
|
neg
|
|
call Math.multiply 2
|
|
push local 3
|
|
call Math.divide 2
|
|
pop local 0
|
|
push this 0
|
|
push local 0
|
|
push local 4
|
|
call Math.multiply 2
|
|
add
|
|
pop local 0
|
|
goto L33
|
|
label L32
|
|
push constant 0
|
|
pop local 1
|
|
push local 2
|
|
push constant 25
|
|
call Math.multiply 2
|
|
push local 3
|
|
call Math.divide 2
|
|
pop local 0
|
|
push this 0
|
|
push local 0
|
|
push local 4
|
|
call Math.multiply 2
|
|
add
|
|
pop local 0
|
|
label L33
|
|
label L31
|
|
label L29
|
|
push pointer 0
|
|
push local 0
|
|
push local 1
|
|
call Ball.setDestination 3
|
|
pop temp 0
|
|
push constant 0
|
|
return
|