Age | Commit message (Collapse) | Author |
|
When an error occurred, because prog->ptr was incremented beforehand
the trace would show the next instruction as the culprit rather than
the actual instruction. This commit fixes that by incrementing the
program if and only if the command was run successfully.
|
|
|
|
Lots to refactor and test
|
|
|
|
|
|
|
|
|
|
|
|
This would be useful when writing an interpreted language where the
"assembly" and the "execution" occur within the same executable.
|
|
|
|
|
|
|
|
This is mostly so labels get to have digits. This won't affect number
tokens as that happens before symbols.
|
|
|
|
Looks way more high level but parses down to a very simple bytecode.
However, because of lack of inline code processing, it relies on the
call stack quite heavily. With inline labels this would be a much
more compact bytecode.
|
|
|
|
Implementing start points has made features necessary for a standard
library setup easier to see.
|
|
|
|
Was used in a previous fix but not necessary anymore
|
|
In vm_execute_all set the program pointer to the start address in the
header of the program payload.
|
|
|
|
Set the program structure correctly with a header using the parsed
global instruction.
|
|
|
|
Very barebones, essentially a simple refactor.
I need to introduce a feature to append to a program as well, but as
it's a flexible structure it will likely have to be functional.
|
|
Essentially a "program header", followed by a count, followed by
instructions.
Provides a stronger format for bytecode files and allows for better
bounds checking on instructions.
|
|
Creates a jump address to the label delegated by "global" so program
starts at that point.
|
|
Some considerations as to how to do this (dynamic or static linking)
and changes needed in VM/assembler for this to work.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
All in my assembly/virtual machine!
|
|
|
|
|
|
Lexer now will straight away attempt to eat up any type or later
portions of an opcode rather than leaving everything but the root.
This means checking for type in the parser is a direct check against
the name rather than prefixed with a dot.
Checks are a bit more strong to cause more tokens to go straight to
symbol rather than getting checked after one routine in at on the
parser side.
|
|
This was due to the beg or end page being not set correctly (dangling
pointer).
|
|
Stack, call stack and heap are evaluated to check for leaks.
|
|
Very easy overall, printing the call stack not so much.
|
|
Essentially you may "call" an absolute program address, which pushes
the current address onto the call stack. CALL_STACK does the same
thing but the absolute program address is taken from the data stack.
RET pops an address off the call stack then jumps to that address.
|
|
Makes more sense, don't need to fiddle around with strings as much in
the parser due to this!
|
|
|
|
Not necessary when you can just push the relevant word onto the stack
then just do OP_JUMP_STACK.
|
|
|
|
Essentially a presult_t contains one of these:
1) A label construction, which stores the label symbol into
`label` (PRES_LABEL)
2) An instruction that calls upon a label, storing the instruction
in `instruction` and the label name in `label` (PRES_LABEL_ADDRESS)
3) An instruction that uses a relative address offset, storing the
instruction in `instruction` and the offset wanted into
`relative_address` (PRES_RELATIVE_ADDRESS)
4) An instruction that requires no further processing, storing the
instruction into `instruction` (PRES_COMPLETE_INSTRUCTION)
In the processing stage, we resolve all calls by iterating one by one
and maintaining an absolute instruction address. Pretty nice, lots
more machinery involved in parsing now.
|