Commit Graph

63 Commits

Author SHA1 Message Date
Kartik Agaram
84aa2fad2d .
Fix infinite loop in the 2 remaining failing tests; now it's a segfault.
2019-07-10 09:39:38 -07:00
Kartik Agaram
7e9cdf3c7a . 2019-07-10 09:35:24 -07:00
Kartik Agaram
48aabc860a mostly done with emit-output
Some nooks and crannies will need light final debugging with xxd, but
emit-hex-output covers most of the logic.
2019-07-09 23:41:32 -07:00
Kartik Agaram
20a527702b done with emit-segments
Only failures now are the first two tests in survey.subx.
2019-07-09 22:11:44 -07:00
Kartik Agaram
7bc9240c3c . 2019-07-09 17:50:22 -07:00
Kartik Agaram
4a739023d9 . 2019-07-09 17:41:52 -07:00
Kartik Agaram
c7564b7688 . 2019-07-09 16:55:57 -07:00
Kartik Agaram
b14457a4cb . 2019-07-09 16:55:57 -07:00
Kartik Agaram
5821a0f612 clean up after a few calls 2019-07-09 16:55:55 -07:00
Kartik Agaram
f6ea25613f preserve truthiness of non-booleans
Everywhere we check if something is true, we check it by comparing
against 0, not 1.
2019-07-09 16:55:37 -07:00
Kartik Agaram
7a752f8d3d this looks like a bug
But of course the test is still infinite-looping so we can't be sure.
I'm still just reading the code.
2019-07-09 16:55:13 -07:00
Kartik Agaram
ca32bfbed8 . 2019-07-09 16:54:48 -07:00
Kartik Agaram
d6c6aebef4 . 2019-07-09 16:37:01 -07:00
Kartik Agaram
ba93234603 move 'segment-start' to a global variable as well
It's ugly to have function locals in global variables, but we'll figure
out later how to deal with it.
2019-07-09 16:32:06 -07:00
Kartik Agaram
eb4b45db40 . 2019-07-09 16:27:48 -07:00
Kartik Agaram
dc7066c7bf there's a variant of compute-width for slices
Looks like the original compute-width is now dead. But still seems
useful to have around.
2019-07-09 16:25:31 -07:00
Kartik Agaram
acc83b644b there's a variant of get-or-insert for slices
The compute-offsets test now goes into an infinite loop :( But I figure
all these changes are useful anyway, we should just debug the error
separately.
2019-07-09 16:23:14 -07:00
Kartik Agaram
b8b92251e9 keep labels definitions on a separate line
SubX in SubX doesn't support mixing labels with other stuff :)
2019-07-09 16:02:00 -07:00
Kartik Agaram
7761194ec1 switch to global Heap 2019-07-09 16:00:55 -07:00
Kartik Agaram
476049a09d .
Be more consistent about names of ends of a slice.
(In the opposite direction compared to last night's 925fc490d2ce8b8d411de87bd0af5b3a8a704213.)
2019-07-08 17:02:09 -07:00
Kartik Agaram
b5da792904 .
minor style tweaks
2019-07-08 16:43:35 -07:00
Kartik Agaram
01b45300ed colocate compute-offsets with its globals 2019-07-08 16:38:32 -07:00
Kartik Agaram
925fc490d2 .
Be more consistent about names of ends of a slice.
2019-07-08 01:05:23 -07:00
Kartik Agaram
597ce7a943 . 2019-07-08 00:17:42 -07:00
Kartik Agaram
195d62f167 build num-bytes 2019-07-07 23:56:23 -07:00
Kartik Agaram
c38b36e260 move is-label? to subx-common 2019-07-07 22:49:04 -07:00
nc
c0a904382b made first compute-offset test pass 2019-07-07 21:19:50 -04:00
nc
c17643b7a8 remove segfaults in survey.subx 2019-07-07 19:41:26 -04:00
Kartik Agaram
fb8474af88 new failing test: emit-segments
Now the only piece I plan to not write tests for is emit-headers.
2019-07-07 13:19:51 -07:00
Kartik Agaram
633c289f30 . 2019-07-07 13:13:38 -07:00
Kartik Agaram
764b5726df move phase 3 out of helpers 2019-07-07 13:13:38 -07:00
nc
b95060262e cleanup in compute-offset and fix bug in compute-width 2019-07-07 15:39:35 -04:00
nc
9ac5834194 more progress in compute-offset 2019-07-04 22:59:15 -04:00
nc
f80a025e52 implement segment section in compute-offsets 2019-07-04 12:21:41 -04:00
Kartik Agaram
c015791e80 .
Fix a couple of syntax errors.

survey.subx still failing tests.
2019-07-04 00:02:53 -07:00
nc
d818fdd7e5 add todo for section thats not quite complete 2019-07-03 23:04:24 -04:00
nc
98096ca81e add is-label block 2019-07-03 23:02:14 -04:00
nc
87ef858628 updates to survey - part of compute-offsets implemented 2019-07-03 22:39:47 -04:00
Kartik Agaram
34cf8a7034 subx/survey: now computing label addresses 2019-07-02 14:24:44 -07:00
Kartik Agaram
7895d0a480 .
subx/survey/compute-addresses: Now computing segment starting addresses
correctly.
2019-07-02 13:45:48 -07:00
Kartik Agaram
9d5ba2dfbf . 2019-07-02 00:16:23 -07:00
Kartik Agaram
dc8484384e . 2019-07-02 00:14:03 -07:00
Kartik Agaram
1c576e99d7 error in pseudocode for compute-offsets 2019-07-02 00:00:58 -07:00
Kartik Agaram
13be43dff9 .
Now tracing segment names correctly.
2019-07-01 23:46:22 -07:00
Kartik Agaram
22cea315f5 . 2019-07-01 23:29:14 -07:00
Kartik Agaram
0e510776d3 . 2019-07-01 23:24:45 -07:00
Kartik Agaram
065b82af2e .
Make `compute-addresses` less clever. Stop striding from the middle of
one row to the next. This way we'll also obviate the need for indexing
backwards from a pointer in the next commit.
2019-07-01 23:09:58 -07:00
Kartik Agaram
120a740871 some primitives for emitting traces
Kinda hacky, but might scale enough for machine code.

This was really hard to debug. Single tests passed, but when I ran all
tests I got breakage because tests long before (from the 056trace layer)
were not cleaning up properly.

My instinct was to call clear-stream on Trace-stream, which was wrong
(the trace didn't have the wrong contents, it was literally a bad
object). It was also wrong in a counter-productive way: calling
clear-stream on a real Trace stream (which is the size of a page of
memory) takes a long time in emulated mode.
2019-07-01 23:09:58 -07:00
nc
676a80bf15 add test data 2019-06-29 18:03:56 -04:00
nc
0721fb5891 Implement is-label? 2019-06-29 17:59:14 -04:00