Post Reply 
41CL function request - is this possible? If so, how?
08-19-2014, 11:08 AM (This post was last modified: 08-19-2014 02:53 PM by Ángel Martin.)
Post: #3
RE: 41CL function request - is this possible? If so, how?
Well, I didn't remember that PLUGG? is non-programmable so the above description for the YFNP case is obviously wrong. To redeem myself here's a short routine to accomplish the task in such case:

Since TF in the AMC_OS/X does the same as IF and I know you have it permanently on your system, let's assume we want to use a function from the 4TBX module, which will temporarily be plugged in page 14 (E). Put the pg# in X and run:

01 LBL "GENE1"
02 4
03 WSIZE - sets word size as single char
04 X<>Y - bring pg# back to X
05 "8040" - start building the syntax
06 ARCLH - append page# in hex
07 "|-0-0000" - complete syntax for YPEEK
08 YPEEK - read MMU entry
09 ASHF - clean the address up
10 ATOX
11 ATOX
12 ADRID - get ROM id# (if in flash)
13 ASTO 00 - save ROM id# for later
14 "4TBX"
15 RCL Z - bring pg# back to X
16 PLUGG - toolbox4 is now plugged
17 ..... - execute your functions, leaving pg# in x at end .....
18 CLA - clear alpha
19 ARCL 00 - recall ROM id# (assumed in Flash)
20 PLUGG - plug it back
21 END


Compared to this, the YFNX scenario is a vast improvement:

01 LBL "GENE2"
01 "?XXX E"
02 PPLUG
03 ASTO 00
04 "4TBX E"
05 PPLUG
06 ..... - do your busines as above...
07 CLA
08 ARCL 00
09 PPLUG
10 END.

Here you go, no limitation as to the module footprints (with the caveats mentioned in the previous post), nor do you have to worry about the stack contents at all.

Sorry about the glitch, hope this clarifies anyway.

Edited to reflect Monte's comment below.

"To live or die by your own sword one must first learn to wield it aptly."
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: 41CL function request - is this possible? If so, how? - Ángel Martin - 08-19-2014 11:08 AM



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