mu/subx
Kartik Agaram c90fa6534e 4325 2018-07-07 23:13:25 -07:00
..
teensy 4323 2018-07-07 13:54:16 -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 4311 - subx running binaries with global variables 2018-07-03 16:36:37 -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 4311 - subx running binaries with global variables 2018-07-03 16:36:37 -07:00
021translate.cc 4318 2018-07-06 23:38:33 -07:00
022transform_immediate.cc 4305 2018-07-01 21:01:34 -07:00
Readme.md 4319 2018-07-07 09:36:24 -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 4314 2018-07-06 22:50:30 -07:00
edit 4323 2018-07-07 13:54:16 -07:00
ex1 4316 2018-07-06 23:33:42 -07:00
ex1.1.subx 4325 2018-07-07 23:13:25 -07:00
ex1.2.subx 4325 2018-07-07 23:13:25 -07:00
ex2 4322 2018-07-07 10:59:36 -07:00
ex2.subx 4325 2018-07-07 23:13:25 -07:00
ex3 4324 - new example: add first ten numbers 2018-07-07 14:31:56 -07:00
ex3.subx 4325 2018-07-07 23:13:25 -07:00
g 4321 2018-07-07 10:57:56 -07:00
gen 4321 2018-07-07 10:57:56 -07:00
gg 4321 2018-07-07 10:57:56 -07:00
nrun 4321 2018-07-07 10:57:56 -07:00
opcodes 3968 2017-07-11 21:41:15 -07:00
run 4323 2018-07-07 13:54:16 -07:00
subx 4211 2018-02-20 01:38:15 -08:00
subx.vim 4299 2018-06-30 23:05:10 -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: