about summary refs log tree commit diff stats
path: root/subx
Commit message (Collapse)AuthorAgeFilesLines
* 4292 - start a Vim syntax file for our 'language'Kartik Agaram2018-06-302-0/+26
| | | | | As we add high-level constructs we'll start labeling low-level constructs as unsafe, and highlighting them in red in our editor.
* 4291 - stop copying the ELF header into memoryKartik Agaram2018-06-304-8/+8
| | | | | | | No need for it once the program's loaded. And we keep programs from running the header as code. This also simplifies the header computation in the translator.
* 4290Kartik Agaram2018-06-301-2/+3
| | | | Clarify a few happy accidents.
* 4289 - beginnings of a translator to ELFKartik Agaram2018-06-305-4/+107
| | | | | The source 'language' is still entirely open. We'll see how it evolves as I write programs in machine code.
* 4288Kartik Agaram2018-06-282-1/+20
| | | | Give subx too the recent support for running a single test.
* 4287Kartik Agaram2018-06-281-1/+1
| | | | Fix CI. Looks like 'std::' sometimes doesn't work.
* 4286Kartik Agaram2018-06-281-25/+33
| | | | Make prints uniform.
* 4285Kartik Agaram2018-06-281-1/+1
|
* 4284 - implement first syscall for subxKartik Agaram2018-06-282-0/+20
| | | | Hopefully I won't need much more than exit, read and write.
* 4283Kartik Agaram2018-06-281-1/+1
|
* 4282 - subx now loads teensy/test4Kartik Agaram2018-06-281-13/+53
| | | | | We're now parsing the ELF spec more closely and better handling multiple program header table entries.
* 4281Kartik Agaram2018-06-281-3/+3
|
* 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
|