about summary refs log tree commit diff stats
path: root/subx/apps
Commit message (Collapse)AuthorAgeFilesLines
* 4923Kartik Agaram2019-01-125-0/+0
| | | | | We want slice-equal? for length-prefixed strings, not null-terminated "kernel" strings.
* 4920Kartik Agaram2019-01-117-178/+4
|
* 4916Kartik Agaram2019-01-107-9/+0
| | | | | In the process of building slice primitives I found an out-of-bounds access in write-byte.
* 4915Kartik Agaram2019-01-081-11/+176
| | | | | | In the process of building next-token I finally added some support for a debugging situation I've found myself in a couple of times: wondering "what changed this memory location"?
* 4913Kartik Agaram2019-01-076-2/+22
|
* 4911Kartik Agaram2019-01-066-1/+0
|
* 4908Kartik Agaram2019-01-055-0/+0
| | | | | | | | Fix CI. a) Update canonical binaries. b) Fix an out-of-bounds access in `clear-stream`. This also required supporting a new instruction in `subx run` to load an imm8 into rm8.
* 4905 - safe ptr lookup is now 6 instructionsKartik Agaram2019-01-042-25/+20
| | | | | | | | | | | | | The lines within '{}' can now be turned into a macro like `E_X = deref(E_X)`, parameterizing the register being modified. Assumes the input is in a register but also saved elsewhere, so it's safe to clobber and replace with the result. Compare commit 4894. Used to take 9 instructions, 8 of them making loads/stores. Now it's 6 instructions, 4 of them loads/stores (the one non-local load is unchanged, of course). Key is to not consume more registers so we don't have to push/pop them.
* 4904Kartik Agaram2019-01-041-1/+0
|
* 4902 - initial sketch, stage 2 of compilerKartik Agaram2019-01-031-0/+164
| | | | I've agonized over this for a week; high time I saved a snapshot.
* 4900Kartik Agaram2018-12-302-39/+34
| | | | | | | | | | | Finally really fix the CI failure of commit 4894. This is a remainder to forget my knowledge of stack addresses in the SubX VM when writing SubX programs. Otherwise my programs will work in the VM but not natively. The only assumptions a SubX program should make about its segment addresses are what's encoded in the ELF binary. Thanks to https://en.wikipedia.org/wiki/Address_space_layout_randomization, it can't know anything else.
* 4896Kartik Agaram2018-12-301-0/+0
| | | | Fix CI.
* 4894Kartik Agaram2018-12-302-0/+160
| | | | | | | | | | | | Done with kinda-safe pointers. In a real compiler the fast path of 'lookup' would ideally get inlined. Excluding procedure-call overhead, the current implementation consumes 2 registers besides the input, and requires 9 instructions (2 push, 2 load, compare, jump, increment, 2 pop). That's large enough that inlining may become a trade-off. Even if we somehow magically had the registers already loaded and available, we'd still need 4 instructions (1 pointer dereference, compare, jump and increment). The price of safety.
* 4893Kartik Agaram2018-12-301-1/+1
|
* 4889 - playing with kinda-safe pointersKartik Agaram2018-12-292-0/+211
|
* 4888Kartik Agaram2018-12-298-82/+82
| | | | We only can't use rm32=5 when mod=0. Totally fine when it's mod=1.
* 4886Kartik Agaram2018-12-283-5/+5
|
* 4883 - rudimentary memory allocatorKartik Agaram2018-12-284-0/+0
|
* 4881Kartik Agaram2018-12-281-1/+1
|
* 4879Kartik Agaram2018-12-287-22/+22
|
* 4865Kartik Agaram2018-12-104-0/+0
| | | | More mnemonic register usage in write-stream.
* 4864Kartik Agaram2018-12-104-0/+0
| | | | Our first buffer overflow!
* 4862Kartik Agaram2018-12-091-2/+1
|
* 4861Kartik Agaram2018-12-092-42/+42
|
* 4860 - stage 1 of SubX compiler in SubX is done!Kartik Agaram2018-12-092-9/+66
| | | | | | | | | I'm imagining 3 core stages total: 1. convert text hex bytes -> binary (✓) 2. pack and reorder operands 3. compute label addresses (Not including extras like error-checking.)
* 4859Kartik Agaram2018-12-091-8/+8
|
* 4856Kartik Agaram2018-12-061-0/+0
| | | | Fix CI.
* 4854Kartik Agaram2018-12-062-0/+184
|
* 4853Kartik Agaram2018-12-061-5/+6
|
* 4851Kartik Agaram2018-12-062-21/+187
| | | | | | | Bugfix in scenarios where scan-next-byte needs to abort. I'm starting to have trouble keeping strings, streams and buffered-files straight.
* 4850Kartik Agaram2018-12-062-1/+137
|
* 4849Kartik Agaram2018-12-062-1/+90
|
* 4848Kartik Agaram2018-12-062-7/+6
|
* 4847Kartik Agaram2018-12-064-14/+14
|
* 4846Kartik Agaram2018-12-065-66/+327
| | | | | | | | | | | | | | Clean up a few things: a) Call scan-next-byte in hex.subx with the right number of args. Turns out tests continue to work fine if they never use the other args. b) Tear down a test for 'stop' in the right order. Not important since we have no EBP to restore. But can still be misleading. c) Have 'check-ints-equal' return nothing. Handy for it to not mess up EAX. I never use the result anyway, and the name also is imperative suggesting callers won't expect a return value.
* 4845Kartik Agaram2018-12-061-3/+0
|
* 4844Kartik Agaram2018-12-063-0/+0
|
* 4845Kartik Agaram2018-12-062-0/+823
| | | | Making progress on hex1 (http://web.archive.org/web/20061108010907/http://www.rano.org/bcompiler.html)
* 4841Kartik Agaram2018-12-043-0/+0
| | | | New helper: print an error message, then a numeric byte, then abort.
* 4840Kartik Agaram2018-12-045-2/+2
| | | | New helper: printing a string to a buffered file.
* 4838Kartik Agaram2018-12-043-0/+0
| | | | Better to use EDI as a mnemonic for 'destination'.
* 4837Kartik Agaram2018-12-044-2/+2
| | | | Let's standardize to use opcode 39 rather than 3b by default.
* 4834Kartik Agaram2018-12-043-0/+0
| | | | Fix CI since 4827.
* 4833Kartik Agaram2018-12-043-0/+0
|
* 4832Kartik Agaram2018-12-042-0/+6
| | | | | | Let's start adding ':end' labels in all functions, just because it helps us visualize where function calls end in traces, thanks to the '--map' commandline argument.
* 4828 - writing to buffered-fileKartik Agaram2018-12-033-0/+0
| | | | | This is likely a sub-optimal interface, but I'm trying not to agonize. The whole point of Mu is to permit radical changes at any point in time.
* 4827Kartik Agaram2018-12-033-0/+0
| | | | | | | | | I was 'returning' a phantom value from 'write' when the underlying '_write' returns nothing. In general, returning counts of bytes written is not so useful for error checking when my primitives abstract away from that. We'll come back to error signalling later.
* 4826Kartik Agaram2018-12-032-2/+2
|
* 4822Kartik Agaram2018-12-033-0/+0
| | | | | | | Fix CI. It's kind of a hassle (and wasteful) that I need to redefine 'main' in every single layer.
* 4821Kartik Agaram2018-12-025-82/+0
|