| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
New example program: ascii null-terminated string comparison
I'd hoped this would be a stepping stone to supporting general ascii comparison,
but we're planning to use size-prefixed rather than null-terminated arrays
everywhere. The only exception is commandline arguments, which will remain
null-terminated to interoperate with Linux.
So I'm going to need separate functions for "compare with argv" and for
general string comparison.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
New example, just to fix in my head how arguments go on the stack.
It's possible I'm still confused about the order callers push args in to
the stack. But even if this violates the calling convention, it should
still run.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Get the 'edit' script working again with the 'EE' command in Vim.
|
|
|
|
|
|
|
|
|
| |
All it takes is to code-generate a simple function called 'run_tests' that
calls all functions starting with 'test_' one by one.
I've temporarily switched the factorial app to run as a test. But that's
temporary, because all the code to print '.' vs 'F' needs to get extracted
out into a helper.
|
|
|
|
|
| |
Neither jump nor call instructions support immediates. Drop that.
The only form of absolute addressing relies on rm32.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Start of a new example program.
|
|
|
|
|
| |
More useful trace if we mess up args to a syscall and pass a non-pointer
where a pointer is expected.
|
|
|
|
|
|
|
|
| |
Running reset() doesn't seem necessary so far for the translate sub-command,
but it's likely to expose us to weird bugs.
Immediately, it requires toggling `Dump_trace` in different places to print
traces while translating vs while running.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Bring Mu's trace harness in line with recent changes in SubX.
|
|
|
|
| |
Stale file since 4523.
|
|
|
|
|
|
|
|
| |
Attempt #3 at fixing CI.
In the process the feature gets a lot less half-baked.
Ridiculously misleading that we had `has_metadata()` was special-cased
to one specific transform. I suck.
|
|
|
|
|
|
|
| |
Really fix CI.
Also realized we don't need to worry about function pointers. They won't
be in /disp32 fields.
|
|
|
|
| |
Fix CI (`subx translate examples/ex6.subx examples/ex6`)
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Streamline the factorial function; we don't need to save a stack variable
into a register before operating on it. All instructions can take a stack
variable directly.
In the process we found two bugs:
a) Opcode f7 was not implemented correctly. It was internally consistent
but I'd never validated it against a natively running program. Turns out
it encodes multiple instructions, not just 'not'.
b) The way we look up imm32 operands was sometimes reading them before
disp8/disp32 operands.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I'd been planning to add segment address computation after all labels were
computed, including labels in the data segment (which isn't built yet).
But now I realize that won't work, because labels in the data segment will
require segment start addresses. We need to deal in absolute addresses
rather than relative offsets as with the jump instructions that use code
labels.
Layer 34 is now broken by this change in a way that isn't obvious right
now: it is oblivious to imm32 and disp32 operand tags that are now going
to be present in the programs it sees. It's a lucky accident that everything
still works, because we're only using segment names right now for the very
first (code) segment in a program.
|
| |
|
|
|
|
| |
Make segment names a separate transform.
|
| |
|
| |
|