This was why I was trying to use a different output register: a second
function to call.
And I managed to mess it up again, changing the output of load-file, but
not how it was computed in the body.
There were three confounding issues to get past before this seemed to be
working right:
- row/col count from 1 rather than 0
- I was thinking in decimal rather than hex
- print-byte buffers to stdout, but print-string does not. I didn't think
this mattered, but it does matter to flush the current line before
moving cursor again.
Only one of these issues was a bug in the code. The first two were bugs
in my mental model that necessitated no changes to code to be corrected.
Observations:
- the orchestration from 'in' to 'addr-in' to '_in-addr' to 'in-addr'
is quite painful. Once to turn a handle into its address, once to turn
a handle into the address of its payload, and a third time to switch
a variable out of the overloaded 'eax' variable to make room for read-byte-buffered.
- I'm starting to use SubX as an escape hatch for features missing in Mu:
- access to syscalls (which pass args in registers)
- access to global variables
Starting to feel the need for more static checks, like when I must use a
register, or when a variable has been clobbered.
The good news: I thought I'd found a bug in apps/mu, but I hadn't.
Adding some more colors will improve the experience, but the choices depend
on colorscheme, and first impressions should at least not seem to have
degraded things.
How did new-literal ever work?! Somehow we had eax silently being clobbered
without affecting behavior over like 5 apps. Unsafe languages suck.
Anyways, factorial.mu is now part of CI.