HP-41 MCode Question
|
03-24-2019, 01:01 PM
Post: #1
|
|||
|
|||
HP-41 MCode Question
Some basic questions for the HP-41 MCode gurus here.
After a pause of 30 years, I am starting to relearn HP-41 MCode again. About the interaction between register C and RAM register 0 of a selected RAM chip ... Available instructions Code: DEC BIN OCT HEX HP J/DA ZenROM NEWT Description Extract from MCODE for Beginners from Ken Emery page 53 Code: Sometimes we don't know exactly where in a RAM chip we will be, and we can't have the RAMSLCT pointer being moved on us. Live trace (extract) from Genesis-41 doing a RDN function who's implementation is actually doing 3 roll up !!! Code: ,29DA 1 14ED 04E N C=0 ALL ; C[13:0] = 00000000000000, CARRY = 0 Question 1: could you explain why RDATA is not the equivalent of the inexistant C=REG 0(T) Question 2: what are the differences between WDATA and REG=C 0/T Thanks Sylvain |
|||
03-24-2019, 03:19 PM
Post: #2
|
|||
|
|||
RE: HP-41 MCode Question
(03-24-2019 01:01 PM)Sylvain Cote Wrote: Question 1: could you explain why RDATA is not the equivalent of the inexistant C=REG 0(T) 1) Not sure there's a *reason* why, to me it's simply the way it is: there's no READ 0(T) instruction because its place is taken by READ DATA. This means that to read the T register you need to select the data address zero first. 2) Well, they are two different instructions: WRITE 0(T) writes the C contents into the T register (when Chip_00 is selected of course); whilst WRITE DATA writes it into whatever register is selected by a previous execution of RAMSLCT. Perhaps this is not what you were expecting, but to me this is just a pragmatic reality... Cheers, ÁM "To live or die by your own sword one must first learn to wield it aptly." |
|||
03-24-2019, 07:33 PM
Post: #3
|
|||
|
|||
RE: HP-41 MCode Question
Thank you Ángel.
Next time I will do a test before asking questions, if I had done that I would had my answer right away. Question 1 test Code: F000 001 XROM 1 TST body Code: F093 130 0 LDI S&X /// Setup before TST execution Code: SIZE 016 TST execution trace Code: F093 130 0 LDI S&X Lesson learned from the above example: 1) RDATA always read current selected register (as you said) 2) RDATA has the same behavior of the non existent C=REG 0 if first register of a RAM chip is selected 3) C=REG 1 to 15 always return offset data from the current RAM chip selected I still find it special (asymmetrical?) to create a WDATA and 16 x REG=C instructions and not do the same for the RDATA and C=REG counterpart. It's not like they did not had free instruction slots to do it ... Thanks again for the information Ángel. Best regards, Sylvain |
|||
03-25-2019, 06:01 AM
Post: #4
|
|||
|
|||
RE: HP-41 MCode Question
(03-24-2019 07:33 PM)Sylvain Cote Wrote: I still find it special (asymmetrical?) to create a WDATA and 16 x REG=C instructions and not do the same for the RDATA and C=REG counterpart. That's true, I suppose that's what tripped up the MCODE pioneers... until they realized the scheme. I have no idea why HP chose that arrangement, moot point or curiosity these days... Good luck with your MCODE refreshing! ÁM. "To live or die by your own sword one must first learn to wield it aptly." |
|||
03-25-2019, 08:29 PM
Post: #5
|
|||
|
|||
RE: HP-41 MCode Question
I have a far fetched theory. HP saved some transistors in their RAM chips and as this it the T register, it written to more often than it is read. Reading is done when dropping and rotating the stack. The cost in ROM for this is max 4 instructions.
ENTER or numeric input lifts the stack, which means it writes a lot more to T more than it is read, so the being able to write to it is more important than reading it. The C=0, RAMSLCT (DADD=C) selects T and chip 0, so it may also become selected for free, which may be taken advantage of, depending on the firmware. Anyone who spots old HP engineers at the conferences can try to ask if anyone knows the real answer. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)