Post Reply 
(SOLVED) 41CL - DOUBLE HEPAX ACCESS and MMU CONFIG
08-19-2019, 01:56 PM
Post: #19
RE: 41CL - DOUBLE HEPAX ACCESS
Just to be on the same page here, this article will review HePaX RAM configuration and 41CL MMU mapping.

References:
  1. 41CL Calculator Manual (sys41cl.pdf), revision 2019-06-22, chapter: HEPAX, pages 82 to 85

In this session we will:
  1. Copy HePaX RAM template from 41CL ROM to 41CL RAM pages (here: 0x821 to 0x824)
  2. Create the double link list binding these pages together (assuming final destinations 41OS port pages will be 0xC to 0xF)
  3. Mapping HePaX RAM & ROM
  4. Making a copy of the HePaX RAM (0x821 to 0x824) to another 41CL RAM area (0x831 to 0x834)
  5. Creating a data in the first HePaX RAM area (0x821 to 0x824)
  6. Swapping HePaX RAM areas (reconfiguring MMU configuration Set 0)

Ok let's do this ...

1) Copy HePaX RAM template from 41CL ROM to 41CL RAM pages (here: 0x821 to 0x824)
Code:
"0B9>821"  YMCPY      // copy HEPAX RAM template 0x0B9 to 41CL RAM page 0x821
"0B9>822"  YMCPY      // copy HEPAX RAM template 0x0B9 to 41CL RAM page 0x822
"0B9>823"  YMCPY      // copy HEPAX RAM template 0x0B9 to 41CL RAM page 0x823
"0B9>824"  YMCPY      // copy HEPAX RAM template 0x0B9 to 41CL RAM page 0x824

2) Create the double link list binding these pages together (assuming the final destination will be 41OS port pages 0xC to 0xF)
Code:
                      // in HePaX RAM page 1 (0x821) at 41OS port page 0xC,     previous page pointer is already set to 0x0 which mean begin/end of list
"821FE8-000D"  YPOKE  // in HePaX RAM page 1 (0x821) at 41OS port page 0xC, set next     page pointer to HePaX RAM page 2 (0x822) at 41OS port page 0xD
"822FE7-000C"  YPOKE  // in HePaX RAM page 2 (0x822) at 41OS port page 0xD, set previous page pointer to HePaX RAM page 1 (0x821) at 41OS port page 0xC
"822FE8-000E"  YPOKE  // in HePaX RAM page 2 (0x822) at 41OS port page 0xD, set next     page pointer to HePaX RAM page 3 (0x823) at 41OS port page 0xE
"823FE7-000D"  YPOKE  // in HePaX RAM page 3 (0x823) at 41OS port page 0xE, set previous page pointer to HePaX RAM page 2 (0x822) at 41OS port page 0xD
"823FE8-000F"  YPOKE  // in HePaX RAM page 3 (0x823) at 41OS port page 0xE, set next     page pointer to HePaX RAM page 4 (0x824) at 41OS port page 0xF
"824FE7-000E"  YPOKE  // in HePaX RAM page 4 (0x824) at 41OS port page 0xF, set previous page pointer to HePaX RAM page 3 (0x823) at 41OS port page 0xE
                      // in HePaX RAM page 4 (0x824) at 41OS port page 0xF,     next     page pointer is already set to 0x0 which mean begin/end of list

3) Mapping HePaX RAM & ROM
Code:
"%821 C"  PPLUG       // mapping HePaX RAM (4 pages) in 41CL RAM (0x821 to 0x824) to 41OS port page 0xC to 0xF
"HEPX B"  PPLUG       // mapping HePaX ROM (1 page 4 banks) to 41OS port page 0xB
HEPDIR                // validating HePaX RAM space, should show: "H:DIR EMPTY" press clear key (<-) then you should see in X: 2610.0000
At this point we have one HePaX setup with no data in HePaX RAM

4) Making a copy of the empty HePaX RAM (0x821 to 0x824) to another 41CL RAM area (0x831 to 0x834)
Code:
"821>831"  YMCPY      // copy 41CL RAM page 0x821 to 41CL RAM page 0x831
"822>832"  YMCPY      // copy 41CL RAM page 0x822 to 41CL RAM page 0x832
"823>833"  YMCPY      // copy 41CL RAM page 0x823 to 41CL RAM page 0x833
"824>834"  YMCPY      // copy 41CL RAM page 0x824 to 41CL RAM page 0x834
At this point we have two HePaX setup with no data in HePaX RAM (one active at 0x821 and one standby at 0x831)

5) Creating a data in the first HePaX RAM area (0x821 to 0x824)
Code:
HEPDIR                // should show: "H:DIR EMPTY" with 2610 in X, ok let create a file in HePaX so we differenciate the two HePaX RAM area
"TEST"                // HePaX data file name
20                    // HePaX data file size
HCRFLD                // create HePaX data file
HEPDIR                // should show: "TEST    DA        20" with 2588 in X
At this point we have two HePaX RAM area, one with data in it (0x821) and one empty (0x831) with the first area active (0x821)

6) Swapping HePaX RAM areas (reconfiguring MMU configuration Set 0)
Code:
"%831 C"  PPLUG       // activating second HePaX RAM area (0x831 to 0x834)
HEPDIR                // should show: "H:DIR EMPTY" with 2610 in X
"%821 C"  PPLUG       // activating first  HePaX RAM area (0x821 to 0x824)
HEPDIR                // should show: "TEST    DA        20" with 2588 in X
At this point we have proven that we can swap HePaX RAM area without any side effects.
You can only have one HePaX RAM area active at a time but with area swapping you can have a lot of data or program stored.

Finally, I have used the pages 0x821..0x824 and 0x831..0x834 to be easy to relate the steps with, but this setup does not use memory efficiently.
A more normal approach would have been to used these areas: 0x820..0x823, 0x824..0x827, 0x828..0x82B, 0x82C..0x82F, etc

Next article will finally address the backup and restore of HePaX RAM and MMU configuration.

Sylvain
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: 41CL - DOUBLE HEPAX ACCESS - Sylvain Cote - 08-19-2019 01:56 PM



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