Commit Graph

21 Commits

Author SHA1 Message Date
Kartik Agaram 2eb174d697 4908
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.
2019-01-05 01:07:37 -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 6a7eaa81ee 4883 - rudimentary memory allocator 2018-12-28 11:14:29 -08:00
Kartik Agaram 044b413021 4879 2018-12-28 02:07:11 -08:00
Kartik Agaram 3d4fba4d12 4865
More mnemonic register usage in write-stream.
2018-12-10 09:55:46 -08:00
Kartik Agaram 3a4d870730 4864
Our first buffer overflow!
2018-12-10 00:17:47 -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 0becf53645 4844 2018-12-06 00:18:13 -08:00
Kartik Agaram 79328f9ad6 4841
New helper: print an error message, then a numeric byte, then abort.
2018-12-04 12:26:27 -08:00
Kartik Agaram a94b60b5cc 4840
New helper: printing a string to a buffered file.
2018-12-04 12:16:17 -08:00
Kartik Agaram af5797eeff 4838
Better to use EDI as a mnemonic for 'destination'.
2018-12-04 10:40:01 -08:00
Kartik Agaram 9e03e2bd37 4837
Let's standardize to use opcode 39 rather than 3b by default.
2018-12-04 10:19:18 -08:00
Kartik Agaram 381d80f8a4 4834
Fix CI since 4827.
2018-12-04 09:56:23 -08:00
Kartik Agaram a9cce7121a 4833 2018-12-04 00:30:00 -08:00
Kartik Agaram 83822d6324 4828 - writing to buffered-file
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.
2018-12-03 17:08:53 -08:00
Kartik Agaram 5e27c7f13e 4827
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.
2018-12-03 16:44:16 -08:00
Kartik Agaram 1eb9cc5679 4822
Fix CI.

It's kind of a hassle (and wasteful) that I need to redefine 'main' in
every single layer.
2018-12-03 11:41:33 -08:00
Kartik Agaram 0eb0f69616 4821 2018-12-02 22:41:28 -08:00
Kartik Agaram 87c606ee06 4810 2018-11-30 16:56:35 -08:00
Kartik Agaram 50dcc0c122 4776
Crenshaw compiler now runs natively as well.

It turns out I was misreading the Intel manual, and the jump instructions
that I thought take disp16 operands actually take disp32 operands by default
on both i686 and x86_64 processors. The disp16 versions are some holdover
from the 16-bit days.

This was the first time I've used one of these erstwhile-disp16 instructions,
but I still haven't tested most of them. We'll see if we run into future
issues.
2018-11-25 13:46:53 -08:00
Kartik Agaram 33fdc60b16 4775
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.
2018-11-24 23:26:14 -08:00