HP 50g: Mantissa of an Extended Real

+- HP Forums (http://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: General Forum (/forum-4.html)
+--- Thread: HP 50g: Mantissa of an Extended Real (/thread-9246.html)



HP 50g: Mantissa of an Extended Real - Gerald H - 10-07-2017 07:23 AM

Does anyone have a programme to get the mantissa of an extended real on the 50g - the shorter the better?


RE: HP 50g: Mantissa of an Extended Real - Gerald H - 10-07-2017 10:24 AM

Here is my attempt at a solution, but I fear the programme is too large & slow:

Code:
::
  CK1&Dispatch
  BINT63
  ::
    DUP
    %%0=
    ?SEMI
    %%ABS
    %%10
    OVER
    DO>STR
    DUP
    CHR_E
    BINT1
    POSCHR
    #1+LAST$
    FPTR2 ^S>Z
    FPTR2 ^Z2%%
    %%^
    %%/
  ;
;



RE: HP 50g: Mantissa of an Extended Real - DavidM - 10-07-2017 02:55 PM

This is smaller and faster. Here's the commented code, in case anyone is interested.

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 )
   ;
;