TweeZcodeCompiler / twee_zcode_compiler

compiler project at FU Berlin
MIT License
3 stars 0 forks source link

Extended opcodes and user stacks #102

Closed ottne closed 9 years ago

ottne commented 9 years ago

Framework for extended opcodes and enables user stacks with push_stack and pop_stack.

You can find a working example in examples/test_assembly_files/user_stack.zap.

Since there is no functionality for top on user stacks, I implemented this functionality in an custom routine. Might be worth to add this as a library function.

There's also no direct way of finding out whether a stack is empty or not (kind of a bummer when you don't know how much data was pushed on the stack). You'd have to keep track of the size of the stack and check against the first word on the stack.