The Museum of HP Calculators

HP Forum Archive 18

[ Return to Index | Top of Index ]

MCODE: NoV-32: WROM/WRITE S&X/040 to address 4100
Message #1 Posted by Geir Isene on 17 Mar 2008, 5:43 p.m.

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?

      
Re: MCODE: NoV-32: WROM/WRITE S&X/040 to address 4100
Message #2 Posted by Raymond Del Tondo on 17 Mar 2008, 7:52 p.m.,
in response to message #1 by Geir Isene

Hi,

you're simply sewing the wood branch you're sitting on;-)

I assume your code resides somewhere in the NoVRAM,
and then you switch it away while running it...

Workaround: Use a dock location which doesn't switch,
or switch using a FOCAL program.

HTH

Raymond

            
Re: MCODE: NoV-32: WROM/WRITE S&X/040 to address 4100
Message #3 Posted by Geir Isene on 18 Mar 2008, 5:25 p.m.,
in response to message #2 by Raymond Del Tondo

Quote:
Hi,

you're simply sewing the wood branch you're sitting on;-)

I assume your code resides somewhere in the NoVRAM,
and then you switch it away while running it...


Ah, obviously. Thanks.

Quote:
Workaround: Use a dock location which doesn't switch,

How do I do this?

Quote:
or switch using a FOCAL program.

... and how could this be done?

                  
Re: MCODE: NoV-32: WROM/WRITE S&X/040 to address 4100
Message #4 Posted by Raymond Del Tondo on 20 Mar 2008, 4:28 a.m.,
in response to message #3 by Geir Isene

A principal solution was posted by 'DavidMY' here,
I'd like to add the following:

AFAIK the DA doesn't include a command to write to ROM in batch mode,
as the ASSM keyword always invokes the interactive assembly mode.
Maybe he meant the 'Assembler 3' ROM, which includes keywords
for writing to Pseudo-ROM devices (like X>ROM or similar).

But you could easily write your own ROM which could include the suitable keyword(s).
Given you have a copy of your ROM in both banks,
this keyword can then be called from a FOCAL program.

HTH

Raymond

                        
Oops!
Message #5 Posted by Davidmy on 21 Mar 2008, 11:30 p.m.,
in response to message #4 by Raymond Del Tondo

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.

      
Re: MCODE: NoV-32: WROM/WRITE S&X/040 to address 4100
Message #6 Posted by DavidMY on 18 Mar 2008, 6:43 p.m.,
in response to message #1 by Geir Isene

Geir: To access the memory location from a user program (i.e. FOCAL) you would need to have available the "poke" command. The David Assembler should have it available. Of course, if you have the above loaded into the NoV32 rather than the actual module you will need the code in BOTH banks in the same [virtual] port.

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


[ Return to Index | Top of Index ]

Go back to the main exhibit hall