I recently began working with MCODE programming on the HP-

41CX. With the advent of the new devices MLDL2000 and NoVram,

using the David Assembler with Mainframe Labels has become quite

easy. Over the years I have programmed some RPL on the HP-

49G. But now getting back to the HP-41CX I decided to add some

MCODE routines to add the Stack manipulation routines of the HP-

49G. I don’t want to upset the pure HP-41 enthusiasts by doing

this, I just wanted to add a modern touch to help extend the

life of the HP-41CX calculator. Although there is no “Rocket

Science” to these functions, It has been an interesting way

to begin my MCODE programming experience. Below is a listing

of the functions I have made. I encourage any and all

comments as there are always several ways to “Skin the Cat”. I

hope you find this article as interesting as I found it to

develop. You can e-mail me at thecoltsman2006@yahoo.com with any

suggestions to make these routines more efficient.

FUNCTION 00C4 ... ... ... "DUP"

F 00C4 3B5 050 ... ?NC XQ 14ED

F 00C6 0F8 ... ... READ ( 3)X

F 00C7 128 ... ... WRIT ( 4)L

F 00C8 3A5 050 ... ?NC XQ 14E9

F 00CA 078 ... ... READ ( 1)Z

F 00CB 028 ... ... WRIT ( 0)T

F 00CC 0B8 ... ... READ ( 2)Y

F 00CD 068 ... ... WRIT ( 1)Z

F 00CE 0F8 ... ... READ ( 3)X

F 00CF 0A8 ... ... WRIT ( 2)Y

F 00D0 3E0 ... ... RTN

Yes, ENTER does the same thing. Lines 00C4-00C8 can be eliminated if T is not saved to the LASTX register.FUNCTION 00D5 ... ... ... "SWAP"

F 00D5 0F8 ... ... READ ( 3)X

F 00D6 10E ... ... A=C ALL

F 00D7 0B8 ... ... READ ( 2)Y

F 00D8 0E8 ... ... WRIT ( 3)X

F 00D9 0AE ... ... A<>C ALL

F 00DA 0A8 ... ... WRIT ( 2)Y

F 00DB 048 ... ... SETF 4

F 00DC 3E0 ... ... RTN

Yes, X<>Y does the same thing.FUNCTION 00E1 ... ... ... "DROP"

F 00E1 0F8 ... ... READ ( 3)X

F 00E2 128 ... ... WRIT ( 4)L

F 00E3 3B5 050 ... ?NC XQ 14ED

F 00E5 04E ... ... C=0 ALL

F 00E6 0A8 ... ... WRIT ( 2)Y

F 00E7 3A5 050 ... ?NC XQ 14E9

F 00E9 3A5 050 ... ?NC XQ 14E9

F 00EB 3E0 ... ... RTN

FUNCTION 00F0 ... ... ... "OVER"

F 00F0 3B5 050 ... ?NC XQ 14ED

F 00F2 0F8 ... ... READ ( 3)X

F 00F3 128 ... ... WRIT ( 4)L

F 00F4 078 ... ... READ ( 1)Z

F 00F5 0E8 ... ... WRIT ( 3)X

F 00F6 3E0 ... ... RTN

FUNCTION 00FA ... ... ... "ROT"

F 00FA 078 ... ... READ ( 1)Z

F 00FB 0AE ... ... A<>C ALL

F 00FC 0B8 ... ... READ ( 2)Y

F 00FD 068 ... ... WRIT ( 1)Z

F 00FE 0F8 ... ... READ ( 3)X

F 00FF 0A8 ... ... WRIT ( 2)Y

F 0100 0AE ... ... A<>C ALL

F 0101 0E8 ... ... WRIT ( 3)X

F 0102 3E0 ... ... RTN

FUNCTION 0108 ... ... ... "UNROT"

F 0108 078 ... ... READ ( 1)Z

F 0109 0F8 ... ... READ ( 3)X

F 010A 0AE ... ... A<>C ALL

F 010B 078 ... ... READ ( 1)Z

F 010C 0AE ... ... A<>C ALL

F 010D 068 ... ... WRIT ( 1)Z

F 010E 0B8 ... ... READ ( 2)Y

F 010F 0E8 ... ... WRIT ( 3)X

F 0110 0AE ... ... A<>C ALL

F 0111 0A8 ... ... WRIT ( 2)Y

F 0112 3E0 ... ... RTN

FUNCTION 0117 ... ... ... "DUP2"

F 0117 0F8 ... ... READ ( 3)X

F 0118 068 ... ... WRIT ( 1)Z

F 0119 0B8 ... ... READ ( 2)Y

F 011A 028 ... ... WRIT ( 0)T

F 011B 3E0 ... ... RTN

FUNCTION 0122 ... ... ... "DUPDUP"

F 0122 0B8 ... ... READ ( 2)Y

F 0123 028 ... ... WRIT ( 0)T

F 0124 0F8 ... ... READ ( 3)X

F 0125 0A8 ... ... WRIT ( 2)Y

F 0126 068 ... ... WRIT ( 1)Z

F 0127 3E0 ... ... RTN

FUNCTION 012D ... ... ... "DROP2"

F 012D 04E ... ... C=0 ALL

F 012E 0E8 ... ... WRIT ( 3)X

F 012F 0A8 ... ... WRIT ( 2)Y

F 0130 3A5 050 ... ?NC XQ 14E9

F 0132 3A5 050 ... ?NC XQ 14E9

F 0134 3E0 ... ... RTN

FUNCTION 0138 ... ... ... "NIP"

F 0138 0F8 ... ... READ ( 3)X

F 0139 0A8 ... ... WRIT ( 2)Y

F 013A 3A5 050 ... ?NC XQ 14E9

F 013C 04E ... ... C=0 ALL

F 013D 028 ... ... WRIT ( 0)T

F 013E 3E0 ... ... RTNFUNCTION 0110 ... ... ... "ROLLD"

F 0110 3A5 050 ... ?NC XQ 14E9

F 0112 3E0 ... ... RTN

FUNCTION 0119 ... ... ... "ROLLD2"

F 0119 3A5 050 ... ?NC XQ 14E9

F 011B 3A5 050 ... ?NC XQ 14E9

F 011D 3E0 ... ... RTN

FUNCTION 0124 ... ... ... "ROLLD3"

F 0124 3A5 050 ... ?NC XQ 14E9

F 0126 3A5 050 ... ?NC XQ 14E9

F 0128 3A5 050 ... ?NC XQ 14E9

F 012A 3E0 ... ... RTN

FUNCTION 013B ... ... ... "PICK3"

F 013B 078 ... ... READ ( 1)Z

F 013C 028 ... ... WRIT ( 0)T

F 013D 3B5 050 ... ?NC XQ 14ED

F 013F 3E0 ... ... RTN

FUNCTION 0145 ... ... ... "PICK4"

F 0145 3B5 050 ... ?NC XQ 14ED

F 0147 3E0 ... ... RTN

*Edited: 21 Feb 2008, 5:34 p.m. after one or more responses were posted*