W&W RAMBOX II emulation



#12

Hello hardware and software emulation enthusiastics:

I worked on RAMBOX II emulation, at the request of a serious user who needs to find a backup solution for his 64k application in his tired HP-41CY.
The information reported here may help others involved in emulation.

I remind you that the RAMBOX II offers two 32k blocs that I will call block A and block B.
The RAMBOX II OS provides 3 keywords to manage the blocks:

PG<>: swap the two 32k blocks,
PG01: enable the even pages from block A and odd pages from block B
PG10: enable the odd pages from block A and even pages from block B

Looking at the Mcode of these functions shows that there are very simple.
They use the famous ENBANK1, ENBANK2 and ENBANK3 opcodes. They act in a special way,
different from the usual operation found the Advantage, Hepax, internal CX or Zeprom modules.
Remember that these opcodes are nops for the CPU, they are decoded by the module itself.

Code for PG01 and PG10 are:

; PG01
8DC3 100 ENBANK1
8DC4 180 ENBANK2
8DC5 3E0 RTN
; PG10
8DCA 100 ENBANK1
8DCB 140 ENBANK3
8DCC 3E0 RTN

The problem that worried me is how the PG<> could *swap* the pages with a combination of the same ENBANKx opcodes.

The light came from a post from Mike http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/archv013.cgi?read=47293
(Thanks Mike!) who highlighted the differences between the 2 copies of the RAMBOX II OS normally found in each first page of the two 32k blocks.

In "RAMBOX 64a" found in block A, PG<> is:
8DBC 180 ENBANK2
8DBD 140 ENBANK3
8DBE 3E0 RTN
In "RAMBOX 64b" found in block B, PG<> is:
8DBC 04E C=0 ALL
8DBD 100 ENBANK1
8DBE 3E0 RTN
The two PG<> functions are actually two different functions:
the one in block A enables block B, and the one in block B enables block A!
The PG<> effect is actually to swap blocks, because it will always enable the opposite block.

Finally, here are the actual effects of each ENBANKx opcodes to the RAMBOX pages:

ENBANK1: reset all pages to block A
ENBANK2: enable odd pages of block B
ENBANK3: enable even pages of block B

RAMBOX II emulation will be available soon in Emu41. I hope that the information will also be helpful
to the many emulation (hardware or software) projects that are on going.

As a HP-71B fan and the author of one of the only two known HP-71B emulators (the other one is from HrastProgrammer),
my only wish would be to see such projets for this great machine.

Just imagine a CLONIX module for the HP-71B!

Best Regards.

Jean-Francois


#13

Hi,

