Commit Graph

29 Commits

Author SHA1 Message Date
Kartik Agaram 6070c23e5e 5897 - rename comparison instructions
Signed and unsigned don't quite capture the essence of what the different
combinations of x86 flags are doing for SubX. The crucial distinction is
that one set of comparison operators is for integers and the second is
for addresses.
2020-01-16 18:31:12 -08:00
Kartik Agaram f1eade7286 5883 - drop the `ref` keyword
When I created it I was conflating two things:
a) needing to refer to just the start, rather than the whole, and
b) counting indirections.

Both are kinda ill-posed. Now Mu will have just `addr` and `handle` types.
Normal types will translate implicitly to `addr` types, while `handle`
will always require explicit handling.
2020-01-12 14:49:35 -08:00
Kartik Agaram 7e7a8a6eae 5876 - address -> addr 2020-01-03 01:36:34 -08:00
Kartik Agaram 2a2a5b1e43 5804
Try to make the comments consistent with the type system we'll eventually
have.
2019-12-08 23:31:05 -08:00
Kartik Agaram 686a52bd2e 5790
Standardize conventions for labels within objects in the data segment.

We're going to use this in a new tool.
2019-12-05 22:57:51 -08:00
Kartik Agaram 442fdabe30 5752
Support binary operations with reg/mem and reg operands.

Everything is passing. However, the self-hosting translator now generates
some discrepancies compared to the C++ translator :(
2019-11-18 01:15:29 -08:00
Kartik Agaram 0fba3393a5 5715
Clean up pseudocode to match planned syntax for the type- and memory-safe
level-2 Mu language.

http://akkartik.name/post/mu-2019-2 is already out of date.
2019-10-26 23:42:27 -07:00
Kartik Agaram f0b7e327c5 5714
Replace calculations of constants with labels.
2019-10-25 06:10:36 -07:00
Kartik Agaram 5409743432 5700 2019-10-17 21:59:51 -07:00
Kartik Agaram 7a5832204a 5698
Thanks Andrew Owen for reporting this typo.
2019-10-15 19:35:19 -07:00
Kartik Agaram 4ac2020fe8 5678 2019-09-19 23:40:53 -07:00
Kartik Agaram fd91f7f61b 5675 - move helpers from subx-common into layers
This undoes 5672 in favor of a new plan:

Layers 000 - 099 are for running without syntax sugar. We use them for
building syntax-sugar passes.

Layers 100 and up are for running with all syntax sugar.

The layers are arranged in approximate order so more phases rely on earlier
layers than later ones.

I plan to not use intermediate syntax sugar (just sigils without calls,
or sigils and calls without braces) anywhere except in the specific passes
implementing them.
2019-09-19 23:25:49 -07:00
Kartik Agaram a9d473e224 5668 - start reorg to permit syntax sugar in layers
Right now we always build the library before any apps.
Apps are where our syntax sugar translators (sigils, calls, braces) live.
So we can't use sugar in the standard library.

New idea: move all code for SubX phases into the top-level.
Perhaps we should also just build a single file rather than pipeline stages.
But for now we'll build each phase by building up to some specific layer.

This will simplify test_apps and move lots of one-off logic to a more standard
form in test_layers.

I'm also going to reorg existing layers so that we introduce each phase
at a point where it mostly only gets the helpers it needs.

This commit itself is just cleaning up some common strings. Using explicit
names for them streamlines binaries a bit.
2019-09-19 15:12:50 -07:00
Kartik Agaram f39eaf81fa 5661 2019-09-15 00:29:52 -07:00
Kartik Agaram dde37113cb 5625 2019-09-05 00:33:34 -07:00
Kartik Agaram 7a69dd4dc6 5620
Further flesh out next-word variant for calls.subx. All the code is
sketched out, and baseline tests pass. No tests yet for new
functionality compared to sigils.subx.
2019-09-04 17:47:38 -07:00
Kartik Agaram 719dec729c 5616 2019-09-04 17:30:40 -07:00
Kartik Agaram 904a053e9c 5613
Translating common bits from sigils.subx expression-aware variant of
next-word to use sigils in calls.subx.
2019-09-03 18:04:49 -07:00
Kartik Agaram 604c8315bd 5607 2019-09-01 23:57:29 -07:00
Kartik Agaram 7a81a4505c 5606 2019-09-01 23:38:06 -07:00
Kartik Agaram b44c754bc0 5605 - sigils: support *disp32 2019-09-01 23:22:39 -07:00
Kartik Agaram 6165d6ece9 5604 2019-09-01 14:00:56 -07:00
Kartik Agaram c94ecaf687 5603 2019-09-01 00:39:17 -07:00
Kartik Agaram cafca95097 5602 2019-09-01 00:12:43 -07:00
Kartik Agaram 075354cd17 5601 2019-08-31 23:58:19 -07:00
Kartik Agaram 282681c729 5600 2019-08-31 23:42:45 -07:00
Kartik Agaram f3ab82e943 5599 - sigils: support metadata in %reg and *reg
We already support metadata after *(...)
No plans to support metadata _inside_ *(...)
2019-08-31 23:00:11 -07:00
Kartik Agaram 3046e34da8 5595 - support ebp and esp in sigils
The x86 instruction set carves out exceptions for these registers.
2019-08-31 22:14:11 -07:00
Kartik Agaram e97b446ac3 5594 - rename 'desugar' to 'sigils'
There's going to be multiple forms of syntax sugar going forward.
2019-08-31 20:43:41 -07:00