about summary refs log tree commit diff stats
path: root/subx
Commit message (Collapse)AuthorAgeFilesLines
* 4280 - fix test program to use subx instructionsKartik K. Agaram2018-06-272-4/+7
| | | | | I don't know how to tell nasm to generate an imm32. It's a minor stepping-stone anyway; just emit the machine code directly.
* 4279 - load_elf() now working on teensy/test5Kartik K. Agaram2018-06-271-2/+2
| | | | Turns out it was an open question I never got around to answering.
* 4278 - load_elf() isn't actually working yetKartik Agaram2018-06-2711-0/+76
| | | | Here's a few test binaries generated on 32-bit Linux.
* 4277 - make room for a 'compile' sub-commandKartik Agaram2018-06-272-5/+10
|
* 4276 - switching gears to subxKartik Agaram2018-06-271-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | New plan: spend some time learning to program in machine code atop subx, relying solely on a tiny subset of kernel-provided syscalls. Gradually introduce helpers. Helpers we're sure we don't need, so far: a) Nested expressions b) Garbage collection c) One-size-fits-all memory allocation primitive d) Function overloading and generics Helpers we're sure we need, so far: a) Dependency-injected versions of syscalls b) Tangling directives c) Statically checked types Workflow for a C translator from ascii to binary: a) run generated machine code atop subx (unit tests probably go here) b) emit machine code packaged as an ELF file c) check that the ELF binary runs natively d) check that the ELF binary can be unwrapped and run atop subx This is different from a conventional compiler because the 'HLL' is unconstrained. It is also different from Forth given the emphasis on types. We want a simple stack that also encourages code sharing between programmers. Conventional languages grow monotonically complex. Forth discourages code sharing; it is non-trivial to figure out the 'shape' of data a strange function expects on the stack.
* 4211Kartik K. Agaram2018-02-203-0/+3
| | | | | | | | Just ran into first issue from using the portable /bin/sh rather than a modern shell: https://stackoverflow.com/questions/15744421/read-command-doesnt-wait-for-input Turn on errexit everywhere.
* 4197 - done supporting all indirect addressing modesKartik K. Agaram2018-01-241-0/+44
|
* 4196Kartik K. Agaram2018-01-242-20/+28
|
* 4195Kartik K. Agaram2018-01-243-28/+20
|
* 4194Kartik K. Agaram2018-01-241-2/+80
|
* 4193Kartik K. Agaram2018-01-242-24/+20
|
* 4192Kartik K. Agaram2018-01-241-1/+24
|
* 4191Kartik K. Agaram2018-01-241-1/+15
|
* 4190Kartik K. Agaram2018-01-241-26/+17
|
* 4189Kartik K. Agaram2018-01-245-136/+136
|
* 4188Kartik K. Agaram2018-01-241-5/+11
|
* 4187Kartik K. Agaram2018-01-241-7/+9
|
* 4186Kartik K. Agaram2018-01-241-3/+0
| | | | Fix CI by dropping some accidental copy-pastes.
* 4185Kartik K. Agaram2018-01-247-102/+158
|
* 4184Kartik K. Agaram2018-01-241-1/+13
|
* 4183Kartik K. Agaram2018-01-246-188/+203
|
* 4182 - subx: beginnings of support for indexed addressingKartik K. Agaram2018-01-241-0/+45
|
* 4181Kartik K. Agaram2018-01-214-374/+374
|
* 4180Kartik K. Agaram2018-01-031-2/+7
| | | | Incomplete implementation of `xchg` since commit 4175.
* 4177Kartik K. Agaram2017-12-311-0/+1
| | | | Fix CI.
* 4175Kartik K. Agaram2017-12-301-0/+21
|
* 4174Kartik K. Agaram2017-12-301-0/+72
| | | | Temporary hack to debug Kragen Sitaker's VM.
* 4168Kartik K. Agaram2017-12-301-52/+52
|
* 4162Kartik K. Agaram2017-12-221-25/+0
|
* 4085 - done with first cut of the SubX VMKartik K. Agaram2017-10-182-3/+80
| | | | subx: 'call' and 'return' instructions
* 4084Kartik K. Agaram2017-10-182-25/+24
| | | | | subx: extract helpers for 'push' and 'pop'. We will be using them in 'call' and 'ret' as well.
* 4083Kartik K. Agaram2017-10-182-1/+60
| | | | subx: 'pop'
* 4082Kartik K. Agaram2017-10-182-5/+11
| | | | | subx: correct a 'copy' ('mov') instruction as well to get its operand right from the opcode.
* 4081Kartik K. Agaram2017-10-181-16/+12
|
* 4080Kartik K. Agaram2017-10-181-4/+10
| | | | | | | | subx: correct 'push' register. It gets its operand right from the opcode, not a new modrm byte. Have I misinterpreted any other instructions in this manner (`+rd` in the Intel manual)?
* 4079Kartik K. Agaram2017-10-183-7/+82
| | | | subx: 'pop'
* 4078Kartik K. Agaram2017-10-171-1/+3
|
* 4076Kartik K. Agaram2017-10-161-1/+1
|
* 4075Kartik K. Agaram2017-10-161-3/+4
|
* 4074Kartik K. Agaram2017-10-161-6/+10
|
* 4073Kartik K. Agaram2017-10-161-4/+7
|
* 4071Kartik K. Agaram2017-10-163-46/+510
| | | | | | | | | subx: conditional jump instructions Lots of boilerplate here. This commit really strains my 'copyista' ethic. But I think it's still clearer to see each instruction implemented independently than to try to create a macro or something like that.
* 4070Kartik K. Agaram2017-10-151-0/+11
|
* 4069Kartik K. Agaram2017-10-153-0/+80
| | | | subx: unconditional 'jump'
* 4068Kartik K. Agaram2017-10-151-3/+3
|
* 4067Kartik K. Agaram2017-10-153-3/+92
| | | | subx: 'mov'
* 4066Kartik K. Agaram2017-10-142-2/+2
| | | | | | I spent a while spelunking into the code generated by C compilers before realizing that ignoring the order of arguments for 'cmp' instructions clarifies everything.
* 4065Kartik K. Agaram2017-10-143-0/+228
| | | | | | subx: 'compare' Hopefully I've implemented the 'sense' of comparisons right..
* 4064Kartik K. Agaram2017-10-143-41/+20
|
* 4063Kartik K. Agaram2017-10-141-2/+2
|