A really nice job Jean!!, I've found it extremely interesting for my projects, (mainly for the NoVRAM 2004), as well as for the "peculiar" behavior observed in the Clonix when loaded with the RAM-Box image. As RAM-Box does not use the "standard" BankSwitching scheme, this explains the difficulties in making PG<> fully operative. I'll have to take acloser look at the M-code to replicate its unique BankSwitch craracteristics in a dedicated Clonix code. It will take little longer though :-(

Regarding a so called Clonix 71, I'm confident it's feasible, provided there is enough interest on the subject in the HP fans community. Anyhow, first things first, and for now my focus is in the HP-41 modules solutions.

Again thanks and my congratulation on a well done job.

Cheers.

Diego.

#14

JF,

For my understanding, the pages that contain the ENBANKx instructions, are they RAM? I have found a way to do a certain way of bankswitching in my MLDL2000 if the page of the module is fixed.

Since you have studied this in more detail, is it OK to assume (for my MLDL2000) that the WROM instruction can ignore the current bank?

Meindert

#15

Hello J-F,

Nice work ...

I already emulated W&W RAMBOX on HP-41X in an advanced form with 3 x 32K banks (=96K total port memory) and some new bank-switching opcodes:

ENBANK0 (#100): Initialize RAMBOX, load A8 .. A15 to port memory (pages 8 .. 15) - as in W&W RAMBOX
ENBANK1 (#180): Load B9, B11, B13, B15 to port memory (pages 9, 11, 13 and 15) - as in W&W RAMBOX
ENBANK2 (#140): Load B8, B10, B12, B14 to port memory (pages 8, 10, 12 and 14) - as in W&W RAMBOX
ENBANK3 (#1C0): Disable RAMBOX, load P8 .. P15 to port memory (pages 8 .. 15)

EXBANK8 (#1C8): Exchange current bank on page 8 with the regular port P8
EXBANK9 (#1CC): Exchange current bank on page 9 with the regular port P9
EXBANK10 (#1D4): Exchange current bank on page 10 with the regular port P10
EXBANK11 (#1DC): Exchange current bank on page 11 with the regular port P11
EXBANK12 (#1EC): Exchange current bank on page 12 with the regular port P12
EXBANK13 (#1F4): Exchange current bank on page 13 with the regular port P13
EXBANK14 (#1FC): Exchange current bank on page 14 with the regular port P14
EXBANK15 (#218): Exchange current bank on page 15 with the regular port P15

And here are the latest news: I finished HP-IL emulation for HP-41X ... currently doing some final tests ...

Best regards.

HrastProgrammer


#16

Hi Hrast,

FYI, some of these opcodes are actually used in the NUT CPU. In particular, #1C8, #1CC, #1D4, #1DC and #218 are not NOPs, even though they are poorly documented. See Appendix XI in "Inside the HP-41" for the details. Of course it doesn't matter in the case of an emulator, but care should be exercised if using them on actual hardware. My reverse-engineered version of the NUT CPU implements them just like the original hardware.

Best regards,
Monte


#17

I know that (from "Inside the HP-41", of course) but they are used only inside the CPU and don't have too much sense (and use) outside. BTW, implementation of "switchable" carry flag would seriously slow down the emulator on HP-48/49.

Regards.


#18

I mostly made the comment for anyone who might use these opcodes in this fashion outside of an emulator. Also, I am pretty sure that the "switchable" part of the carry flag is only relative to the SF, CF and ?FS instructions. The reason that I say this is that the carry is tested twice in the Master Control Program before the ENF14 instruction is actually executed there.

Regards,
Monte

#19

Hello JF!

Do you have a HP-41CY at hand? At the Allschwil meeting I remarked that mine is out of order (had no time yet to care for it [neither for many eMails in my inBox - sorry Christoph, sorry Tony, sorry Claudia, sorry Nathalie]), so the following is from my bad memory: If you set "block A" by PG01, PG10 will change all pages ("block B") but _not_ PG<>. This will only swap every second page. This is from the users' point of view.

OTOHS, a user using *only* PG<> will see a complete swap of all pages. This complies with your findings.

With the emulation of RAMBOX II you are one more step ahead of me. Congratulation! The last weeks I spent some time on "Hercules", with success. Now I am able to continue work on NutEm at home (when I have a new hard disk <G>).

Ciao.....Mike

Edited: 16 Dec 2003, 11:13 a.m.


#20

Hi Mike,

Yes, I have a CY at hand, but only for a while. This machine exhibits some problem in block B, and is no more reliable. His owner asked me to try to fix it, and I took the opportunity to study it.

I was unable to fix the internal CY problem. It seems that writing in blok B is no more reliable. Moreover, the machine freezes at the keystroke when in normal speed with block B enabled (runs properly in high speed, except the mentionned writing problem).

Does someone can give advice? I suspected a bad connection/soldering and I opened the machine, and was horrified by the flying wiring of the 2 XMEM modules... So I didn't take the risk to desassemble/dessolder any thing else.

J-F


#21

Hi Jean-Francois,

that’s great news on your emulation of the W&W-RAMbox II ! I appreciate this very much as then I can get a perfect and ultra-fast image of my HP-41CY at the PC. Thanks to your efforts!

Concerning your problems with the HP-41CY you have just at hand, are you absolutely sure that it is a hardware defect ? Of course a bad connection/soldering is a reasonable explanation for the unreliable behaviour.

Nevertheless, if not already done, before I would really check if there is no remaining “ill“ soft code in some RAM area of the RAMbox. Such code can really lead to unreliable operation that does not look systematic. Nearly every strange behaviour seems to be possible due to a “soft“ corruption.

So the best would be to check every of the 16 (14) pages. Do you really have access to all of them? I had the case that 4 pages were hidden by other 4 pages and only by loading them with different code made this visible.

If you do not have access to every single page, try to erase all pages of both blocks via the RAMbox MasterClear. Even this will probably not work although it may look so. Try to mask every page by plug-in ROM modules (can also be done sequentially) and repeat the RAMbox MasterClear every time. Please do not forget to also mask and clear page 9 !!! That was my major mistake when I had to recover my HP-41CY. CLPG is no solution. For details please see

http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/forum.cgi?read=48617

Good luck and best regards,

Werner

#22

Is it realy a HW problem? Do both page 8 (RamBox a and b) checksum correctly? Otherwise look for the "Mäuseklavier" (clavier des souris, dip switches) in the bat compartment and erase both PG 8 and reinstall from backup.

Ciao.....Mike


Possibly Related Threads...
Thread Author Replies Views Last Post
  The HP Prime saga - Part II Michael de Estrada 21 1,491 11-30-2013, 01:04 PM
Last Post: Michael de Estrada
  Last HP emulation, 32 & 01 Olivier De Smet 0 244 09-07-2013, 08:27 AM
Last Post: Olivier De Smet
  HP-32S II Expansion Matt Agajanian 14 1,167 07-21-2013, 10:19 PM
Last Post: Matt Agajanian
  Classpad II fx-CP400 emulator Namir 0 286 07-07-2013, 08:07 AM
Last Post: Namir
  HP 32S-II Vertical Curve Program Ron Cardwell 2 367 05-20-2013, 07:54 AM
Last Post: Thomas Klemm
  HP 50G emulation for android Olivier De Smet 3 426 04-14-2013, 12:01 PM
Last Post: CompSystems
  HP-39g II Acquistion Matt Agajanian 54 3,095 07-21-2012, 02:31 AM
Last Post: Gilles Carpentier
  Closest thing to a 42S-II Matt Agajanian 17 1,226 06-27-2012, 01:00 PM
Last Post: Matt Agajanian
  New HP71B emulation (go71b) Olivier De Smet 9 744 06-26-2012, 10:25 AM
Last Post: Jerry Raia
  HP-41CV System II aj04062 1 307 06-22-2012, 08:49 PM
Last Post: Allen

Forum Jump: