mu/subx
Kartik Agaram 784bbd4a69 4297 2018-06-30 22:05:09 -07:00
..
teensy 4291 - stop copying the ELF header into memory 2018-06-30 21:32:52 -07:00
000organization.cc 4061 2017-10-13 21:50:41 -07:00
001help.cc 4289 - beginnings of a translator to ELF 2018-06-30 09:41:22 -07:00
002test.cc 4288 2018-06-28 22:03:48 -07: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 4297 2018-06-30 22:05:09 -07:00
011direct_addressing.cc 4195 2018-01-24 22:43:05 -08:00
012indirect_addressing.cc 4196 2018-01-24 23:02:09 -08:00
013immediate_addressing.cc 4189 2018-01-24 21:14:31 -08:00
014index_addressing.cc 4197 - done supporting all indirect addressing modes 2018-01-24 23:27:45 -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
019syscalls.cc 4284 - implement first syscall for subx 2018-06-28 16:12:33 -07:00
020elf.cc 4287 2018-06-28 17:25:41 -07:00
021translate.cc 4291 - stop copying the ELF header into memory 2018-06-30 21:32:52 -07:00
Readme.md 4076 2017-10-16 13:53:42 -07:00
build 4288 2018-06-28 22:03:48 -07:00
build_and_test_until 4211 2018-02-20 01:38:15 -08:00
cheatsheet.pdf 4026 2017-10-12 09:36:55 -07:00
clean 4211 2018-02-20 01:38:15 -08:00
ex1 4291 - stop copying the ELF header into memory 2018-06-30 21:32:52 -07:00
ex1.1.subx 4296 2018-06-30 22:00:52 -07:00
opcodes 3968 2017-07-11 21:41:15 -07:00
subx 4211 2018-02-20 01:38:15 -08:00
subx.vim 4295 2018-06-30 21:59:55 -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

Readme.md

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: