December 2009
Intermediate to advanced
380 pages
9h 2m
English
A bytecode assembly language program defines globals as well as a sequence of functions and instructions:
| | .globals «number-of-global-variable-slots» |
| | «function-definitions» |
| | .def main: args=0, locals=«num-locals-or-registers»: ; begin exec here |
| | … |
| | halt |
For each function, we define the name, how many parameters it has, and how much local space it needs:
| | .def «function-name»: args=«num-args», locals=«num-locals-or-registers» |
| | … |
| | ret |
Execution begins in function main or at code address 0 if you don’t specify one. The instructions themselves have a bytecode and up to three parameters:
op operand1, operand2, …, operandn
Rather than hard-coding the instruction names (like ret and store), the implementation ...
Read now
Unlock full access