Commit Graph

4784 Commits

Author SHA1 Message Date
Kartik Agaram
261b1b8056 4719 - testable interface wrapping around exit() 2018-10-24 22:21:59 -07:00
Kartik Agaram
4524da2bb6 4718 2018-10-24 15:52:41 -07:00
Kartik Agaram
b6fdd2e4e5 4717 2018-10-24 00:01:00 -07:00
Kartik Agaram
92d8ef6c3b 4716 2018-10-23 23:32:38 -07:00
Kartik Agaram
d27812594a 4715 - support one more negation instruction 2018-10-23 23:19:55 -07:00
Kartik Agaram
bfc997cfda 4714
Improve error-checking for unnecessary displacement operands.
2018-10-23 23:18:31 -07:00
Kartik Agaram
f3612481b1 4713
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.
2018-10-21 21:17:22 -07:00
Kartik Agaram
417a05ee7d 4712 2018-10-21 20:36:43 -07:00
Kartik Agaram
b847538071 4711
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.
2018-10-17 22:31:39 -07:00
Kartik Agaram
4cc517e0de 4710
Start using write() instead of _write().. and we promptly find a typo when
dealing with real file descriptors.
2018-10-17 08:19:03 -07:00
Kartik Agaram
104e521c04 4709 2018-10-17 07:08:47 -07:00
Kartik Agaram
800320a70c 4708 2018-10-17 06:47:28 -07:00
Kartik Agaram
3d6450f216 4707 - subx: dependency-injected write() primitive 2018-10-16 23:44:31 -07:00
Kartik Agaram
df592211f6 4706 2018-10-16 23:43:32 -07:00
Kartik Agaram
8108f5b875 4705 2018-10-16 23:27:38 -07:00
Kartik Agaram
7ea0b5325b 4704 2018-10-16 23:02:57 -07:00
Kartik Agaram
04be5eb2ae 4703 2018-10-16 23:02:42 -07:00
Kartik Agaram
ca5a3fcb12 4702 2018-10-16 00:15:51 -07:00
Kartik Agaram
2c2af7ce60 4701 2018-10-16 00:13:28 -07:00
Kartik Agaram
f613a8bed5 4700 2018-10-16 00:10:15 -07:00
Kartik Agaram
6528a08992 4699 2018-10-14 22:25:57 -07:00
Kartik Agaram
a9a5718d08 4698 2018-10-14 12:53:50 -07:00
Kartik Agaram
0e0a90420e 4697 2018-10-14 00:29:48 -07:00
Kartik Agaram
5d06fe27fb 4696
Update the syntax documentation.
2018-10-14 00:13:41 -07:00
Kartik Agaram
0f851e48aa 4695 2018-10-14 00:00:39 -07:00
Kartik Agaram
06d9b1a541 4694
Check for duplicate docstrings.
2018-10-13 23:55:07 -07:00
Kartik Agaram
dc559a00c7 4693
Add the standard mnemonic for each opcode.

We aren't ever going to have complete docs of the subset of the x86 ISA
we support, so we need to help readers cross-correlate with the complete
docs.
2018-10-13 23:50:10 -07:00
Kartik Agaram
116e7730d7 4692 - update online help for subx
It now includes details for 8-bit registers. And we'll just use the classic
names for the registers so that the relationships between 8- and 32-bit
versions are more obvious.
2018-10-13 23:18:31 -07:00
Kartik Agaram
a8c6eda1cf 4691
All tests now once again run the same natively and on VM.
2018-10-13 21:01:01 -07:00
Kartik Agaram
861418f0dc 4690
Fix a major discrepancy between the SubX VM and real x86 processors. This
was responsible for the breakage identified in commit 4684. We now have
failing tests, but at least they are identical running natively and on
SubX.
2018-10-13 00:21:40 -07:00
Kartik Agaram
6fc975ebcf 4689 2018-10-12 23:45:41 -07:00
Kartik Agaram
222c31db21 4688 2018-10-12 23:41:43 -07:00
Kartik Agaram
01dada15c3 4687 2018-10-12 23:27:26 -07:00
Kartik Agaram
544fbdc6e2 4686 2018-10-12 23:15:34 -07:00
Kartik Agaram
88b478087e 4685 2018-10-12 23:13:15 -07:00
Kartik Agaram
c25d9aa42a 4684
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.
2018-10-11 00:08:50 -07:00
Kartik Agaram
b59b75310a 4683 2018-10-10 22:47:54 -07:00
Kartik Agaram
80b6f47e64 4682 - subx: start testing all layers of 'library' 2018-10-10 22:22:48 -07:00
Kartik Agaram
7c39778633 4681 2018-10-10 21:37:57 -07:00
Kartik Agaram
a0467aa202 4680
Maps have definitely helped with debugging. Even having just the top of
the call stack is very helpful.

We're soon gonna need setup/teardown for tests. I'm not sure how compiling
run-tests will work then.
2018-10-10 21:21:18 -07:00
Kartik Agaram
73a9f0f787 4679 2018-10-10 20:54:36 -07:00
Kartik Agaram
8950915a00 4678
A debugging aid: 'subx --map translate' dumps a mapping from functions
to addresses to a file called "map", and 'subx --map run' loads the mapping
in "map", augmenting debug traces.

Let's see how much this helps. Debugging machine code has been pretty painful
lately.
2018-10-10 20:54:15 -07:00
Kartik Agaram
2a15acd510 4677 2018-10-10 10:20:27 -07:00
Kartik Agaram
8423ad4aca 4676
On second thoughts, let's not use Mu's "null is real hardware" convention
for traces. There's no real difference between a real and fake trace stream,
so we'll just always explicitly pass in *Trace-stream in production code.
2018-10-08 23:10:46 -07:00
Kartik Agaram
47fbf5e3c7 4675 2018-10-08 23:02:58 -07:00
Kartik Agaram
33ad085125 4674
subx: append to trace
2018-10-08 22:50:53 -07:00
Kartik Agaram
399f5c1372 4673
To search for instructions in .subx files, just run `:G 8b.*copy` inside
Vim without any quotes.
2018-10-07 23:19:27 -07:00
Kartik Agaram
857ba19206 4672 2018-10-07 12:45:30 -07:00
Kartik Agaram
143b79b9e4 4671 2018-10-07 12:45:03 -07:00
Kartik Agaram
c9d21799d6 4670 2018-10-05 21:54:08 -07:00