41C mCode routines

If anyone is interested in 41C mcode routines (besides Angel and myself) I have a some code to offer:

I have written a series of functions to implement recall math on the 41 something I always missed. Like code for multifunctions in the HEXPAC module you program a function and follow with a number in the next line designating the register. Example 12 RCL+ ,13 010 which means add the number in User Register 10 to the X-register without pushing the stack. The functions include direct: RCL+, RCL-, RCL*, RCL/ and indirect: RCLI+, RCLI-, RCLI*, RCLI/.
Also allowed is recall FROM a stack register and indirect FROM a stack register by using .00 to .05 to indicate registers T to L (the code limits stack/status register access to these register only for safety's sake).

Because a general purpose routine was developed to capture the next program line(s) other functions were able to be developed:
<> a register exchange function: 10 <>, 11 010, 12 001 for exchanging contents of User registers 10 and 1.
I<> exchange indirect the content of register given by the first register number with the contents of the second register.
I<>I exchange indirectly the content of User registers given by data in the given registers.

Once again by using .0n (where n=0-5) Stack/Status registers may be used.
One general limitation is that you CANNOT INDIRECT TO A STACK REGISTER; i.e., the indirect register can hold the number of a user register but not a .0n number to a stack register.

Also because a general capture routine was available a general multifunction routine was developed allowing for 1 to 999 subroutines to be called; i.e., 10 Multi1 11 001 calls subfunction 1. mCoders simply build a jump table to the subfunctions and set a guard byte to the size of the number of the subfunctions and compile the code.

There are limitations:
1) As stated the Indirection can only be from Stack registers not to them.
2) At the moment these functions are ONLY PROGRAMMABLE because the code acts on the following line(s).
3) After inserting these functions and before running the FOCAL program the user MUST PACK THE PROGRAM. (Technical: if nulls have been inserted between the function line and the line(s) of digits unforseen results will occur!)

1,2,and 3 will be addressed in future code as I get to it.

So, if anyone is interested in code for a discontinued,20+ year old calculator I'll be glad to publish it. You can comment here or email me. I have a general "test image" I use with emulators and if there's enough interest and if Warren allows maybe I can package up source and mod image and ship it off to him for posting on "that other site." Or if only a few want I can probably email the file(s) but this is slow as my day job is busy and tends to turn into a day and night job. (Plus I'm a single dad with a 12 yr. old son and those of you with kids know that at that age chasing after them is a full time job in itself)



Hi David, good to hear from you again.

As you stated, I'm interested for sure. I was wondering whether you've made enhancements to the image you sent me a few months ago. At that time you were still working on refinements to your RCL math routines, so I imagine there's improvements made now.

I'd like to add your code to a couple of functions in the 41Z project, for the STO and RCL of complex numbers, using two standard registers at a time. Could you send me the new code?

And as far as making it available, I'd say it is a great idea. The 41 archive site is perfect as repository for this type of works, so I'd encourage you to go ahead with it.



It is good to hear that there is still mcode being developed. And yes, please publish! Best way is to create a ROM and Warren will gladly put it on his website.


Possibly Related Threads...
Thread Author Replies Views Last Post
  HP-41 MCODE: The Last Function - at last! Ángel Martin 0 681 11-08-2013, 05:11 AM
Last Post: Ángel Martin
  41-MCODE: Auto XEQ+ALPHA possible? Ángel Martin 5 1,325 05-29-2013, 06:15 AM
Last Post: Ángel Martin
  HP 41 Mcode related Questions Michael Fehlhammer 4 1,285 05-10-2013, 07:09 PM
Last Post: Michael Fehlhammer
  41-MCODE: Breaking the FAT barrier. Ángel Martin 0 632 09-03-2012, 06:31 AM
Last Post: Ángel Martin
  41-MCODE: Dr. Jekyll & Mr. Hyde Ángel Martin 9 2,142 07-09-2012, 09:41 AM
Last Post: Monte Dalrymple
  HP41C: Factorial (kind of) in MCODE Frido Bohn 7 1,622 05-26-2012, 09:18 AM
Last Post: Frido Bohn
  41-MCODE: SOLVE & INTEG - 4k ROM Ángel Martin 9 1,967 04-19-2012, 05:29 AM
Last Post: fhub
  HP-35A/21 D.MS<-->Decimal degrees routines Matt Agajanian 9 2,022 03-29-2012, 11:03 AM
Last Post: Matt Agajanian
  41-MCODE: a weekend challenge Ángel Martin 3 1,060 03-19-2012, 06:49 AM
Last Post: Mike (Stgt)
  41-MCODE trivia: backwards or forwards? Ángel Martin 3 1,047 03-05-2012, 04:38 PM
Last Post: Håkan Thörngren

Forum Jump: