mu/subx
Kartik K. Agaram 9c1d07baec 4194
2018-01-24 22:07:06 -08:00
..
001help.cc 4063 2017-10-14 16:12:18 -07:00
002test.cc 4162 2017-12-22 00:45:48 -08:00
003trace.cc 4033 2017-10-12 17:00:48 -07:00
003trace.test.cc 3930 - experimental bytecode interpreter 2017-06-19 21:47:07 -07:00
010core.cc 4183 2018-01-24 02:47:49 -08:00
011direct_addressing.cc 4189 2018-01-24 21:14:31 -08:00
012indirect_addressing.cc 4194 2018-01-24 22:07:06 -08:00
013immediate_addressing.cc 4189 2018-01-24 21:14:31 -08:00
014index_addressing.cc 4193 2018-01-24 21:38:08 -08:00
015jump_relative.cc 4185 2018-01-24 12:59:14 -08:00
016jump_relative.cc 4185 2018-01-24 12:59:14 -08:00
017functions.cc 4189 2018-01-24 21:14:31 -08:00
020elf.cc 4177 2017-12-31 10:23:08 -08:00
000organization.cc 4061 2017-10-13 21:50:41 -07:00
build 4013 2017-10-11 01:38:29 -07:00
build_and_test_until 4016 - include subx/ tests in CI 2017-10-11 02:01:29 -07:00
cheatsheet.pdf 4026 2017-10-12 09:36:55 -07:00
clean 4013 2017-10-11 01:38:29 -07:00
opcodes 3968 2017-07-11 21:41:15 -07:00
Readme.md 4076 2017-10-16 13:53:42 -07:00
subx 4015 2017-10-11 01:47:00 -07:00
test_layers 4024 - attempt to get CI working for SubX 2017-10-11 03:22:13 -07:00
vimrc.vim 4020 2017-10-11 02:32:38 -07:00

The SubX VM

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

  • Only instructions that operate on the 32-bit E*X registers. (No floating-point yet.)
  • Only instructions that assume a flat address space; no instructions that use segment registers.
  • No instructions that check the carry or parity flags; arithmetic operations always operate on signed integers (while bitwise operations always operate on unsigned integers)
  • Only relative jump instructions (with 8-bit or 16-bit offsets).

These rules yield a clean instruction set. We don't care about running arbitrary binaries, just those generated by our forthcoming Mu compiler.

Targeting a VM enables more comprehensive tests for the compiler, without requiring access to processor/memory state without getting bogged down in details of the ELF format, ABI, STABS debugging format, etc., etc.

Having the VM implement a real (and ubiquitous) instruction set makes it easy to generate native binaries outside of tests.

Just unit tests so far:

./subx test

x86 instruction set resources used in building this: