about summary refs log tree commit diff stats
path: root/subx/examples
Commit message (Collapse)AuthorAgeFilesLines
* 5485 - promote SubX to top-levelKartik Agaram2019-07-2725-910/+0
|
* 5456Kartik Agaram2019-07-221-0/+0
| | | | Fix CI.
* 5454Kartik Agaram2019-07-221-0/+0
| | | | Bugfix fifteen -- on the C++ side.
* 5417Kartik Agaram2019-07-181-1/+0
| | | | Clean up.
* 5416Kartik Agaram2019-07-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Figured out what's going in with bug fourteen: displacement operands aren't always used relative to the PC. Does this mean I need to track instruction boundaries past pack? :'( No, I just need different logic for labels in code vs data segments. This was an interesting bug for reminding me of the difference between the emulator-level trace and the application-level trace. The former has 1.5 million lines, while the latter has a dozen. Luckily, just dumping the latter immediately made obvious what the issue was. Though this experience does suggest some further ideas for debugging tools: slice trace by line and phase slice trace by start and end label debug UI for SubX translator 2D layout: rows = lines of code; columns = translator phases each 'cell' in this layout contains a list of log lines shows what came in, what was emitted easily collapse any cell These are domain-specific tools. Special-cased to the SubX translator phases.
* 5410 - 4 examples passingKartik Agaram2019-07-1716-0/+20
| | | | | Clean up other examples as well to satisfy the requirements in commit 5404.
* 5404 - subx/examples/ex1 now translatingKartik Agaram2019-07-152-0/+3
| | | | | | | | | | | | | | | | | | | The result isn't an identical binary to before, and it segfaults when run. But it's bugfix seven. A couple of places where we make .subx files a little more strict: a) All .subx files must define a data segment. Even if they have no data. b) All .subx files must define an `Entry` label for the binary to start at. Earlier we used to default to the start of the code label. That's not too hard to add; we'd just need to: i) rename `get` to `get-or-abort` ii) clone a third variant of `get-or-insert` called `get` that returns null if the key is not found. iii) use `get` rather than `get-or-abort` when looking up the `Entry` label.
* switch to new syntax for segment headers in C++Kartik Agaram2019-05-1813-21/+22
|
* 5102Kartik Agaram2019-04-164-5/+5
|
* 5099Kartik Agaram2019-04-161-4/+4
|
* 5084Kartik Agaram2019-04-113-3/+3
|
* 5037Kartik Agaram2019-03-292-3/+3
|
* 5011Kartik Agaram2019-03-202-2/+2
| | | | | | | New convention: compare 'with' for asymmetric comparisons (greater or lesser than), and compare 'and' for symmetric comparisons. Worth making this distinction even though the opcodes are identical; when we compare 'with', the order of operands is significant.
* 5009Kartik Agaram2019-03-201-1/+1
|
* 4981 - no, go back to 3 phasesKartik Agaram2019-02-183-3/+4
| | | | | | | | | | | | | Considering how much trouble a merge phase would be (commit 4978), it seems simpler to just add the extra syntax for controlling the entry point of the generated ELF binary. But I wouldn't have noticed this if I hadn't taken the time to write out the commit messages of 4976 and 4978. Even if we happened to already have linked list primitives built, this may still be a good idea considering that I'm saving quite a lot of code in duplicated entrypoints.
* 4973Kartik Agaram2019-02-155-12/+13
| | | | | Support immediate operands in the data segment in all the ways we support them in the code segment.
* 4963Kartik Agaram2019-02-143-6/+6
|
* 4961Kartik Agaram2019-02-145-67/+73
|
* 4923Kartik Agaram2019-01-122-1/+1
| | | | | We want slice-equal? for length-prefixed strings, not null-terminated "kernel" strings.
* 4893Kartik Agaram2018-12-3012-24/+24
|
* 4888Kartik Agaram2018-12-298-13/+13
| | | | We only can't use rm32=5 when mod=0. Totally fine when it's mod=1.
* 4886Kartik Agaram2018-12-281-1/+1
|
* 4881Kartik Agaram2018-12-284-4/+4
|
* 4847Kartik Agaram2018-12-064-4/+4
|
* 4824Kartik Agaram2018-12-032-9/+9
|
* 4819Kartik Agaram2018-12-021-3/+3
|
* 4818Kartik Agaram2018-12-021-2/+2
|
* 4817Kartik Agaram2018-12-021-1/+1
|
* 4808 - clean up comments in all subx filesKartik Agaram2018-11-3012-80/+83
|
* 4802Kartik Agaram2018-11-3012-118/+118
| | | | | | | | | | | | | | | | Some automated commenting cleanup. Still needs more careful manual scanning. sed -i 's/^# 1-3/# . 1-3/' *.subx */*.subx sed -i 's/^# op/# . op/' *.subx */*.subx sed -i 's/# vim/# . . vim/' *.subx */*.subx sed -i 's/^ # push args/ # . . push args/' *.subx */*.subx sed -i 's/^ # discard args/ # . . discard args/' *.subx */*.subx sed -i 's/^ # call/ # . . call/' *.subx */*.subx sed -i 's/^ # prolog/ # . prolog/' *.subx */*.subx sed -i 's/^ # epilog/ # . epilog/' *.subx */*.subx sed -i 's/^ # save registers/ # . save registers/' *.subx */*.subx sed -i 's/^ # restore registers/ # . restore registers/' *.subx */*.subx sed -i 's/ operand / register /' *.subx */*.subx
* 4801Kartik Agaram2018-11-3010-460/+460
| | | | Reindent all SubX code to make some room for the new comment style.
* 4792Kartik Agaram2018-11-281-2/+2
| | | | Thanks Pelle Hjek for the feedback: http://arclanguage.org/item?id=20870
* 4780Kartik Agaram2018-11-2610-1/+11
|
* 4757Kartik Agaram2018-11-204-40/+40
| | | | | | Let's start highlighting all global variables in Red. Assembly programming has a tendency to over-use them. They're a necessary evil, but we should minimize the number of functions that access them.
* 4731Kartik Agaram2018-10-281-3/+3
|
* 4698Kartik Agaram2018-10-146-27/+27
|
* 4669Kartik Agaram2018-10-055-50/+40
|
* 4668Kartik Agaram2018-10-0512-76/+76
|
* 4667Kartik Agaram2018-10-056-96/+98
| | | | | Standardize on hyphens in all names. And we'll use colons for namespacing labels in functions.
* 4662Kartik Agaram2018-10-0512-9/+15
|
* 4661Kartik Agaram2018-10-0412-0/+0
| | | | | Make segment management a little more consistent between initial segments and add-on segments (using `mmap`).
* 4655Kartik Agaram2018-10-021-2/+2
|
* 4650Kartik Agaram2018-10-024-21/+21
|
* 4646Kartik Agaram2018-10-011-1/+1
|
* 4644Kartik Agaram2018-10-0115-84/+84
|
* 4643Kartik Agaram2018-10-012-11/+11
|
* 4641Kartik Agaram2018-10-012-52/+53
|
* 4639Kartik Agaram2018-10-0112-36/+36
|
* 4624Kartik Agaram2018-09-3012-12/+12
| | | | | | | | Start requiring a '-o' flag to designate the output binary when translating. Things currently get funky if you pass in multiple inputs, but that's ok. This is the first step to supporting multiple input files for a single output binary.
* 4622Kartik Agaram2018-09-302-20/+0
| | | | | When I started SubX I imagined that being able to write machine code directly was a feature. Now it's just a hole I haven't bothered closing yet.