Post Reply 
How to create custom 41C modules from keystroke programs?
10-09-2020, 05:21 PM (This post was last modified: 10-10-2020 10:46 PM by Sylvain Cote.)
Post: #28
RE: How to create custom 41C modules from keystroke programs?
This is my solution for creating a custom FOCAL ROM on a DM41X using RAMBOX32 ROM and MLDL RAM (QROM).

Here are the reference modules: (in MOD format)
Simplified logic for a 4K ROM is:
Code:
{begin}
   {copy RAM-04K.MOD to MYROM01.MOD (or any other name)}
   {map MYROM01 module and note the page number, you will need it after}
   {map RAMBOX32 module}
   {begin rom}
      INITPG    {start building a ROM image in MLDL RAM}
      {begin program loading loop}
         LDPGM  {copy FOCAL program from main memory to MLDL RAM}
      {end program loading loop}
      ENDPG     {save ROM version, calculate checksum and save new checksum in MLDL RAM}
      ENDPG     {finish MLDL RAM writing session}
   {end rom, your FOCAL ROM is now done}
   {unmap RAMBOX32 module}
[end}

Example configuration:
Code:
RAMBOX32.MOD is mapped to page 8 (named "W&W RAMBOX 32"   in Active Modules list)
MYROM01.MOD  is mapped to page 9 (named "4K RAM for MLDL" in Active Modules list)

Sample code 1: (3 lines 11 bytes)
Code:
LBL "SND"
BEEP
END

Sample code 2: (4 lines 18 bytes)
Code:
LBL "DSP"
"MY ROM"
AVIEW
END

Init ROM image:
Code:
"-FOCAL APP1"     // ROM name
14                // XROM ID
9                 // page number
INITPG            // initialize MLDL RAM
CAT 2             // you should see "-FOCAL APP1" appears in the catalog

Load first program in ROM image:
Code:
FRYBT?            // free space available = 4044
"SND"
9
LDPGM             // load "SND" program in MLDL RAM at page 9
FRYBT?            // free space available = 4028  //  4044 - 11 (program) - 5 (probably header, I have to validate this) = 4028 ok
CAT 2             // you should see "-FOCAL APP1" and "SND"
CLP "SND"         // delete  "SND" program from main memory
XEQ "SND"         // execute "SND" program from MLDL RAM, you should hear the BEEP

Load second program in ROM image:
Code:
FRYBT?            // free space available = 4028
"DSP"
9
LDPGM             // load "DSP" program in MLDL RAM at page 9
FRYBT?            // free space available = 4005  //  4028 - 18 (program) - 5 (probably header, I have to validate this) = 4005 ok
CAT 2             // you should see "-FOCAL APP1", "SND" and "DSP"
CLP "DSP"         // delete  "DSP" program from main memory
XEQ "DSP"         // execute "DSP" program from MLDL RAM, you should see "MY ROM"

Close ROM image:
Code:
"FA1A"            // ROM version
9                 // page number
ENDPG             // will fail on first try, but needed to save ROM version, calculate checksum and save new checksum in MLDL RAM
ENDPG             // should succeed on the second try, MLDL RAM is now a ROM image.

Next step is to save the new ROM to the calculator file system.
  1. press [shift] then SETUP
  2. select: 2. Module >
  3. select: 3. Save RAM Pages >
  4. select: <New File>
  5. enter: filename then press [R/S] to save the file
Remember, all RAM pages are saved in one big file.

Next, transfer the file to your computer.
I am still looking at how to convert the binary file to a mod file format.

Sylvain

Edit: adding saving RAM page information

PS: See my comment below.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: How to create custom 41C modules from keystroke programs? - Sylvain Cote - 10-09-2020 05:21 PM



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