296 lines
3.8 KiB
Plaintext
Executable File
296 lines
3.8 KiB
Plaintext
Executable File
function String.new 0
|
|
push constant 2
|
|
call Memory.alloc 1
|
|
pop pointer 0
|
|
push argument 0
|
|
push constant 0
|
|
gt
|
|
not
|
|
if-goto L0
|
|
push argument 0
|
|
call Array.new 1
|
|
pop this 0
|
|
goto L1
|
|
label L0
|
|
label L1
|
|
push constant 0
|
|
pop this 1
|
|
push pointer 0
|
|
return
|
|
function String.dispose 0
|
|
push argument 0
|
|
pop pointer 0
|
|
push this 1
|
|
push constant 0
|
|
gt
|
|
not
|
|
if-goto L2
|
|
push this 0
|
|
call Array.dispose 1
|
|
pop temp 0
|
|
goto L3
|
|
label L2
|
|
label L3
|
|
push pointer 0
|
|
call Memory.deAlloc 1
|
|
pop temp 0
|
|
push constant 0
|
|
return
|
|
function String.length 0
|
|
push argument 0
|
|
pop pointer 0
|
|
push this 1
|
|
return
|
|
function String.charAt 0
|
|
push argument 0
|
|
pop pointer 0
|
|
push argument 1
|
|
push this 1
|
|
gt
|
|
not
|
|
if-goto L4
|
|
push constant 7
|
|
call Sys.error 1
|
|
pop temp 0
|
|
goto L5
|
|
label L4
|
|
label L5
|
|
push this 0
|
|
push argument 1
|
|
add
|
|
pop pointer 1
|
|
push that 0
|
|
return
|
|
function String.setCharAt 0
|
|
push argument 0
|
|
pop pointer 0
|
|
push argument 1
|
|
push this 1
|
|
gt
|
|
not
|
|
if-goto L6
|
|
push constant 7
|
|
call Sys.error 1
|
|
pop temp 0
|
|
goto L7
|
|
label L6
|
|
label L7
|
|
push this 0
|
|
push argument 1
|
|
push argument 2
|
|
pop temp 1
|
|
add
|
|
pop pointer 1
|
|
push temp 1
|
|
pop that 0
|
|
push constant 0
|
|
return
|
|
function String.appendChar 0
|
|
push argument 0
|
|
pop pointer 0
|
|
push this 0
|
|
push this 1
|
|
push argument 1
|
|
pop temp 1
|
|
add
|
|
pop pointer 1
|
|
push temp 1
|
|
pop that 0
|
|
push this 1
|
|
push constant 1
|
|
add
|
|
pop this 1
|
|
push pointer 0
|
|
return
|
|
function String.eraseLastChar 0
|
|
push argument 0
|
|
pop pointer 0
|
|
push this 0
|
|
push this 1
|
|
push constant 0
|
|
pop temp 1
|
|
add
|
|
pop pointer 1
|
|
push temp 1
|
|
pop that 0
|
|
push this 1
|
|
push constant 1
|
|
sub
|
|
pop this 1
|
|
push constant 0
|
|
return
|
|
function String.intValue 4
|
|
push argument 0
|
|
pop pointer 0
|
|
label L8
|
|
push local 2
|
|
push this 1
|
|
lt
|
|
not
|
|
if-goto L9
|
|
push this 0
|
|
push local 2
|
|
add
|
|
pop pointer 1
|
|
push that 0
|
|
pop local 0
|
|
push local 0
|
|
push constant 47
|
|
gt
|
|
push local 0
|
|
push constant 58
|
|
lt
|
|
and
|
|
not
|
|
if-goto L10
|
|
push local 1
|
|
push constant 10
|
|
call Math.multiply 2
|
|
push local 0
|
|
push constant 48
|
|
sub
|
|
add
|
|
pop local 1
|
|
goto L11
|
|
label L10
|
|
push local 2
|
|
push constant 0
|
|
eq
|
|
push local 0
|
|
push constant 45
|
|
eq
|
|
and
|
|
not
|
|
if-goto L12
|
|
push constant 1
|
|
neg
|
|
pop local 3
|
|
goto L13
|
|
label L12
|
|
push this 1
|
|
pop local 2
|
|
label L13
|
|
label L11
|
|
push local 2
|
|
push constant 1
|
|
add
|
|
pop local 2
|
|
goto L8
|
|
label L9
|
|
push local 3
|
|
not
|
|
if-goto L14
|
|
push local 1
|
|
neg
|
|
return
|
|
goto L15
|
|
label L14
|
|
label L15
|
|
push local 1
|
|
return
|
|
function String.setInt 4
|
|
push argument 0
|
|
pop pointer 0
|
|
push argument 1
|
|
push constant 0
|
|
lt
|
|
not
|
|
if-goto L16
|
|
push constant 1
|
|
neg
|
|
pop static 0
|
|
push argument 1
|
|
neg
|
|
pop argument 1
|
|
goto L17
|
|
label L16
|
|
label L17
|
|
push argument 1
|
|
push constant 10
|
|
call Math.divide 2
|
|
pop local 1
|
|
push argument 1
|
|
push local 1
|
|
push constant 10
|
|
call Math.multiply 2
|
|
sub
|
|
pop local 0
|
|
push constant 48
|
|
pop local 2
|
|
label L18
|
|
push local 2
|
|
push constant 58
|
|
lt
|
|
not
|
|
if-goto L19
|
|
push local 2
|
|
push constant 48
|
|
push local 0
|
|
add
|
|
eq
|
|
not
|
|
if-goto L20
|
|
push local 2
|
|
pop local 3
|
|
push constant 59
|
|
pop local 2
|
|
goto L21
|
|
label L20
|
|
label L21
|
|
push local 2
|
|
push constant 1
|
|
add
|
|
pop local 2
|
|
goto L18
|
|
label L19
|
|
push argument 1
|
|
push constant 10
|
|
lt
|
|
not
|
|
if-goto L22
|
|
push constant 0
|
|
pop this 1
|
|
push static 0
|
|
not
|
|
if-goto L23
|
|
push constant 0
|
|
pop static 0
|
|
push argument 0
|
|
push constant 1
|
|
call String.new 1
|
|
push constant 45
|
|
call String.appendChar 2
|
|
call String.appendChar 2
|
|
pop temp 0
|
|
goto L24
|
|
label L23
|
|
label L24
|
|
push argument 0
|
|
push local 3
|
|
call String.appendChar 2
|
|
pop temp 0
|
|
push constant 0
|
|
return
|
|
goto L25
|
|
label L22
|
|
push argument 0
|
|
push local 1
|
|
call String.setInt 2
|
|
pop temp 0
|
|
push argument 0
|
|
push local 3
|
|
call String.appendChar 2
|
|
pop temp 0
|
|
label L25
|
|
push constant 0
|
|
return
|
|
function String.newLine 0
|
|
push constant 128
|
|
return
|
|
function String.backSpace 0
|
|
push constant 129
|
|
return
|
|
function String.doubleQuote 0
|
|
push constant 34
|
|
return
|