2015-10-09 23:41:38 +00:00
|
|
|
; =============================================
|
|
|
|
; compiled with Copper 1.0
|
2015-10-21 19:32:14 +00:00
|
|
|
; 2015-10-21 21:27:41
|
2015-10-09 23:41:38 +00:00
|
|
|
; =============================================
|
|
|
|
|
2015-10-10 22:45:02 +00:00
|
|
|
; native method: print(…)
|
2015-10-12 12:32:38 +00:00
|
|
|
; native method: shutdown(…)
|
2015-10-13 16:02:18 +00:00
|
|
|
|
2015-10-10 22:45:02 +00:00
|
|
|
|
2015-10-09 23:41:38 +00:00
|
|
|
; 1, main
|
|
|
|
.export main
|
|
|
|
main:
|
|
|
|
pushnil ; return value
|
2015-10-10 22:45:02 +00:00
|
|
|
pushnil ; i:INT32
|
2015-10-09 23:41:38 +00:00
|
|
|
pusht "Hello World!\n"
|
|
|
|
calln print 1
|
|
|
|
|
2015-10-10 22:45:02 +00:00
|
|
|
pushi 2 1
|
2015-10-09 23:41:38 +00:00
|
|
|
store 1
|
|
|
|
|
2015-10-16 12:05:37 +00:00
|
|
|
_private_0:
|
2015-10-09 23:41:38 +00:00
|
|
|
load 1
|
2015-10-10 22:45:02 +00:00
|
|
|
pushi 2 5
|
2015-10-09 23:41:38 +00:00
|
|
|
op2 8
|
2015-10-16 12:05:37 +00:00
|
|
|
jmp_if_not _private_1
|
2015-10-09 23:41:38 +00:00
|
|
|
pusht "\n"
|
2015-10-10 22:45:02 +00:00
|
|
|
load 1
|
2015-10-09 23:41:38 +00:00
|
|
|
calln print 2
|
|
|
|
|
|
|
|
load 1
|
2015-10-10 22:45:02 +00:00
|
|
|
pushi 2 1
|
2015-10-09 23:41:38 +00:00
|
|
|
op2 0
|
|
|
|
store 1
|
|
|
|
|
2015-10-16 12:05:37 +00:00
|
|
|
jmp _private_0
|
|
|
|
_private_1:
|
2015-10-09 23:41:38 +00:00
|
|
|
|
|
|
|
ret
|
|
|
|
; end of main
|
|
|
|
|