mirror of
https://github.com/irmen/prog8.git
synced 2024-12-26 14:29:35 +00:00
36 lines
567 B
Plaintext
36 lines
567 B
Plaintext
; source code for a tinyvm program
|
|
%block b1
|
|
%vardefs
|
|
var byte teller 1
|
|
const byte one 1
|
|
const byte thousand 1000
|
|
var array_byte newlinestr 1 10
|
|
%end_vardefs
|
|
|
|
%instructions
|
|
push teller
|
|
syscall decimalstr_signed
|
|
syscall printstr
|
|
push newlinestr
|
|
syscall printstr
|
|
back:
|
|
push teller
|
|
push one
|
|
add
|
|
pop teller
|
|
push teller
|
|
syscall decimalstr_signed
|
|
syscall printstr
|
|
push newlinestr
|
|
syscall printstr
|
|
push teller
|
|
push thousand
|
|
cmp_lt
|
|
jump_if_true back
|
|
return
|
|
%end_instructions
|
|
|
|
%subblocks
|
|
%end_subblocks
|
|
%end_block ;b1
|