diff options
author | Kartik Agaram <vc@akkartik.com> | 2019-08-31 20:43:41 -0700 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2019-08-31 20:43:41 -0700 |
commit | e97b446ac3023d39d190911074850e686aa5f3aa (patch) | |
tree | 6d32495cf8c6179de27d334dcc3710b2fc0ea283 /apps | |
parent | a21fb73d0421960a8a0b746827455b650346978b (diff) | |
download | mu-e97b446ac3023d39d190911074850e686aa5f3aa.tar.gz |
5594 - rename 'desugar' to 'sigils'
There's going to be multiple forms of syntax sugar going forward.
Diffstat (limited to 'apps')
-rwxr-xr-x | apps/sigils (renamed from apps/desugar) | bin | 50761 -> 50761 bytes | |||
-rw-r--r-- | apps/sigils.subx (renamed from apps/desugar.subx) | 31 |
2 files changed, 16 insertions, 15 deletions
diff --git a/apps/desugar b/apps/sigils index 5501a794..5501a794 100755 --- a/apps/desugar +++ b/apps/sigils Binary files differdiff --git a/apps/desugar.subx b/apps/sigils.subx index 4abe5614..40be4f98 100644 --- a/apps/desugar.subx +++ b/apps/sigils.subx @@ -1,33 +1,34 @@ -# Experimental syntax sugar for SubX programs. +# Experimental syntax sugar for addressing modes that expand into /rm32 and +# other related arguments. # # To run: -# $ ./subx translate 0*.subx apps/subx-common.subx apps/desugar.subx -o apps/desugar +# $ ./subx translate 0*.subx apps/subx-common.subx apps/sigils.subx -o apps/sigils # -# We're experimenting with the following expressions: +# We currently support the following notations: # # 1. -# $ echo "ab %eax" | ./subx run apps/desugar -# ab 3/mod 0/rm32 +# $ echo '%eax' | ./subx run apps/sigils +# 3/mod 0/rm32 # # 2. -# $ echo "ab *eax" | ./subx run apps/desugar -# ab 0/mod 0/rm32 +# $ echo '*eax' | ./subx run apps/sigils +# 0/mod 0/rm32 # # 3. -# $ echo "ab *(eax+4)" | ./subx run apps/desugar -# ab 2/mod 0/rm32 4/disp32 +# $ echo '*(eax+4)' | ./subx run apps/sigils +# 2/mod 0/rm32 4/disp32 # # 4. -# $ echo "ab *(eax+ecx)" | ./subx run apps/desugar -# ab 0/mod 4/rm32 0/base 1/index 0/scale +# $ echo '*(eax+ecx)' | ./subx run apps/sigils +# 0/mod 4/rm32 0/base 1/index 0/scale # # 5. -# $ echo "ab *(eax+ecx+4)" | ./subx run apps/desugar -# ab 2/mod 4/rm32 0/base 1/index 0/scale 4/disp32 +# $ echo '*(eax+ecx+4)' | ./subx run apps/sigils +# 2/mod 4/rm32 0/base 1/index 0/scale 4/disp32 # # 6. -# $ echo "ab *(eax+ecx<<2+4)" | ./subx run apps/desugar -# ab 2/mod 4/rm32 0/base 1/index 2/scale 4/disp32 +# $ echo '*(eax+ecx<<2+4)' | ./subx run apps/sigils +# 2/mod 4/rm32 0/base 1/index 2/scale 4/disp32 # # Addition isn't commutative here. Template must always be (base+index<<scale+disp), # though some components are optional as described above. |