mu/subx
Kartik K. Agaram 8a0268317f 4084
subx: extract helpers for 'push' and 'pop'. We will be using them in
'call' and 'ret' as well.
2017-10-18 02:27:56 -07:00
..
000organization.cc 4061 2017-10-13 21:50:41 -07:00
001help.cc 4063 2017-10-14 16:12:18 -07:00
002test.cc 4011 - start of sub-x86 VM 2017-10-09 01:19:33 -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 4078 2017-10-17 23:55:25 -07:00
011direct_addressing.cc 4084 2017-10-18 02:27:56 -07:00
012indirect_addressing.cc 4084 2017-10-18 02:27:56 -07:00
013immediate_addressing.cc 4082 2017-10-18 02:00:44 -07:00
014jump_relative.cc 4071 2017-10-16 02:48:14 -07:00
015jump_relative.cc 4071 2017-10-16 02:48:14 -07:00
Readme.md 4076 2017-10-16 13:53:42 -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
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

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: