The Museum of HP Calculators

HP Forum Archive 18

 MCODE: The significance of a "3" in nybble 3 in register "b"Message #1 Posted by Geir Isene on 18 Jan 2008, 4:06 p.m. In "MCode for beginners" by Ken Emery, pages 42 and 43 we find the instructions for the program called "GE" (Goto End): ```READ 13(c) C=0 M R= 3 LD@R 3 ``` This loads a "3" into nybble 3 in the status register "b", the first nybble specifying the program pointer in user memory. This nybble gives the nybble within the register where the program pointer points to. Why put a "3" in there to execute the .END. ?

 Re: MCODE: The significance of a "3" in nybble 3 in register "b"Message #2 Posted by JoseL on 21 Jan 2008, 10:29 a.m.,in response to message #1 by Geir Isene Hi, Geir A register in the HP41 memory contains 7 bytes, numbered like this: 6-5-4-3-2-1-0. The .END. is always located in the bytes 2-1-0 of the last register in User Program Memory. On the other hand, the Address Pointer (within b register) is: pqrs, where qrs is the register number and p the byte number, within this register qrs, of the last instruccion executed. So, the next instrucción to execute will be byte (p-1) of register qrs. You Write: "Why put a "3" in there to execute the .END. ?" The .END. is located in the memory register pointed by nibbles 2-1-0 of c register (qrs). And whitin this register (qrs), in bytes numbers 2-1-0. So, the address pointer should be 3qrs, which is a byte preceding the position of the .END., which is the next instruction to be executed. Best regards

 Re: MCODE: The significance of a "3" in nybble 3 in register "b"Message #3 Posted by Geir Isene on 21 Jan 2008, 11:34 a.m.,in response to message #2 by JoseL Thank you very much. I suspected something like this. Where is this documentet? I'd like to read more about related subjects.

 Re: MCODE: The significance of a "3" in nybble 3 in register "b"Message #4 Posted by Raymond Del Tondo on 21 Jan 2008, 12:40 p.m.,in response to message #3 by Geir Isene Should be in one of the books about synthetic programming;-) IIRC, a short (abbreviated) version of the above can be seen in the 'Synthetic Quick Reference Guide'... HTH Raymond

 Re: MCODE: The significance of a "3" in nybble 3 in register "b"Message #5 Posted by JoseL on 22 Jan 2008, 6:43 a.m.,in response to message #3 by Geir Isene Yes, as Raymond says ... There are two books about Synthetic Programming: HP41 Synthetic Programming made easy ..... Keith Jarret. Synthetic Programming .... W.C Wickes. There you can learn all about the "internal mysteries" of 41's. If you are diving in MCODE programming, you should read these books as well. I wish you luck and please, tell us your progress in MCODE.

Go back to the main exhibit hall