Can someone explain the following from the beginning of the NUT Math ROM 1
Common Math Entries
If number is 2-10 or 1-10 or 2-13?
The register contains 14 nybbles. What do these 2-10,1-10 and 2-13 mean?
VASM HP-41 question
|
|
« Next Oldest | Next Newest »
|
▼
Post: #2
04-21-2005, 07:43 PM
Can someone explain the following from the beginning of the NUT Math ROM 1
▼
Post: #3
04-22-2005, 02:45 AM
They are just program labels. ad2-10, ad1-10, and ad2-13 are three different entry points for the addition ruoutine. Internally, numbers are stored in memory in 10-digit form. That's the count of the mantissa digits. There are also two digits of exponent, and one each of mantissa sign and exponent sign. There's also a 13-digit form that is used only in the registers, for intermediate calculations. That's 13 digits of mantissa, with the sign and exponent in another register. For the 2-10 entry points, both numbers are in the normal 10-digit form. For 1-10, one is in ten digit and one is in 13-digit form. For 2-13, both are in 13-digit form. For instance, the entry point ad2-10 is used to add two numbers both in ten-digit form. Eric ▼
Post: #4
04-22-2005, 03:13 AM
Hi Eric! What you mean with "internally"? The user-accessible numbers are with a 10 digit mantissa. Durging calcualtions (internally) the HP-41 may do something else (to achieve higher precission?) but converts the result before it pops up on the user surface. BTW - in my copy of the VASM there are no comments in the math routines. Ciao.....Mike ▼
Post: #5
04-22-2005, 03:47 AM
Hi Mike, maybe you have an earlier copy, and the comments were made later?
Another half-OT question: Regards Raymond ▼
Post: #6
04-26-2005, 03:51 AM
Hi Raymond! Seems Eric's append answers your question. Alas I do not have those text files and had no time yet to try OCR with my scanns. Ciao.....Mike
Post: #7
04-22-2005, 06:10 PM
Quote: None at the very beginning of the file cn6b, right under where it says "Nut math ROM 1" and "starting address=@14000"? Mine says:
▼
Post: #8
04-26-2005, 03:39 AM
Yep, there is a comments "header", but no "inline" comments as in other parts. Ciao.....Mike
Post: #9
04-26-2005, 08:18 PM
This is where I got the 13 digit form. I tried to SETDEC prior to the C=A-C operation and still the result is not the correct answer. In fact it is way off. Is there some considerations to think about when entering constants lets say 1.25/ ▼
Post: #10
04-27-2005, 04:52 AM
Pls do not apologize for beginners questions. But if you want to go deeper in this bussines get a copy of "MCode made easy" from .. - ah? who was it? -- or something like that. It was long ago when I did such things and forgot too much, so I am almost a beginner too.
If it helps here a random number generator (CX only! as w/o seed it takes part of time as seed which is stored in a volatile buffer) of the type used in PPC-ROM: Rn+1 = FRAC(Rn * 9821 + ,211327). At the end you find the multiply and add step. Pls try this entry points, IIRC they are very close to those the HP-41 goes when you hit "*" or "+". B400 04E C=0 ALL BTW - this routine can only be shiftet to page boundaries (x000, x400, x800, and xC00). Use it first in an emulator and trace it to see what happens. Adjust the buffer number in case of conflicts with other buffers. Ciao.....Mike
Post: #11
04-22-2005, 01:21 PM
Is there a way to verify whether or not I have one or both the numbers, that I am performing math on, in 10 or 13 digit form? I am trying to perform a C=A-C and I know if I use WRIT 3(X) after each of the previous operations that I have the correct numbers placed into the A and C registers. Unfortunatly when I perform this C=A-C operation I get something like -181.64 which is not the correct answer. Is there a way to change both the numbers to a known form prior to this operation? What am I missing? ▼
Post: #12
04-22-2005, 06:07 PM
An number accessible to the user is ALWAYS stored in 10-digit form. 13-digit form is ONLY used for internal intermediate calculations. For instance, within the calculation of an exponential. The 13-digit form is never the input or output of a user function, and is never in the stack. In other words, anything you ever have in the stack or in a user register, including user intermediate results is always 10-digit.
Post: #13
04-24-2005, 01:23 AM
Jeff, have you made sure you have the CPU in DECimal mode? The result will be bogus if you don´t have a SETDEC instruction somewhere in your code prior to the sustraction step.. Tried to use the OS routines? [Y_MINUS_X] (located at 1421H) and [AD2_10] (located at 1807H) come to mind. I´m not sure I understand (nor agree) with the 13-bit vs. 10-bit discussion in this thread: to me, everything in the coconut CPU has a 10.digit precision, since the input and output both have precisely that.- But again, there are many things in MCODE I don´t know..
Best, |