Commit Graph

25 Commits

Author SHA1 Message Date
Kartik Agaram 8188bbbc94 4981 - no, go back to 3 phases
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.
2019-02-18 21:48:19 -08:00
Kartik Agaram 9b16f19049 4973
Support immediate operands in the data segment in all the ways we support
them in the code segment.
2019-02-15 17:20:57 -08:00
Kartik Agaram 1639687ba0 4961 2019-02-14 16:24:20 -08:00
Kartik Agaram 71ee78f279 4933 2019-01-16 11:13:39 -08:00
Kartik Agaram 7011322ad1 4929
Clean up primitives for converting from/to hex chars.
2019-01-15 14:11:26 -08:00
Kartik Agaram feec2292b5 4925 2019-01-14 16:54:41 -08:00
Kartik Agaram dadae33848 4920 2019-01-11 17:50:29 -08:00
Kartik Agaram 8b9dd2d1a9 4916
In the process of building slice primitives I found an out-of-bounds access
in write-byte.
2019-01-10 17:06:38 -08:00
Kartik Agaram dd9ba09a7c 4888
We only can't use rm32=5 when mod=0. Totally fine when it's mod=1.
2018-12-29 13:36:06 -08:00
Kartik Agaram 431627b242 4886 2018-12-28 21:26:42 -08:00
Kartik Agaram 044b413021 4879 2018-12-28 02:07:11 -08:00
Kartik Agaram f9ec61327a 4862 2018-12-09 23:37:34 -08:00
Kartik Agaram 5262ed0de3 4861 2018-12-09 22:46:39 -08:00
Kartik Agaram 42a933078c 4860 - stage 1 of SubX compiler in SubX is done!
I'm imagining 3 core stages total:
  1. convert text hex bytes -> binary (✓)
  2. pack and reorder operands
  3. compute label addresses

(Not including extras like error-checking.)
2018-12-09 21:18:05 -08:00
Kartik Agaram c91d67a29b 4859 2018-12-09 21:08:06 -08:00
Kartik Agaram 09944ba6a8 4854 2018-12-06 12:52:38 -08:00
Kartik Agaram 24e3796c23 4853 2018-12-06 12:27:06 -08:00
Kartik Agaram 48140fcd3f 4851
Bugfix in scenarios where scan-next-byte needs to abort.

I'm starting to have trouble keeping strings, streams and buffered-files
straight.
2018-12-06 12:07:48 -08:00
Kartik Agaram 272408b06b 4850 2018-12-06 11:11:43 -08:00
Kartik Agaram e9909be374 4849 2018-12-06 11:01:23 -08:00
Kartik Agaram a966881b6e 4848 2018-12-06 10:50:26 -08:00
Kartik Agaram 81605224f0 4847 2018-12-06 09:41:40 -08:00
Kartik Agaram 33e7c3a751 4846
Clean up a few things:

a) Call scan-next-byte in hex.subx with the right number of args. Turns
out tests continue to work fine if they never use the other args.

b) Tear down a test for 'stop' in the right order. Not important since we
have no EBP to restore. But can still be misleading.

c) Have 'check-ints-equal' return nothing. Handy for it to not mess up
EAX. I never use the result anyway, and the name also is imperative suggesting
callers won't expect a return value.
2018-12-06 09:34:55 -08:00
Kartik Agaram 33cf1f90be 4845 2018-12-06 00:42:12 -08:00
Kartik Agaram 257ca35ab4 4845
Making progress on hex1 (http://web.archive.org/web/20061108010907/http://www.rano.org/bcompiler.html)
2018-12-06 00:16:01 -08:00