Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; ============================================================================
- ; Code generated by EinCompiler.
- ; Generator: SVMABackEnd
- ; Date: 05/27/2016 18:33:51.
- ; ============================================================================
- ; Variables are not supported yet.
- ; Functions:
- main:
- bpget
- spget
- bpset
- bpget
- spset
- bpset
- ret
- test_expressions:
- bpget
- spget
- bpset
- ; int
- push 1
- store ??? [r:push] ; x
- drop
- ; int
- load 0 ; TODO: Insert variable address
- store ??? [r:push] ; x
- drop
- ; int
- push 2
- push 1
- add
- store ??? [r:push] ; x
- drop
- ; int
- push 1
- load 36 ; TODO: Insert variable address
- add
- store ??? [r:push] ; x
- drop
- ; int
- load 36 ; TODO: Insert variable address
- push 1
- add
- store ??? [r:push] ; x
- drop
- ; int
- load 36 ; TODO: Insert variable address
- load 36 ; TODO: Insert variable address
- add
- store ??? [r:push] ; x
- drop
- ; int
- push 3
- push 2
- add
- push 1
- add
- store ??? [r:push] ; x
- drop
- ; int
- push 3
- push 2
- push 1
- mul
- add
- store ??? [r:push] ; x
- drop
- ; int
- push 3
- push 2
- mul
- push 1
- add
- store ??? [r:push] ; x
- drop
- ; int
- push 1
- store ??? [r:push] ; x
- drop
- ; int
- load 36 ; TODO: Insert variable address
- store ??? [r:push] ; x
- drop
- ; int
- push 2
- push 1
- add
- store ??? [r:push] ; x
- drop
- ; int
- push 3
- push 2
- add
- push 1
- mul
- store ??? [r:push] ; x
- drop
- ; int
- push 4
- push 3
- add
- push 2
- sub
- push 1
- mul
- store ??? [r:push] ; x
- drop
- bpget
- spset
- bpset
- ret
- test_return:
- bpget
- spget
- bpset
- ; EinCompiler.ReturnInstruction
- load 40 ; TODO: Insert variable address
- load 40 ; TODO: Insert variable address
- mul
- set ??? ; TODO: Insert return value position here.
- bpget
- spset
- bpset
- ret
- bpget
- spset
- bpset
- ret
- test_if:
- bpget
- spget
- bpset
- ; EinCompiler.ConditionalInstruction
- ; if condition
- push 2
- push 1
- add [f:yes]
- [ex(z)=0] jmp @__internal__label1 ; Jump to end
- ; int
- load 32 ; TODO: Insert variable address
- store ??? [r:push] ; i
- drop
- ; int
- load 32 ; TODO: Insert variable address
- store ??? [r:push] ; i
- drop
- __internal__label1:
- ; EinCompiler.ConditionalInstruction
- ; if condition
- push 2
- push 1
- add [f:yes]
- [ex(z)=0] jmp @__internal__label2 ; Jump to false
- ; int
- load 32 ; TODO: Insert variable address
- store ??? [r:push] ; i
- drop
- ; int
- load 32 ; TODO: Insert variable address
- store ??? [r:push] ; i
- drop
- jmp @__internal__label3; jump to end
- __internal__label2:
- ; int
- load 32 ; TODO: Insert variable address
- store ??? [r:push] ; i
- drop
- __internal__label3:
- bpget
- spset
- bpset
- ret
- test_while:
- bpget
- spget
- bpset
- ; EinCompiler.LoopInstruction
- ; begin while
- __internal__label4:
- load 40 ; TODO: Insert variable address
- load 40 ; TODO: Insert variable address
- mul [f:yes]
- [ex(z)=1] jmp @__internal__label5
- ; int
- load 32 ; TODO: Insert variable address
- store ??? [r:push] ; i
- drop
- ; int
- push 10
- push 10
- mul
- store ??? [r:push] ; i
- drop
- jmp @__internal__label4 ; end while
- __internal__label5:
- ; EinCompiler.LoopInstruction
- ; begin while
- __internal__label6:
- load 40 ; TODO: Insert variable address
- load 40 ; TODO: Insert variable address
- mul [f:yes]
- [ex(z)=1] jmp @__internal__label7
- ; EinCompiler.BreakLoopInstruction
- break;
- ; EinCompiler.NopInstruction
- nop
- jmp @__internal__label6 ; end while
- __internal__label7:
- bpget
- spset
- bpset
- ret
- test_call:
- bpget
- spget
- bpset
- ; int
- sum( push 10
- , push 5
- push 5
- add
- ) drop
- ; int
- sum( push 10
- , push 5
- push 5
- add
- ) store ??? [r:push] ; i
- drop
- bpget
- spset
- bpset
- ret
- sum:
- bpget
- spget
- bpset
- ; EinCompiler.ReturnInstruction
- get -2 ; TODO: Insert variable address
- get -1 ; TODO: Insert variable address
- add
- set ??? ; TODO: Insert return value position here.
- bpget
- spset
- bpset
- ret
- bpget
- spset
- bpset
- ret
- square:
- bpget
- spget
- bpset
- ; EinCompiler.ReturnInstruction
- get -1 ; TODO: Insert variable address
- get -1 ; TODO: Insert variable address
- mul
- set ??? ; TODO: Insert return value position here.
- bpget
- spset
- bpset
- ret
- bpget
- spset
- bpset
- ret
Advertisement
Add Comment
Please, Sign In to add comment