home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / sys / hp48 / 7270 < prev    next >
Encoding:
Text File  |  1993-01-22  |  3.6 KB  |  213 lines

  1. Newsgroups: comp.sys.hp48
  2. Path: sparky!uunet!gatech!destroyer!fmsrl7!lynx.unm.edu!umn.edu!unet.umn.edu!fin
  3. From: fin@unet.umn.edu (Craig A. Finseth)
  4. Subject: partial HP-16C emulator for the HP48S/SX
  5. Message-ID: <C19HLF.D2@news2.cis.umn.edu>
  6. Sender: news@news2.cis.umn.edu (Usenet News Administration)
  7. Nntp-Posting-Host: norge.unet.umn.edu
  8. Organization: University of Minnesota, Networking Services.
  9. Date: Fri, 22 Jan 1993 15:27:11 GMT
  10. Lines: 201
  11.  
  12. [ This has also been posted to comp.sources.hp48, but as the question
  13. is current in this group, I thought people would be interested. ]
  14.  
  15. Written by: Craig Finseth, University of Minnesota
  16. When: 24 Mar 1990
  17. What: Partial HP-16C Emulator
  18.  
  19. ON16    Turn on our special ENTER key.
  20. OFF16    Turn off our special ENTER key.
  21. BASE    MATH:BASE menu.
  22. LJ    Left Justify
  23. MSKL    Mask Left
  24. MSKR    Mask Right
  25.  
  26. RLn    Rotate Left by n
  27. RRn    Rotate Right by n
  28. RLC    Rotate Left through Carry
  29. RRC    Rotate Right through Carry
  30. RLCn    Rotate Left by n through Carry
  31. RRCn    Rotate Right by n through Carry
  32.  
  33. CNTB    Count the number of "1" bits
  34. SB    Set a bit
  35. CB    Clear a bit
  36. TB    Test a bit
  37. TOBIN    Convert an expression to a binary number.
  38. TOREAL    Convert an expression to a real number.
  39.  
  40. TRIMN    Trim N to the current word size.
  41. SWAPC    Swap the bottom bit of the current value with the carry bit.
  42. CARRY    The carry bit.
  43. alphaENTER    Our vectored Enter key.  This key checks to see if the
  44.         first character of the command string is a digit ("0"
  45.         through "9").  If so, it prepends a "#" character to the
  46.         command line.
  47.  
  48.         Note: The USER mode must be active for this to work.
  49.  
  50. HP-16C Functions Not Emulated:
  51.  
  52.     RMD
  53.     DBLR
  54.     DBL/
  55.     DBL*
  56.     1's mode
  57.     UNSGN mode
  58.  
  59. All other HP-16C functions exist in the HP-48SX (e.g., RR, RL, ASR) or
  60. are implemented in a better way in the HP-48SX (e.g., program
  61. control).
  62.  
  63. Checksum: #17d
  64. Size: 1420.5
  65. ------------------------------------------------------------
  66. %%HP: T(3)A(D)F(.);
  67. DIR
  68.   ON16
  69.     \<< -62 SF -63 SF
  70.     \>>
  71.   OFF16
  72.     \<< -62 CF -63 CF
  73.     \>>
  74.   BASE
  75.     \<< 9 MENU
  76.     \>>
  77.   LJ
  78.     \<< DUP
  79.       IF TOREAL
  80.       THEN TOBIN
  81.         DO RL DUP
  82.         UNTIL # 1d
  83. AND TOREAL
  84.         END RR
  85.       ELSE # 0d
  86.       END
  87.     \>>
  88.   MSKL
  89.     \<< TRIMN \-> n
  90.       \<< # 0d 1 n
  91.         START RR
  92. # 1d RR OR
  93.         NEXT
  94.       \>>
  95.     \>>
  96.   MSKR
  97.     \<< TRIMN \-> n
  98.       \<< # 0d 1 n
  99.         START SL
  100. # 1d OR
  101.         NEXT
  102.       \>>
  103.     \>>
  104.   RLn
  105.     \<< \-> X n
  106.       \<< X TOBIN 1 n
  107. TRIMN
  108.         START RL
  109.         NEXT
  110.       \>>
  111.     \>>
  112.   RRn
  113.     \<< \-> X n
  114.       \<< X TOBIN 1 n
  115. TRIMN
  116.         START RR
  117.         NEXT
  118.       \>>
  119.     \>>
  120.   RLC
  121.     \<< TOBIN RL
  122. SWAPC
  123.     \>>
  124.   RRC
  125.     \<< TOBIN SWAPC
  126. RR
  127.     \>>
  128.   RLCn
  129.     \<< \-> X n
  130.       \<< X TOBIN 1 n
  131. TRIMN
  132.         START RLC
  133.         NEXT
  134.       \>>
  135.     \>>
  136.   RRCn
  137.     \<< \-> X n
  138.       \<< X TOBIN 1 n
  139. TRIMN
  140.         START RRC
  141.         NEXT
  142.       \>>
  143.     \>>
  144.   CNTB
  145.     \<< 0 SWAP TOBIN
  146. 1 RCWS
  147.       START
  148.         IF DUP # 1d
  149. AND TOREAL
  150.         THEN SWAP 1
  151. + SWAP
  152.         END RR
  153.       NEXT DROP
  154.     \>>
  155.   SB
  156.     \<< # 1d SWAP RLn
  157. OR
  158.     \>>
  159.   CB
  160.     \<< # 1d NOT SWAP
  161. RLn AND
  162.     \>>
  163.   TB
  164.     \<< RRn # 1d AND
  165.     \>>
  166.   TOBIN
  167.     \<< \->NUM \-> X
  168.       \<<
  169.         IF X TYPE
  170. 10 \=/
  171.         THEN X RE
  172. R\->B
  173.         ELSE X
  174.         END
  175.       \>>
  176.     \>>
  177.   TOREAL
  178.     \<< \->NUM \-> X
  179.       \<<
  180.         IF X TYPE
  181. 10 ==
  182.         THEN X B\->R
  183.         ELSE X
  184.         END
  185.       \>>
  186.     \>>
  187.   TRIMN
  188.     \<< TOREAL ABS
  189. RCWS MOD
  190.     \>>
  191.   SWAPC
  192.     \<< DUP CARRY
  193. SWAP # 1d AND
  194. 'CARRY' STO SWAP
  195. # 1d NOT AND OR
  196.     \>>
  197.   CARRY # 0d
  198.   \GaENTER
  199.     \<< \-> X
  200.       \<< X 1 1 SUB
  201. NUM \-> Y
  202.         \<<
  203.           IF Y 48 \>=
  204. Y 57 \<= AND
  205.           THEN "#"
  206. X +
  207.           ELSE X
  208.           END
  209.         \>>
  210.       \>> OBJ\->
  211.     \>>
  212. END
  213.