41CL Calculator Manual
© 2019 Systemyde International Corporation
78
Patching Code
The
41CL Extra Functions
make it simple to patch software pre-loaded into the 41CL.
Most of the software pre-loaded into the Flash memory can be copied to the RAM
memory, patched, and then the MMU can be used to reference this patched code. Only
pages that cannot be relocated by the MMU cannot be patched. This is pages 0-3 and 5
(which hold the Operating System, the Extended Functions and the Time Functions.) As
mentioned previously, these pages are protected from modification to prevent users from
inadvertently turning the 41CL into a brick.
To illustrate what is required to patch code, go through the steps below to modify the
ROM ID of the
41CL Extra Functions
to avoid a conflict with other modules.
To patch code the ROM image must first be copied to an available page in RAM using
the
YMCPY
function. The
YMCPY
function automatically executes in 50x Turbo mode
and requires about 8 seconds to complete.
ALPHA
007>80C
ALPHA
XEQ ALPHA
YMCPY
ALPHA
In this example just one location needs to be modified for proper operation. Note that
whenever patches are specified only the 4K relative address will be given. Use the upper
nibbles of the RAM address chosen to hold the patched code for the remainder of the
address.
0x000 should be 0x0010 to change the ROM ID to 16 (which is 10 in hexadecimal)
Use the
YPOKE
function to write directly to the desired location in RAM memory. Since
we are using the page starting at address 0x80C000 to hold the patched ROM image the
following keystrokes are required to apply this patch:
ALPHA
80C000-0010
ALPHA
XEQ ALPHA
YPOKE
ALPHA
Then we can use the
PLUG1L
function to insert the patched image into the lower half of
Port 1 (or wherever the
41CL Extra Functions
are, or will be, located):
ALPHA
80C-RAM
ALPHA