mu/subx/examples
Kartik Agaram aef4efb959 5404 - subx/examples/ex1 now translating
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.
2019-07-15 12:26:41 -07:00
..
ex1 5404 - subx/examples/ex1 now translating 2019-07-15 12:26:41 -07:00
ex1.subx 5404 - subx/examples/ex1 now translating 2019-07-15 12:26:41 -07:00
ex2 4661 2018-10-04 23:23:48 -07:00
ex2.subx switch to new syntax for segment headers in C++ 2019-05-18 00:45:12 -07:00
ex3 4661 2018-10-04 23:23:48 -07:00
ex3.subx switch to new syntax for segment headers in C++ 2019-05-18 00:45:12 -07:00
ex4 switch to new syntax for segment headers in C++ 2019-05-18 00:45:12 -07:00
ex4.subx switch to new syntax for segment headers in C++ 2019-05-18 00:45:12 -07:00
ex5 4661 2018-10-04 23:23:48 -07:00
ex5.subx switch to new syntax for segment headers in C++ 2019-05-18 00:45:12 -07:00
ex6 4661 2018-10-04 23:23:48 -07:00
ex6.subx switch to new syntax for segment headers in C++ 2019-05-18 00:45:12 -07:00
ex7 4661 2018-10-04 23:23:48 -07:00
ex7.subx switch to new syntax for segment headers in C++ 2019-05-18 00:45:12 -07:00
ex8 4923 2019-01-12 22:24:06 -08:00
ex8.subx switch to new syntax for segment headers in C++ 2019-05-18 00:45:12 -07:00
ex9 4888 2018-12-29 13:36:06 -08:00
ex9.subx switch to new syntax for segment headers in C++ 2019-05-18 00:45:12 -07:00
ex10 4888 2018-12-29 13:36:06 -08:00
ex10.subx switch to new syntax for segment headers in C++ 2019-05-18 00:45:12 -07:00
ex11 4961 2019-02-14 16:24:20 -08:00
ex11.subx switch to new syntax for segment headers in C++ 2019-05-18 00:45:12 -07:00
ex12 4661 2018-10-04 23:23:48 -07:00
ex12.subx switch to new syntax for segment headers in C++ 2019-05-18 00:45:12 -07:00
Readme.md 4618 2018-09-29 17:45:00 -07:00

Small example programs, each with a simple pedagogical goal.

They also help to validate SubX instruction semantics against native x86 hardware. For example, loading a single byte to a register would for some time clear the rest of the register. This behavior was internally consistent with unit tests. It took running an example binary natively to catch the discrepancy.