Commit Graph
4 Commits
Author SHA1 Message Date
Nunuhara Cabbage 626e4f47d7 Arithmetic assignment instructions (+=, -=, etc.) 2019-10-07 16:12:24 -07:00
Nunuhara Cabbage 587dc34ddb Implement ASSIGN and basic arithmetic instructions 2019-10-06 22:32:50 -07:00
Nunuhara Cabbage eb63980294 Call system.Exit after returning from main
A bit of a hack: we insert an extra 'CALLSYS 0x0' instruction
(system.Exit) at the end of the code section, then set up a stack frame
so that when main() returns, it jumps to that instruction.
2019-10-06 20:58:03 -07:00
Nunuhara Cabbage 84df756faf Initial commit
An assortment of instructions have been implemented so far, mostly basic
stuff such as stack management. The following program can be executed:

int main(void)
{
    hello(2);
    for (;;) {
        system.Peek();
        system.Sleep(1);
    }
    return 0;
}

void hello(int n)
{
    int i;
    for (i = 0; i < n; i++) {
        system.Output("Hello, world! " + string(i));
    }
}
2019-10-06 19:35:36 -07:00