add compiler

This commit is contained in:
2020-05-10 01:39:48 +08:00
parent fe196b6507
commit bdc9eb543a
5 changed files with 120 additions and 3 deletions

36
plus1100.gmh.source Normal file
View File

@@ -0,0 +1,36 @@
// a = 0
push 10
push 0
store
// b = 0
push 0
definelabel 1111
// b += a
// a += 1
push 10
retrieve
push 1
add
dup
push 10
swap
store
add
// if a < 100 goto 1111
push 10
retrieve
push 100
sub
gotolabell0 1111
// print b
stdoutnum
// print \n
push 10
stdoutchar
end