about summary refs log tree commit diff stats
path: root/subx/Readme.md
blob: d898cde9ba3fb958410f3817db16d512a075c540 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
## The SubX VM

Bytecode interpreter for a subset of the 32-bit x86 ISA.

* only instructions operating on the 32-bit E*X registers
* assuming a flat address space, completely ignoring segment registers
* ignoring the carry flag; arithmetic operations always operate on signed numbers
  (while bitwise operations always operate on unsigned numbers)

Basically a minimum basis set that a compiler for Mu can target. This isn't
meant to run arbitrary binaries, just those generated by our compiler,
allowing better tests for the compiler, access to processor/memory state
without getting bogged down in details of the ELF format, ABI, STABS debugging
format, etc., etc.

To run tests:

  ```
  ./subx test
  ```

x86 instruction set resources used in building this:

* [Intel programming manual](http://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf) (pdf)
* [Concise instruction reference](https://c9x.me/x86)
* [Single-page cheatsheet](https://net.cs.uni-bonn.de/fileadmin/user_upload/plohmann/x86_opcode_structure_and_instruction_overview.pdf) (pdf)