| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
|
|
|
|
| |
Fix CI.
a) Update canonical binaries.
b) Fix an out-of-bounds access in `clear-stream`. This also required supporting
a new instruction in `subx run` to load an imm8 into rm8.
|
|
|
|
| |
We only can't use rm32=5 when mod=0. Totally fine when it's mod=1.
|
| |
|
| |
|
|
|
|
| |
More mnemonic register usage in write-stream.
|
|
|
|
| |
Our first buffer overflow!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
New helper: print an error message, then a numeric byte, then abort.
|
|
|
|
| |
New helper: printing a string to a buffered file.
|
|
|
|
| |
Better to use EDI as a mnemonic for 'destination'.
|
|
|
|
| |
Let's standardize to use opcode 39 rather than 3b by default.
|
|
|
|
| |
Fix CI since 4827.
|
| |
|
|
|
|
|
| |
This is likely a sub-optimal interface, but I'm trying not to agonize.
The whole point of Mu is to permit radical changes at any point in time.
|
|
|
|
|
|
|
|
|
| |
I was 'returning' a phantom value from 'write' when the underlying '_write'
returns nothing.
In general, returning counts of bytes written is not so useful for error
checking when my primitives abstract away from that. We'll come back to
error signalling later.
|
|
|
|
|
|
|
| |
Fix CI.
It's kind of a hassle (and wasteful) that I need to redefine 'main' in
every single layer.
|
| |
|
| |
|
|
|
|
|
|
|
| |
Start with an exactly corresponding version to Crenshaw 2-1: single-digit
numbers. The only change: we assume the number is in hex.
The next version now supports multi-digit hex numbers.
|
|
|
|
| |
Simplification.
|
|
|
|
| |
In the process I had to fix a couple more bugs in support for disp16 instructions.
|
| |
|
| |
|
|
|
|
|
| |
This time I've ported (and test-driven) 'GetChar' and 'GetNum'. The new
tests bring together our new testable interfaces for read() and exit().
|
|
|
|
|
| |
Long-standing and long-copied typo has been messing with our exit status
on test failures.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Extract a helper that we'll need for 'read'.
|
| |
|
|
|
|
|
|
|
|
|
| |
We'll use a common stream data structure for input and output streams.
Having separate types makes more sense in a more high-level language, where
we have type checking and where functions for handling the different types
are more concise. But in machine code the sweet spot is more toward fewer
types.
|
| |
|
|
|
|
|
|
| |
Start injecting all dependencies in the Crenshaw compiler app.
In the process I realized the non-fake code path of 'stop' had a bug.
|
| |
|
|
|
|
|
|
|
|
| |
Initial sketch of a dependency-injected wrapper around the exit() syscall.
I don't have the primitives yet, just a sketch of how they should work
-- and a passing test for non-local jumps without support for passing the
exit status to the caller.
|
|
|
|
|
|
|
| |
Extract a helper for appending strings to raw buffers.
I'd been resisting this idea, but it actually turns out to be a pretty
clean abstraction in the end.
|
|
|
|
|
| |
Start using write() instead of _write().. and we promptly find a typo when
dealing with real file descriptors.
|
| |
|
| |
|
| |
|
|
|
|
| |
All tests now once again run the same natively and on VM.
|
|
|
|
|
|
|
|
|
|
| |
Turns out the tests for 'trace' have been broken in native mode since the
original commit (4674). Dangers of running my tests on Darwin, where I
can't run them natively.
The test failures didn't get flagged on CI because I'd forgotten to update
the exit code of the factorial app in commit 4664. At least that's fixed
in this commit.
|
| |
|
|
|
|
| |
subx: append to trace
|
|
|
|
|
| |
Standardize on hyphens in all names.
And we'll use colons for namespacing labels in functions.
|
| |
|