41CL Calculator Manual
© 2019 Systemyde International Corporation
67
Programming the MMU
The
PLUG
functions in the
41CL Extra Functions
allow the user to insert module images
into nearly every open Page on the 41CL. The one exception is Page 4. This was done
intentionally, because Page 4 is special as far as the Operating System (OS) is concerned,
and can take over the machine in certain circumstances. But there are a number of images
present in Flash memory that can only be loaded into Page 4, and this section will show
you how to do this for three of them.
Library-4
The Library-4 ROM was written by Ángel Martin specifically for use with several other
images that he contributed to the 41CL. The Library-4 ROM contains common
subroutines that are called from these other ROMs. Having a fixed address for
subroutines allows for much quicker access and more efficient code because the
subroutine entry addresses can be hard-coded in the calling programs.
The Library-4 ROM image is located at address 0x120000, and has an associated IMDB
entry so that it can be used with the
IMDB?
function. Once installed, it is completely
invisible as far as the OS is concerned, even when not in use.
The Library-4 ROM is installed by simply writing to the Page 4 MMU entry, using the
YPOKE
command:
ALPHA
804040-8120
ALPHA
XEQ ALPHA
YPOKE
ALPHA
The FORTH ROM
The regular
PLUG
functions cannot be used to insert the FORTH ROM into the 41CL
logical memory because this ROM is hard-coded to use Page 4 and Page 7. Instead, you
will need to program the MMU entries for Pages 4 and 7 directly.
I
t
’
s
a
l
i
t
t
l
e
mor
e
c
ompl
i
c
a
t
e
d
t
ha
n
j
us
t
pr
ogr
a
mmi
ng
t
he
t
wo
MMU
e
nt
r
i
e
s
t
hough.
The
problem is that between programming the two MMU entries the OS is going to check
certain locations in program memory, including the start of Page 4 and places near the
end of Pages 5 through F. This means that the OS will get confused with only half of the