mvk wrote:
Before porting to the Gigatron v6502 as proposed in
this thread, I like to confirm my understanding:
- Is the hardware stack the only usage of page 1? page 1 is reserved for a video table and it will be a great pain to relocate it.
- My stack works in page 0 instead of page 1. Is VTL02 making any assumptions on where the stack dumps its values, or is all through PHA/PLA/JSR/RTS etc.?
- $00-$2f and $80 are reserved ([$80] holding the constant 1, and [$00]=0). If I run the user variables from $81 up, will I get away with it? I suppose ASCII 126 `~' can be a variable name, but ASCII 127 `DEL' won't? (*)
- I plan to run the stack from $7F down. Any VTL02 zero page variables then go from $30 up. Will that work?
- I have to learn a new assembler. Unless there's a ca65 version for VTL02C available somewhere already. Am I lucky?
- Any other advice before the journey begins?
(*) $FF:$00 can still act as a pointer variable into zero page, and $7F:$80 can act as a pointer in page 1. I don't know if that's useful.
VTL02C needs 1KB of "ROM", exactly 128 bytes of page zero, about 128 bytes of stack and about 128 bytes of page 2. The stack is only accessed with PHA/PLA/PHP/PLP/JSR/RTS.
The subroutine convp: maps the ASCII value of each variable name to two consecutive bytes of zero page, and there are exactly 64 unique variables. Variable names with ASCII values of $20 to $5F fill up that space, so the use of control characters and "lower-case" letters for variable names will not be rejected by convp: but will quickly foul up the works ... long story short ... I don't recommend using '~' or DEL.
Since the line editor is the largest consumer of the stack and the line buffer is the only consumer of page 2, if you limit your input lines to 80 chars (or any other number < 128), stack usage and page 2 usage will be reduced accordingly.
Klaus2m5 has successfully ported VTL02 to a couple of different assemblers and environments
here, making him the resident expert on the subject.
Quote:
For completeness, this is my memory map:
Code:
0 1 47 48 127 128 129 (vSP) 255
+-+-------------+-----------+-+-------------+--------------+
page 0 |0| System vars | User vars |1| User vars <-| Stack/Loader |
+-+-------------+-----------+-+------+------+--+-----------+
page 1 | Video table | vReset | Channel 1 |
+------------------------------------+---------+-----------+
page 2 |0 239 240 249| Channel 2 |
| +-----------+
page 3 | User vCPU code and/or data | Channel 3 |
| +-----------+
page 4 | | Channel 4 |
| +-----------+
page 5-6 | 250 255|
| |
| |
+----------------------------------------------------------+
page 7 | Sound tables |
+--------------------------------+-------------------------+
page 8-127 |0 159|160 255|
| 120 lines of 160 pixels | Extra space for user |
| Default video memory | code and/or data |
= = =
| | |
+--------------------------------+-------------------------+
page 128-255 | Not used in the 32K system: mirror of page 0-127 |
+----------------------------------------------------------+
0 255
I haven't decided yet where I will put the interpreter and user code. In fact I might borrow some from screen memory, because I'll need to do something similar with MS BASIC later on.
_________________
Got a kilobyte lying fallow in your 65xx's memory map? Sprinkle some
VTL02C on it and see how it grows on you!
Mike B.
(about me) (learning how to github)