<<< Getting Started | Index | What to Submit >>> |
This is an open-ended project. The possibilities are endless when considering other useful commands and features.
Level difficulty I (easy, 5 xtra pts awarded for each feature):
Add arithmetic commands SUB, MUL, DIV, and MOD (modulus, or remainder of the division).
Add a CMP command to compare the operand with the value on top of the stack. Compute the difference and push the result on the stack:
cmp 0
Level difficulty II (advanced, 15 xtra pts each):
Add a fixed number of register-like variables (e.g. EAX, EBX, ECX, EDX, ...) available to the stack machine programmer.
Add new commands that work with variables:
push 123 pop eax push eax pop ebx
Add program comments, for example,
; This is a comment
The comments should be handled by the text input parser, thus not requiring any changes in the stack machine code.
Level difficulty III (most difficult, 25 xtra pts):
Consider adding code labels and a jump command:
push 10 push 20 push 30 label: add jmp label
The above fragment computes the sum (10+20+30) and terminates as soon as the stack becomes empty.
Once basic jump mechanism is in place, conditional jumps can be added, as well as the subroutine CALL and RET commands.
<<< Getting Started | Index | What to Submit >>> |