add compiler
This commit is contained in:
36
plus1100.gmh.source
Normal file
36
plus1100.gmh.source
Normal 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
|
||||
Reference in New Issue
Block a user