Commit Graph

4853 Commits

Author SHA1 Message Date
Kartik Agaram d1e5e391c7 4788 2018-11-27 12:06:08 -08:00
Kartik Agaram 2131b055f5 4787 2018-11-27 12:04:53 -08:00
Kartik Agaram 71d7081a7c 4786 2018-11-26 01:43:48 -08:00
Kartik Agaram 116c41add4 4785 2018-11-26 01:42:51 -08:00
Kartik Agaram 3b6fcde4f9 4784 2018-11-26 01:26:31 -08:00
Kartik Agaram 063741b4a2 4783 2018-11-26 01:22:50 -08:00
Kartik Agaram d1c9392a54 4782 2018-11-26 01:19:47 -08:00
Kartik Agaram 7e00968c99 4781 2018-11-26 00:56:43 -08:00
Kartik Agaram e5cbbea435 4780 2018-11-26 00:26:20 -08:00
Kartik Agaram c1a3d36cad 4779 2018-11-26 00:26:09 -08:00
Kartik Agaram f362a0cb09 4778 - entirely rewritten Readme 2018-11-25 23:42:20 -08:00
Kartik Agaram f15fcfe822 4777 2018-11-25 14:06:22 -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
Kartik Agaram 31ff94214b 4774
Simplification.
2018-11-24 23:14:21 -08:00
Kartik Agaram 732cf4e7cc 4773 - done with crenshaw chapter 2-1
In the process I had to fix a couple more bugs in support for disp16 instructions.
2018-11-24 23:06:55 -08:00
Kartik Agaram a8f47b4a64 4772 2018-11-24 22:42:02 -08:00
Kartik Agaram 3c46d5a221 4771
I stopped handling disp16 at some point, and using instructions with such
an operand messes up segment alignment when generating ELF binaries.

I don't test my ELF generation. This is a sign that maybe I should start.
2018-11-24 20:53:50 -08:00
Kartik Agaram ba196240ff 4770 2018-11-24 20:25:54 -08:00
Kartik Agaram 4aff81ec03 4769 2018-11-24 19:55:59 -08:00
Kartik Agaram 5f6edeea51 4768 2018-11-24 15:06:35 -08:00
Kartik Agaram d9820d82f8 4767 2018-11-24 13:21:33 -08:00
Kartik Agaram 9f3c5187b2 4766 2018-11-24 12:54:39 -08:00
Kartik Agaram 9fa3f5dc4e 4765 2018-11-23 16:21:04 -08:00
Kartik Agaram e345224833 4764 2018-11-23 16:19:06 -08:00
Kartik Agaram d373c008b3 4763 - back to the 'trivial' crenshaw2-1 compiler
This time I've ported (and test-driven) 'GetChar' and 'GetNum'. The new
tests bring together our new testable interfaces for read() and exit().
2018-11-23 00:42:30 -08:00
Kartik Agaram 886630e937 4762 2018-11-23 00:23:23 -08:00
Kartik Agaram 4a99a6e0dd 4761
Bugfix: I forgot about ELF segment offsets when implementing VMAs. Eventually
segments grew large enough that I started seeing overlaps.
2018-11-23 00:22:24 -08:00
Kartik Agaram 6ee77ba7bb 4760 2018-11-21 22:25:26 -08:00
Kartik Agaram 4e647f4f21 4759 2018-11-20 23:18:49 -08:00
Kartik Agaram 1bd60d9f31 4758 2018-11-20 19:58:41 -08:00
Kartik Agaram e59a91b73d 4757
Let's start highlighting all global variables in Red. Assembly programming
has a tendency to over-use them. They're a necessary evil, but we should
minimize the number of functions that access them.
2018-11-20 19:43:36 -08:00
Kartik Agaram fa04aebdc2 4756
Long-standing and long-copied typo has been messing with our exit status
on test failures.
2018-11-19 23:34:20 -08:00
Kartik Agaram bd6f1928d7 4755 - read-byte (sometimes called getchar) 2018-11-19 23:11:00 -08:00
Kartik Agaram a6061b9fd2 4754 - allow data segment to refer to variables 2018-11-19 21:17:48 -08:00
Kartik Agaram e3c331d0a6 4753 2018-11-19 14:12:52 -08:00
Kartik Agaram 565156761c 4752 2018-11-18 13:52:31 -08:00
Kartik Agaram 674cf5833c 4751 2018-11-18 13:28:42 -08:00
Kartik Agaram bfe9fa117e 4750
There can be situations where a run is striding through a segment. Reduce
the number of reallocations that reallocations that requires.
2018-11-18 10:13:04 -08:00
Kartik Agaram cfaac2a8ab 4749 - speed up tests
When we implemented 'read' our apps went over 0x1000 bytes, so I grew the
initial segment size. But that slowed down emulation because each test
was reallocating all segments. Now we allocate small segments at the start,
and grow them gradually as needed.
2018-11-18 10:05:30 -08:00
Kartik Agaram 69c0648e84 4748
Fix CI.
2018-11-18 08:18:12 -08:00
Kartik Agaram b31455f81d 4747 - subx: 'read' primitive 2018-11-18 00:17:29 -08:00
Kartik Agaram 3d9108130f 4746 2018-11-17 23:36:32 -08:00
Kartik Agaram 267fd885b2 4745 2018-11-17 20:45:22 -08:00
Kartik Agaram 95decf9f34 4744 2018-11-17 20:45:15 -08:00
Kartik Agaram 11a5fffade 4743 2018-11-12 22:00:51 -08:00
Kartik Agaram 0fe9e7b9dc 4742 2018-11-05 22:43:28 -08:00
Kartik Agaram 8b0e960dbb 4741
Extract a helper that we'll need for 'read'.
2018-10-30 23:10:49 -07:00
Kartik Agaram b3d8c144a4 4740 2018-10-30 22:46:05 -07:00
Kartik Agaram 2f55dd757e 4739 2018-10-30 22:38:37 -07:00