HP 2000 BASIC help / TREK73

From: John K. <john3000_at_cox.net>
Date: Tue Nov 11 00:27:28 2003

Hi Pete,

At 2003-11-10 04:17 PM, Pete Turnbull wrote:
>I need some help with some HP 2000 BASIC. I probably last used it
>around 1980, and not often even then for somehow the PDP-8s looked more
>attractive than the grey HP box in the same room. Yeah, I know better
>now. Luckily, I'm sure some of you can help me out...
>
>I've been retyping TREK73 from a fairly poor-quality listing, and it
>needs a sanity check. Also I'd like to learn a bit more about what I'm
>typing. This is the original source for the Star Trek program by
>William Char and friends, and what I've typed so far is on my Star Trek
>web page at http://www.dunnington.u-net.com/public/startrek/
>
>I've added some other stuff to that page, too.
>
>Questions:
>
>All the lines have two spaces between the line number and the code.
> All, that is, except for a few that have an '_at_' in place of the second
>space. Is that significant (does it mean "ignore this" or something?)
>or is it just an artifact of a noisy Teletype line? (The listing
>appears to have been made on a Teletype, which needed a new ribbon and
>a better platen roller.)
>
>What does '14 in a PRINT statement, in front of a quoted string, mean
>(eg in PRINT '14"SULU")? I wondered if it were something like PRINT
>TAB(14)"... but there are TAB()s elsewhere. A control character,
>perhaps? If cursor or screen control, are they octal or decimal (I'd
>guess decimal) and is there a table anywhere?

HP 2000 BASIC placed printing characters inside double-quotes (") and used
the apostrophe notation for non-printing characters. The apostrophe was
followed by the decimal value of the character that belonged at that point
in the string. Thus, any character in the extended ASCII character set
could be expressed using the apostrophe notation ('0 through '255). Below
is a brief table of some of the more common values I used to use.

Apostrophe Replacement
  Notation Character
     '0 Nul
     '7 Bel (CTRL-G)
     '8 Backspace (CTRL-H)
     '9 Horizontal Tab (CTRL-I)
     '10 Line Feed (CTRL-J)
     '13 Carriage Return (CTRL-M)
     '14 Shift Out (CTRL-N)
     '15 Shift In (CTRL-O)
     '17 DC1 (CTRL-Q) Start Paper Tape Reader
     '19 DC3 (CTRL-S) Stop Paper Tape Reader
     '34 " (Double-Quote)

The '14 was used to instruct an HP terminal (probably an HP2640, HP2645, or
near the end of support for the HP2000 ACCESS, the HP2621 and HP2624) to
switch to the alternate (usually line drawing) character set. The '15 was
used to switch back to the normal character set.

If you have access to an HP terminal (or HP terminal emulation like
Reflection [many dollars] or QCTerm [free from www.aics-research.com])
connected to an HP 2000 then enter:

100 PRINT '14"Q;;;#;;;W"'15
110 PRINT '14": - :"'15
120 PRINT '14"!,,,/,,,"'34'15
130 PRINT '14": - :"'15
140 PRINT '14"A;;;$;;;S"'15
150 PRINT
160 PRINT '14" ZXC"'15
170 PRINT '14" ZXCCCC"'15
180 PRINT '14"ZXCCCCCCC"'15
RUN

What do you see? Lines 100 through 140 display a box with a heavy exterior
line and fine interior lines which divide the box into four quardrants. If
you change lines 110 through 130 to:

110 PRINT '14": :"'15
120 PRINT '14"! ,/, "'34'15
130 PRINT '14": :"'15

you have a box with a fine cross-hair in the center.

Lines 160 through 180 display a stair step. This was used for "guages" in
later Star Trek and similar programs. Using a "Z" line drawing character
gave a block about 1/3 the height of a display row. A "X" line drawing
character gave a block about 2/3 the height of a display row, and a "C"
gave a line drawing character the full height of a display row.

Thus, if you see '14 and '15 in the program listing, the program display is
most likely designed for display on an HP terminal. Again, if you don't
have a "real" HP terminal, try using an emulation. A free emulation
(QCTERM) is available from www.aics-research.com.

A description of the ENTER statement has already been given, so I won't
address that here.

BTW, some day I'll get my set of HIB tapes back from the person who
borrowed them (you know who you are! consider this nagging!) as there were
many games and programs from HP 2000 ACCESS vers. 1812 on that tape set
(which dates from Jan. 1984). I'd love to see them run again.

John K.

>What exactly do the first two parameters to the ENTER command do? They
>always seem to have three variables (eg ENTER T2,T,X$).
>
>That'll do for now :-)
>
>If anyone would like to proofread what I've retyped so far (about half
>the total) and check for obvious sillies, please do - especially in
>TREK0 around line 740 (cf line 840). Better still, if anyone is
>willing to actually try this out, please do! though it won't work very
>well with half of it missing.
>
>--
>Pete Peter Turnbull
> Network Manager
> University of York
Received on Tue Nov 11 2003 - 00:27:28 GMT

This archive was generated by hypermail 2.3.0 : Fri Oct 10 2014 - 23:36:18 BST