home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / sys / hp48 / 4441 < prev    next >
Encoding:
Internet Message Format  |  1992-09-01  |  2.4 KB

  1. From: akcs.joehorn@hpcvbbs.cv.hp.com (Joseph K. Horn)
  2. Date: Tue, 1 Sep 1992 10:40:02 GMT
  3. Subject: Re: Modest Diversion for Programmers
  4. Message-ID: <2aa33c40.1627.3comp.sys.hp48.1@hpcvbbs.cv.hp.com>
  5. Path: sparky!uunet!usc!sdd.hp.com!hp-cv!hp-pcd!hpcvra!rnews!hpcvbbs!akcs.joehorn
  6. Newsgroups: comp.sys.hp48
  7. References: <2a9f465b.1627comp.sys.hp48@hpcvbbs.cv.hp.com> <715187422snx@dmhh.h
  8. Keywords: splat
  9. Lines: 41
  10.  
  11. +------------------------------------------+
  12. | SIXTEEN NEW USER-DEFINABLE OBJECT TYPES! |
  13. +------------------------------------------+
  14.  
  15. Erik Naggum (enag@ifi.uio.no) writes:
  16.  
  17. > | %%HP: T(1)A(R)F(.); @ SPLAT by Joe Horn
  18. > | "D9D20E1632C2A20600000DBBF176BA13CE22F88E178BF19D1A1DBBF18DBF13AB
  19. >              ^^^^^^^^^^^
  20. > | B1F88E1AFE22D9D20ED2A2FDAA14E5A1C58C1B21305DF2293632B21302FE4"
  21. >
  22. > The above highlighted sequence represents a string object with only
  23. > one nibble (or half a character).  Can the same string object be
  24. > produced in USER RPL?  (If so, it's probably an unwanted side
  25. > effect, but it would be interesting to know.)
  26.  
  27. Sure:  ""  #3FF9h  SYSEVAL  #61C1Ch  SYSEVAL.   :-)
  28.  
  29. Seriously, heavy programmers should consider using odd-nibble-length
  30. strings.  The idea has been around for many years.  For example, the
  31. HP-41's RCLFLAG extended function placed a "string" on the stack.  But
  32. it was a strange sort of string that the STOFLAG and X<>F functions
  33. magically recognized and allowed as input, while rejecting "normal"
  34. strings.  They recognized RCLFLAG's output because HP cleverly stored
  35. a hex F in the second nibble (which was ordinarily just a 0).  This
  36. left it a valid string (so you could store it), but "tagged" it as
  37. output from RCLFLAG, a fact that only STOFLAG and X<>F looked for.
  38. HP's purpose was obvious: they didn't want users accidentally using a
  39. normal text string as input to STOFLAG, because that would scramble
  40. the system flags, probably with disastrous consequences.
  41.  
  42. Perfect application for this: solve the RF problem.  Append the
  43. two-byte CRC at the end of the string, and then a single magic nibble
  44. as an "RF object tag" (say, F).  RFU could then tell in an instant
  45. whether its input really came from RFP or not; nothing else in the
  46. world creates odd-nibble-length strings that end in F!
  47.  
  48. And that would leave 15 other "object types" (String+0 through
  49. String+E) for other highly input-sensitive programs to define.
  50.  
  51. -Joe Horn-    -just another late-night brainstorm-
  52.  
  53.