Post Reply 
Go To in Woodstocks
05-17-2016, 09:19 AM (This post was last modified: 05-17-2016 09:21 AM by PANAMATIK.)
Post: #3
RE: Go To in Woodstocks
(05-17-2016 05:16 AM)teenix Wrote:  I have found code segments that appear to jump across ROM boundaries and as the instructions are only 10 bits with 8 for the target address I cannot see how this is accomplished. If this is indeed the case then having delayed select ROM n instructions would seem unnecessary.

I am obviously missing something but with limited resources I have ground to a halt.

Any insights for this problem are surely appreciated.

many thanks

cheers

Tony

Hello Tony,

The delayed ROM instructions can access only up to 16 ROM pages, which is 4k address range. The bank switch instruction 01060 was invented after 4k was not any more sufficient memory for the HP-67 and HP-97 code and extends the address range to potentially 8k.

The bank switch instruction toggles between the two 4k ROM banks 0 and 1 each time it is invoked. Additionally whenever an address within the first 1k is jumped to the bank 0 will be selected. If a ROM switch 01060 occurs, the next instruction will be fetched from the following address but in the other bank.

In the real calculators, some of the ROM chips contain two banks, others only one. Normally a bank switch instruction occurs only at ROM addresses of chips, which contain both banks, otherwise the opcode would be ignored. In fact, the HP-67 ACT ignores all 01060 instructions executing it as a nop instruction, only the ROM chips itself listen to this code and toggle their bank, if they have both. The first ROM chip at address 0 always has only one bank.

In an emulation it is usual to place the code of bank 1 behind the 4k code of bank 0, thus your emulator code in C could look like this.

Code:

void op_bank_switch () // bank switch instruction 01060
{
  bank=!bank;  // toggle between 1 and 0
}

When executing any instruction you have to get the opcode from the actual selected ROM bank like this:

Code:

uint16_t address = act_pc; // 12-bit program counter can address only 4k

  if (bank!=0)
  {
    if(act_pc<0x400)
      bank = 0;  // reset bank if address is  < 1k
    else
      address |= 0x1000; // bank 1 is used in HP-67 HP-97 with more than 4k ROM
  }
  opcode = Getopcode(address);

// now execute opcode

I hope this could help you to understand bank switching in the HP-67/97.

By the way, if you emulate 6 classic calculators, you have the complete set 35/45/55/65/70/80. I would be interested in having the HP-70 microcode. As far as I know this code has never been extracted? Do I miss something?

Bernhard

That's one small step for a man - one giant leap for mankind.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Go To in Woodstocks - teenix - 05-17-2016, 05:16 AM
RE: Go To in Woodstocks - d b - 05-17-2016, 05:35 AM
RE: Go To in Woodstocks - PANAMATIK - 05-17-2016 09:19 AM
RE: Go To in Woodstocks - bshoring - 05-19-2016, 06:52 AM
RE: Go To in Woodstocks - PANAMATIK - 05-19-2016, 07:26 AM
RE: Go To in Woodstocks - teenix - 05-17-2016, 10:36 AM
RE: Go To in Woodstocks - PANAMATIK - 05-17-2016, 01:17 PM
RE: Go To in Woodstocks - teenix - 05-17-2016, 01:28 PM
RE: Go To in Woodstocks - teenix - 05-17-2016, 02:58 PM
RE: Go To in Woodstocks - PANAMATIK - 05-17-2016, 03:02 PM
RE: Go To in Woodstocks - teenix - 05-19-2016, 11:46 PM
RE: Go To in Woodstocks - PANAMATIK - 05-20-2016, 07:18 AM
RE: Go To in Woodstocks - teenix - 05-20-2016, 08:41 AM
RE: Go To in Woodstocks - teenix - 07-02-2016, 06:55 AM
RE: Go To in Woodstocks - Dieter - 07-03-2016, 01:16 PM
RE: Go To in Woodstocks - teenix - 07-03-2016, 01:36 PM



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