Post Reply 
HP 50g: Mantissa of an Extended Real
10-07-2017, 07:55 PM
Post: #8
RE: HP 50g: Mantissa of an Extended Real
(10-07-2017 07:46 PM)Gerald H Wrote:  Sorry, I must have erred in copying the instructions, on recompiling the negatives are dealt with correctly.

No problem. You had me really scratching my head for a while there, though.

I should have included the checksum/byte count as a safeguard.

Here's the commented code, in case anyone is interested. I did swap two lines in this one to make the flow more consistent (it doesn't make a difference in the result, of course).

Checksum: FAECh
Bytes: 41
Code:
::
   CK1&Dispatch            ( must have at least 1 argument on stack )
   BINT63 ::               ( argument type must be extended real )
      TOTEMPOB             ( make a duplicate of the extended real for the result )
      CODEM                % start MASD code block
         A=DAT1 A          % A.A -> SL1 object (the result)
         AD0EX             % save D0 in A.A, D0 now points to result object
         D0+5              % advance D0 past prologue
         C=0 A             % C.A = 0
         DAT0=C A          % zero-out exponent field
         D0+5              % advance D0 past exponent field
         D0+15             % advance D0 past mantissa field
         DAT0=C P          % zero-out sign field
         AD0EX             % restore original D0 from A.A
         RPL               % return to RPL
      ENDCODE              ( end MASD code block )
   ;
;
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: HP 50g: Mantissa of an Extended Real - DavidM - 10-07-2017 07:55 PM



User(s) browsing this thread: 1 Guest(s)