I have an MCODE program that will switch between the two memory banks of my NoV-32 by writing either h0FF or h000 into the address 4100. According to the David Assembler manual, I can use WRITE S&X (called WROM on the overlay [SHIFT+SIN]) - the opcode being h040 - but it doesn't work - it freezes the calc (the display goes blank except for the USER annunciator). Pointers anyone?
MCODE: NoV-32: WROM/WRITE S&X/040 to address 4100
|
|
« Next Oldest | Next Newest »
|
▼ ▼
Post: #8
03-17-2008, 07:52 PM
Hi, you're simply sewing the wood branch you're sitting on;-)
I assume your code resides somewhere in the NoVRAM,
Workaround: Use a dock location which doesn't switch, HTH Raymond ▼
Post: #9
03-18-2008, 05:25 PM
Quote: Ah, obviously. Thanks.
Quote: How do I do this?
Quote: ... and how could this be done? ▼
Post: #10
03-20-2008, 04:28 AM
A principal solution was posted by 'DavidMY' here,
AFAIK the DA doesn't include a command to write to ROM in batch mode,
But you could easily write your own ROM which could include the suitable keyword(s). HTH Raymond ▼
Post: #11
03-21-2008, 11:30 PM
Of course you are right Raymond. While typing my comment I was looking up at the shelf with my 41 documentation and my manual for the David Assembler was right next to my CCD manual. And, of course, it's the CCD rom that has peek and poke. In my defense I haven't done any 41 code for a while [actually quite a while] due to my real job designing and installing office networks. Come to think, I can't even remember if the various peek and poke commands in several roms allow poking to Rom addresses [and since I'm on a job I can't check a manual]. Writing an mcode routine to poke the address and mapping to the same address in both banks is probably the best way.
Post: #12
03-18-2008, 06:43 PM
Geir: Traditionally, when paging was done for a CPU that didn't support this action with CPU hardware registers and didn't have "fixed" external memory locations the trick was to locate the "switch" code at the same memory location in both banks. Actually, this trick is already used with the 41: if you follow the bank switch code for the HexPac module you will see that the same location (at the end of the module's space) is called to overlay the rom banks. So, if you want to use an exclusively machine coded solution (and assuming your machine code routine starts at 6100h in the first bank --place the same code in the second bank at 6100h. Since the code--after--the instruction loading the 4000h location is the same the routine finishes and returns. Done correctly [test the 4000h location first] and you can have a routine that acts as a toggle. Also, note that because the return stack is part of the CPU registers you will return to the same address in either bank, but the code THERE doesn't need to be the same. DavidMY |