Post Reply 
A ROM emulator for the 71B
11-08-2020, 08:38 PM
Post: #22
RE: A ROM emulator for the 71B
I thought those who have expressed interest in this project might like a little background on how it is used, that is, how you might add or reorder ROM images in the MCU. It presently looks a good deal like Diego's Clonix system, only without the (Windows only) graphical front end. One creates a new arrangement by assembling and flashing the source and ROM image files.

A ROM image file is quite simple and easy to create from a typical .BIN file. It is just a text file with data declarations that I generate using a simple C program. An image file looks like

Code:

        radix hex
                ; HP-82481A AC Circuit Analysis Pac, #5061-7237, $75:1985
        db     000,000,000,0ee,043,069,072,063,075,069,074,020,008,0e2,000,000

Each data declaration line has 16 byte values taken from the .BIN file in sequential order. I just hacked something out in C but you could get fancy if you wish in any language of choice.

These ROM image files are included into the source file using directives to indicate where in Program Flash Memory they should reside. The PIC controller divides the 128 KB of flash into 8 Blocks of 16 KB each. The software lives in Block 0, so you have 7 Blocks into which to place ROM images. Note that every ROM image must begin on a Block boundary. That placement is done in this manner.

Code:

        org 0x4000
#include accap.inc
        org 0x8000
#include math2b.inc
        org 0x10000
#include finance.inc
        org 0x14000
#include edit.inc
        org 0x18000
#include ampistats.inc

Now the fun part! Since there are 7 Blocks of flash memory that can hold a ROM image, I have 7 descriptor slots that define where an image is stored and what size the image is. You control what ROM image is enumerated by poking a value to the card reader I/O address and then cycling the 71B off and on. Poking a value of "0" means no ROM is enumerated, while a value between "1" and "7" refers to one of the descriptor slots. This power cycling sequence should be familiar to those with real ROMs. If you are replacing a ROM in a front port, you need to cycle power with the port empty before putting in a new ROM in the same port.

Given the timing constraints imposed by a hard real time system, I had to also constrain the size and placement of ROM images. So, a 16 KB image can go into any of the 7 flash Blocks (not to be confused with a descriptor slot, though that's easy to do!). A 32 KB image must be based on an even flash block (2, 4, or 6) and will occupy two flash Blocks. A 64 KB image can only be based at Block 4 and occupies Blocks 4 through 7. An image size of 48 KB is not supported - it must be treated as a 64 KB image.

The content of a descriptor slot is a bit complicated so I won't go into it here. Suffice to say it's easily generated from the ROM size and flash block location. I've been doing it by hand myself, but a program could be written to generate the data needed. In fact, I'm finishing up a serial monitor that allows you to upload ROM images and describe the layout of ROM images in flash. More on that later if interested.

Using the emulator once it's loaded up with images is quite simple. Freshly installed, it enumerates no ROM. Using the example layout given earlier, you would plug in the MATH:2B ROM with the sequence

Code:

POKE "2C000", "2"
f ON
ON

Replacing that ROM with the Finance ROM would be

Code:

POKE "2C000", "0"
f ON
ON
POKE "2C000", "3"
f ON
ON

Pretty easy, no?
~Mark

Remember kids, "In a democracy, you get the government you deserve."
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
A ROM emulator for the 71B - mfleming - 11-06-2020, 08:52 PM
RE: A ROM emulator for the 71B - rprosperi - 11-06-2020, 09:58 PM
RE: A ROM emulator for the 71B - KimH - 11-07-2020, 03:49 PM
RE: A ROM emulator for the 71B - KimH - 11-07-2020, 05:18 PM
RE: A ROM emulator for the 71B - rprosperi - 11-07-2020, 07:19 PM
RE: A ROM emulator for the 71B - mfleming - 11-06-2020, 10:57 PM
RE: A ROM emulator for the 71B - twoweims - 11-07-2020, 01:52 AM
RE: A ROM emulator for the 71B - KimH - 11-07-2020, 03:52 PM
RE: A ROM emulator for the 71B - cdmackay - 11-07-2020, 12:45 AM
RE: A ROM emulator for the 71B - mfleming - 11-07-2020, 03:35 AM
RE: A ROM emulator for the 71B - rprosperi - 11-07-2020, 04:06 AM
RE: A ROM emulator for the 71B - mfleming - 11-07-2020, 07:07 PM
RE: A ROM emulator for the 71B - Sukiari - 11-08-2020, 12:07 AM
RE: A ROM emulator for the 71B - Harald - 11-08-2020, 12:06 PM
RE: A ROM emulator for the 71B - mfleming - 11-08-2020 08:38 PM
RE: A ROM emulator for the 71B - EmmanuelC - 11-08-2020, 09:24 PM
RE: A ROM emulator for the 71B - Harald - 11-08-2020, 11:02 PM
RE: A ROM emulator for the 71B - mfleming - 11-27-2020, 12:00 AM
RE: A ROM emulator for the 71B - KimH - 11-30-2020, 05:08 PM
RE: A ROM emulator for the 71B - mfleming - 11-09-2020, 01:08 AM
RE: A ROM emulator for the 71B - Moggul - 11-10-2020, 08:12 AM
RE: A ROM emulator for the 71B - Sukiari - 11-27-2020, 12:18 AM
RE: A ROM emulator for the 71B - mfleming - 11-27-2020, 01:45 AM
RE: A ROM emulator for the 71B - Harald - 11-27-2020, 06:07 PM
RE: A ROM emulator for the 71B - mfleming - 11-27-2020, 10:58 PM
RE: A ROM emulator for the 71B - Kevin71B - 01-10-2021, 02:20 PM
RE: A ROM emulator for the 71B - mfleming - 01-17-2021, 01:31 AM
RE: A ROM emulator for the 71B - mfleming - 01-17-2021, 03:51 AM
RE: A ROM emulator for the 71B - mfleming - 01-17-2021, 04:35 AM



User(s) browsing this thread: 3 Guest(s)