Replies: 15 comments 28 replies
-
Ed. Just sad... |
Beta Was this translation helpful? Give feedback.
-
This could also be accomplished perhaps more simply by masking IRQ's while accessing dictionary under i/o, and only dealing with NMI's. Indeed a simpler prospect! |
Beta Was this translation helpful? Give feedback.
-
Is 4k suitable as a hard limit for dictionary size? Ed. non-issue It seems the safest and simplest way to access data in the RAM under I/O is under IRQ. Ed. perhaps... Actually executing code there is a bit more. Ed. not in the plan |
Beta Was this translation helpful? Give feedback.
-
So, I was watching this guy: https://www.youtube.com/watch?v=xoyDNIcnpgc&t=9051s Three arrays, RAM under I/O 455 bytes as nibbles for 910 attributes |
Beta Was this translation helpful? Give feedback.
-
There are many interesting implications to storing the components of dictionary entries in separate arrays. |
Beta Was this translation helpful? Give feedback.
-
Words with the transitory attribute bit set, will return memory amount requested from the execution token array |
Beta Was this translation helpful? Give feedback.
-
If you want to put together a design document for a new dictionary, maybe start compiling it in a gist. |
Beta Was this translation helpful? Give feedback.
-
I reckon it starts interpreting what's in the buffer when it receives a CR. |
Beta Was this translation helpful? Give feedback.
-
Could it be so simple? interpret_loop
jsr io-io
jsr REFILL
jsr ram-io
jsr interpret_tib
jmp interpret_loop
........
EXECUTE
jsr io-io ; would have been fun though!
lda LSB, x
sta W
lda MSB, x
sta W + 1
inx
jmp (W) |
Beta Was this translation helpful? Give feedback.
-
.on_stack_underflow and .on_data_underflow will cause chaos if io is out of context PUTCHR
pha
jsr io-io
pla
; jsr chrout <-------- OMG! Did I just do this?
; rts
jmp chrout <---------Better!
Loading PUTCHR in this manner, would only be for swapping i/o in on errors, would use CHROUT outside of the interpreter loop. +BACKLINK "page", 4
PAGE
lda #K_CLRSCR
jmp PUTCHR
+BACKLINK "rvs", 3
RVS ; ( -- ) invert text output
lda #$12
jmp CHROUT |
Beta Was this translation helpful? Give feedback.
-
The dictionary will be fine if it goes over 4k. Arrays are down the road, if ever. I should be able to pull this off without adding another page of memory... !set WORDLIST_BASE = $dfff |
Beta Was this translation helpful? Give feedback.
-
I may be able to add some perspective and experience to this thread, from the "large" C16 version of the C64 flavour of VolksForth](https://github.com/forth-ev/VolksForth/tree/master/6502/C64) which I maintain. The "large" in the C16 version means large memory. It makes the full range from $1001 to $FD00 available for Forth, with the Kernal and Basic ROM ($8000-$FFFF) being switched off. They are only switched on, via a bank-switching-wrapped JSR, for Kernal calls (typically I/O), and the same is done for IRQ where the vector in RAM points to a bank-switching IRQ handler which switches on the ROM, calls the IRQ handler there, and then switches back to RAM. In essence, the default state is all RAM, and only for Kernal calls is the ROM switched on. I haven't created a similar C64 version yet because it wasn't needed yet (the C16 without this scheme would only have RAM from $1001 to $8000), but since this works flawlessly on the C16, I don't see why it shouldn't work on the C64, too, and probably for DurexForth just as well as for VolksForth. |
Beta Was this translation helpful? Give feedback.
-
There is some precedent in using memory in "odd" addresses, as you are aware, this is done for bitmap graphics too (the bitmap is placed under Kernal ROM) For graphics, it's not so bad, because the bank switching only needs to be done in a few places. For the dictionary, I suspect there is a good number more words that would need to bank switch, but I am not 100% sure. |
Beta Was this translation helpful? Give feedback.
-
Solution looking for a problem mode here! Several core operations could be converted to lookup tables. CHAR_TO_LOWERCASE - called once per character in HEADER, FIND_NAME and READ_NUMBER. That includes every interpreted word. Current size: 28 bytes, runtime: 12+2=14 or 12+10+2=24 cycles, not counting the return. Replacement cost: 3 fills for setup, then one table lookup. Table size: 256 bytes. READ_NUMBER core loop - not only calls CHAR_TO_LOWERCASE, it then does the digit translation. This could also be put in a table. Setup cost: one fill, two sequential writes (the lowercase table could be folded in). Table size: 256 or 128 bytes. Name lookup: The hash table I prototyped in #428 could be applied. Perhaps even once per word-list, if we implement search-order. Table size: preferably 512 bytes, could be smaller (initial test used 256). Cost of a table lookup into the $d000 memory: Mapping that RAM, as kernal-in/out twice, 2*6 cycles, 10 bytes. Cost of a lookup: 3 bytes, 4 cycles, not counting the work to put the entry into X or Y. To have an advantage we'd need to move the mapping step outside of the loops. Of course, we could start simpler and use main RAM to see how much a performance gain we'd get. I think the rational next step is a profiler in Vice, to measure where the most time is actually spent during compilation. PS: An initial test of a table based lowercase routine showed no appreciable difference in the time to compile v, so the profiling is needed. |
Beta Was this translation helpful? Give feedback.
-
How about a word |
Beta Was this translation helpful? Give feedback.
-
A nice chunk of memory just lying fallow. It is a bit of trouble to use.
There is no memory configuration where it is accessible, and the Kernal at the same time.
It would require placing interrupt vectors in RAM underneath the Kernal, six bytes at the end of memory.Although RAM under the Kernal is reserved for the hires screen.
I'm thinking
$d000$DFFF might be a good place for the dictionary.Some fiddling with the interrupts. and I think it is doable.
Ed. Just disable IRQ.
Beta Was this translation helpful? Give feedback.
All reactions