-
Notifications
You must be signed in to change notification settings - Fork 0
/
TODO
45 lines (34 loc) · 2.12 KB
/
TODO
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
* implement proper input buffer/prompt
* implement if/else/then to also work in interp mode -- see [IF] etc in spec
* maybe add another flag to say "is only available in interpret state" etc
* maybe add another flag to say "can't be postponed or [compiled]" ala TO
* debug primitives -- WORDS, DUMP, { => }, etc
* proper test suite built around ASSERT
* add a number-of-cells field to dictentry and hook everything up to know about it.
* actually hook up the memory stuff. this is going to require shifting to a function lookup table
approach, because all of the user-defined xt's will change if the realloc moves the memory area.
* actually nuke it
* add FORGET
* merge main.c and vm.c
* tidy a bunch of the headers into a types.h for less #include drama
* EVALUATE/QUIT -- can also use this mechanism for file i/o, #include-ish stuff, etc, i think
memory sizes:
4mb of ram in ds
dictionary entry is 44bytes + data
=> absolute maximum entries that fit into memory is 4m / 44 is 95325 if NONE have any data
=> largest feasible number of dictionary entries 64k assuming average 5 cells of data each
ad'ble addr eff min 64k xt 32k xt
align loc'ns size size tbl mem tbl mem
4 1M 20 bits 44B 160K 80K
16 256K 18 bits 48B 144K 72K
64 64K 16 bits 64B 128K 64K
but! if i have 64 byte alignment of dictionary entries, for a maximum of 65536 possible
addressable dictionary entries, then I can address the entirety of ram using 16 bits, which means
i don't need an XT lookup table at all, an XT is simply 1/64 addr/64. to execute an xt, simply
multiply it by 64, add the start of memory offset, and call the DE at that address.
but! if i don't need an XT lookup table then there's also no necessity for an XT to be small,
because it's still going to be occupying a whole cell in the callers data region anyway. so an XT
can simply remain a normal pointer to the code field.
I don't need to store the XT in the dictionary entry itself. i only thought this was necessary
when i anticipated using an xt lookup table, and needed a sane way to work out the xt later on
when compiling new words.