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