about summary refs log tree commit diff stats
path: root/baremetal/ex2.mu
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2021-02-07 00:17:17 -0800
committerKartik Agaram <vc@akkartik.com>2021-02-07 00:20:29 -0800
commit74f1512ff113cf35706af57e9d40c78b7d77f49e (patch)
tree7c7acb23e1a26387117e464ec6ab01126dbc8ae8 /baremetal/ex2.mu
parent6c4c25555c7df0d78ad41c813345f63cae1819de (diff)
downloadmu-74f1512ff113cf35706af57e9d40c78b7d77f49e.tar.gz
7690
Convert comments about magic constants into metadata.
Diffstat (limited to 'baremetal/ex2.mu')
-rw-r--r--baremetal/ex2.mu4
1 files changed, 2 insertions, 2 deletions
diff --git a/baremetal/ex2.mu b/baremetal/ex2.mu
index 1662fa84..adc905e9 100644
--- a/baremetal/ex2.mu
+++ b/baremetal/ex2.mu
@@ -13,11 +13,11 @@
 fn main {
   var y/eax: int <- copy 0
   {
-    compare y, 0x300  # screen-height = 768
+    compare y, 0x300/screen-height=768
     break-if->=
     var x/edx: int <- copy 0
     {
-      compare x, 0x400  # screen-width = 1024
+      compare x, 0x400/screen-width=1024
       break-if->=
       var color/ecx: int <- copy x
       color <- and 0xff
teral.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
#!/bin/sh
# Translate SubX using the self-hosted translator.
#
# Possible knobs:
#   Whether to run a phase directly or emulated.
#     Just always emulate for now since we debug on non-Linux.
#   Whether to stop after a phase.
#     Just always run all phases, but print out phases so it's clear where an error happens.
#   Whether to trace a phase. Whether to always trace or rerun with tracing enabled after an error.
#     Leave tracing to other scripts. We save intermediate files so it's easy to rerun a single phase afterwards.
#   Whether to run a phase with debug information. (Need to juggle multiple sets of debug files.)
#     Again, that's for subsequent scripts.

set -e
set -v

./build

echo `cat $* |grep -v '^\s*#\|^\s*$' |wc -l` lines

cat $*          |./subx_bin run apps/tests    > a.tests

cat a.tests     |./subx_bin run apps/dquotes  > a.dquotes

cat a.dquotes   |./subx_bin run apps/assort   > a.assort

cat a.assort    |./subx_bin run apps/pack     > a.pack

cat a.pack      |./subx_bin run apps/survey   > a.survey

cat a.survey    |./subx_bin run apps/hex      > a.elf

xxd a.elf                                     > a.xxd