Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

bank switching words?

206 views
Skip to first unread message

Mux

unread,
Aug 29, 2015, 2:46:09 PM8/29/15
to
Hi All,

Anyone have any suggestions for words that handle bank-switching? Basically I have 3 regions (region #0 is locked) that can be switched out and I'm trying to come up with words that make it easy to understand. Right now it's just a poke into a memory register which, while fine, isn't ideal. I've decoupled IO and memory access so there's that distinction, but still..

Also, a quick search on clf didn't really yield a lot about bank switching which is probably because forth programs themselves tend to be small. That said, once you start adding graphics / audio, it gets gobbled up quickly...

Thoughts?

-Y

Mark Wills

unread,
Aug 30, 2015, 2:23:52 PM8/30/15
to
I use SETBANK because I can map up to 1024K in 4K chunks.

Maybe this will give you some inspiration: http://turboforth.net/resources/sams.html

HTH

Mux

unread,
Sep 2, 2015, 1:59:03 PM9/2/15
to
Interesting! Thanks for sharing!

-Y

Marcos Cruz

unread,
Sep 6, 2015, 1:38:17 PM9/6/15
to
En/Je/On 2015-08-29, Mux <Yvo....@gmail.com> escribi'o/skribis/wrote:

> Anyone have any suggestions for words that handle bank-switching?

I use simply `bank`:

bank ( n -- )

Page memory bank _n_ (0..7) in at 0xC000..0xFFFF.

Regards,

--
Marcos Cruz
http://programandala.net

Marcos Cruz

unread,
Sep 6, 2015, 2:17:55 PM9/6/15
to
En/Je/On 2015-08-30, Mark Wills <markwi...@gmail.com>
escribió/skribis/wrote:

> Maybe this will give you some inspiration:
> http://turboforth.net/resources/sams.html

Mark, that is great.

In a Forth for ZX Spectrum 128, I store the name fields in a separate 16
KiB memory bank, with an additional field that links every nfa to its
cfa in main memory. That saves a lot of dictionary space (c. 3 KiB on
the bare unexpanded system) and makes name lengths unimportant. By
design, no field links the main headers to their name fields, what saves
2 bytes per word in the main memory. Therefore `cfa>nfa` and others do
a brute force search, checking the pointers that link every name field
with its code field, but that's not a problem.

The way TurboForth words can be compiled in different memory banks
transparently is a great idea. I'll think about it. It could be useful
to compile the Z80 assembler permanently without wasting memory, instead
of using the usual tricks to compile it at a different location and then
disconnect it from the dictionary.

Mux

unread,
Sep 8, 2015, 12:40:35 AM9/8/15
to
> I use simply `bank`:
>
> bank ( n -- )
>
> Page memory bank _n_ (0..7) in at 0xC000..0xFFFF.
>

I like that one :-) Thanks for chiming in!

-Mux

Whammo

unread,
Sep 9, 2015, 11:00:25 PM9/9/15
to
Why the need for words to bank switch?
What's wrong with?

: bank abcd ; (whatever the address)
0 bank c@



Gerry Jackson

unread,
Sep 13, 2015, 4:26:31 PM9/13/15
to
Try looking at http://www.forth.org/fd/FD-V12N1.pdf page23

--
Gerry
0 new messages