Help with Benton Harbor BASIC

42 views
Skip to first unread message

Joe Travis N6YPC

unread,
Sep 28, 2021, 9:19:13 AMSep 28
to SEBHC
Greetings All,

I recently acquired a "dead" H8 and was able to troubleshoot / repair / upgrade it into working condition.  I thought it would be fun to write a Morse Code program in Benton Harbor BASIC that uses the front panel speaker of the H8.  It's been 40+ years since I've run HDOS, let alone BH BASIC.

However, it seems I'm having an issue trying to run BH BASIC on the H8 or my H89s.  When I run from the command prompt, it displays the sign on message and crashes:

Extended Benton Harbor BASIC #110.06.00

?02 FATAL SYSTEM ERROR ?

I've tried with / without arguments on the command line e.g. BASIC ROCKET.BAS or BASIC "ROCKET.BAS", etc., all with the same results.  Does anyone have any thoughts on what's happening?   Thanks for your help / suggestions!

Regards,
Joe Travis n6ypc

Glenn Roberts

unread,
Sep 28, 2021, 9:56:07 AMSep 28
to se...@googlegroups.com

The first thing that comes to mind is memory.  How much RAM do you have?  Have you run any memory tests?  Are you using older RAM boards or something more modern?

--
You received this message because you are subscribed to the Google Groups "SEBHC" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sebhc+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sebhc/5a15c0db-e0e0-4825-b0ca-d51941e55e54n%40googlegroups.com.

Joe Travis N6YPC

unread,
Sep 28, 2021, 10:05:59 AMSep 28
to SEBHC
Thanks for your response Glenn.  There is 64K in each of the computers but, BH BASIC can run in as little as 24K.

PROBLEM SOLVED!
I just discovered the answer,  I had the floppy disk write protected.  I knew it was something stupid/simple that was causing the problem, I just couldn't remember what it was.  BH BASIC attempts a write to disk (don't know why) when it starts up.  It kinda reminds me of the issue of running DDT in CP/M without passing it a filename on the command line.

Glenn Roberts

unread,
Sep 28, 2021, 10:16:19 AMSep 28
to se...@googlegroups.com

Awesome!  FYI there are a few Morse code apps in the HUG library, but none in BASIC that I could find, in case you’d like to see an example or two.

 

885-1032 and 885-1052 on Les’ site.

https://sebhc.github.io/sebhc/software/Applications/H8DCATALOG_VOL1.HTML

 

if you don’t have an ability to pull files from the archive I’m happy to extract these and send to you.  perhaps you can make a video once you get this working. good luck!

Tom Wilson

unread,
Sep 28, 2021, 10:56:23 AMSep 28
to se...@googlegroups.com
I remember a BH Basic program that keyed the transmitter for morse code
as you typed using the reed relay in the H8-5.

Tom

glenn.f...@gmail.com

unread,
Sep 28, 2021, 11:38:43 AMSep 28
to se...@googlegroups.com

Cool idea.

 

Joe: if you’re interested, I did find a couple BH BASIC morse code apps in HUG Volume I listings.  But you may prefer the challenge of starting from scratch!  Happy to scan those pages if useful to you…

 

From: se...@googlegroups.com <se...@googlegroups.com> On Behalf Of Tom Wilson
Sent: Tuesday, September 28, 2021 10:56 AM
To: se...@googlegroups.com
Subject: Re: [sebhc] Help with Benton Harbor BASIC

 

I remember a BH Basic program that keyed the transmitter for morse code

Joseph Travis

unread,
Sep 28, 2021, 1:00:26 PMSep 28
to se...@googlegroups.com
Thank you all very much!  As I mentioned, I just got the H8 going this past weekend and am "refreshing my memory" from years gone by.  I learned BASIC 40+ years ago and very quickly went to assembly language, then C and never looked back.  I (unintentionally) started collecting vintage computers a few years ago with Heathkits being my favorite since my first job (after leaving the Navy) was working for Heathkit.

Anyways, I got a bug to write a program for each computer that I own and it has commonly become a Morse Code Tutor.  I've ported it to 8-9 different computers thus far.  I started to do one for the H8 with MBASIC on CP/M and discovered that I can't (easily) access the front panel speaker so I decided to try it with BH BASIC on HDOS instead.  I may add support for keying with the H8-5 as well, I'll see how it goes.

Thanks again!

Regards,
Joe Travis n6ypc


Joseph Travis

unread,
Sep 28, 2021, 6:15:12 PMSep 28
to se...@googlegroups.com
Hey Glenn, that would be great!  It would save me time reverse engineering the address decoding for the front panel.  Thanks again!

Regards,
Joe Travis n6ypc


Glenn Roberts

unread,
Sep 29, 2021, 11:27:25 AMSep 29
to se...@googlegroups.com

Joe: attached are three Morse Code programs written in BH Basic. These were published in “HUG Software Volume I” back when HUG first began.  These would have been for an early tape version but should be mostly or completely compatible with the HDOS version.

 

Not sure if any of these use the front panel LEDs but if useful you could consult my article “Putting the H-8 LEDs to work” in REMark issue 40 (p. 41)

http://pestingers.net/pdfs/remark-scans/1983/remark-issue40-1983.pdf  I have a simple example BASIC program in there…

 

good luck!

 

  • Glenn
MORSE CODE - BAXTER.pdf
INTERNATIONAL MORSE CODE - REYES.pdf
CODE SPIES BASIC program.pdf

Joseph Travis

unread,
Sep 29, 2021, 3:02:19 PMSep 29
to se...@googlegroups.com
Thank you very much Glenn!  Each is interesting in their own way.  The first one implements an assembly language routine for the speaker tones, the second was written on an H11 and is visual only and the third was definitely written for BH BASIC as it is using pokes that allows the ROM routines to do the work.

I'm surprised that I hadn't recognised your name before, as I do remember that article in REMark.  I'm going to go back to MBASIC for my attempt at this program.  For some reason, I was thinking the front panel was memory mapped instead of I/O mapped.  It is probably due to the corrupted PAM37 ROM listing I downloaded from the SEBHC website.  I was able to find the HORN routine and saw that it was writing to memory instead of I/O.  I started to reverse engineer the front panel mapping last night and discovered it is in fact I/O mapped at 360Q and 361Q (I'm old and suffer from occasional memory errors).

Glad to hear the H9 is up and running!  I wasn't very fond of them when I had to service them back in the day but they grew on me.  BTW - There was an article published in DDJ years ago that added lower case capabilty to the H9.  If I run across it, I'll send it to you.  Thanks again!

Regards,
Joe Travis n6ypc


Douglas Miller

unread,
Sep 29, 2021, 3:07:24 PMSep 29
to se...@googlegroups.com

If you're running in an environment where the ROM is still controlling the display (I presume HDOS does), then the best way to manipulate the display and beep is to use memory (display) and ROM call (horn). Directly accessing I/O ports is just going to conflict with the ROM.

Glenn Roberts

unread,
Sep 29, 2021, 4:34:06 PMSep 29
to se...@googlegroups.com

Well, most of what you want to do can probably be done via PEEK/POKE.  The front panel is I/O mapped but all of the functionality is managed by the 2ms clock interrupt routine, which constantly checks certain documented locations in RAM to determine what to do (e.g. should I refresh the front LEDs or keep them dark, what is the bit pattern to display in each of the 9 locations, etc.)

 

Take a look at the REMark article for a refresher and post back here if you have any questions.

 

As for the H9… I have no love for this beast, but it is an important part of the Heathkit computer evolution (I understand the H10 paper tape reader/punch is even more fun to get working reliably!?).

 

I think I’ve achieved my goal which is to be able to demonstrate what heathkit computing was like in 1977/78.  There is still an issue with the H9’s cursor: when the cursor is in column 0 or 1 there is a “duplicate” cursor over to the right (10 spaces I think?).  similar behavior occurs in other columns, though sometimes the “ghost” cursor is to the left.

 

I did spend an hour or so reading the manual, looking at the schematics and replacing some chips but did not manage to track this down.  I can’t afford to spend any more time on this now.  For now I can do a demonstration, and hopefully the duplicate cursor won’t be too much of a distraction! 

 

For the VCF demo this machine will serve several purposes:

 

1. download and run the tape utilities (TED, DBUG, HASL, BHBASIC) using a laptop to emulate the tape drive. show a BASIC program or two, and possibly show how to edit and assemble a small program back then.  This is ca. 1977 functionality.

 

2. run HDOS (rev 1.5!) using a single H17 drive system. Maybe show a BASIC program from the HUG book (if your morse code program is done before then [ 8 Oct] I could demo that too!)  the H17 came out in the fall of ’78.

 

3. Demonstrate the front panel functionality via PAM-8.  This machine has the large slave LED display which should be fairly visible in the room.  I have some “eye candy” software that I can run on that to attract attention …  there were also some early HUG programs that could run on a stand alone machine (e.g. chess timer, chase the blip, stuff like that).

 

4. Demonstrate the early experiments with music.  I have a number of music programs I can run on this.  these used the internal H8 speaker and required a slight mod (bend out pin 9 on IC 112 ) to work.

 

Picture:

https://photos.app.goo.gl/g9Q9s6DgbdfWeiTe8

Joseph Travis

unread,
Oct 1, 2021, 1:07:50 PMOct 1
to se...@googlegroups.com
Attached is the first iteration of the Morse Tutor program for BH BASIC.  MORSE2TR.BHB is an ASCII text file you can download to BASIC using TeraTerm or any similar terminal program.  Running at 9600 baud, I had to throttle the download by 1mS / character and 100mS / line so BASIC could keep up.

Unfortunately BH BASIC's CIN(0) is not quite the same as INKEY$ or GET$ used in other BASICs.  CIN(0) immediately returns -1 if no character is available (from the keyboard) but it requires a <CR> before it returns a typed character and then you have to read the <CR> as well (which is translated to <LF> and displays both on the screen).  I wish I knew of a PEEK in BH BASIC that allowed me to read a character without having to wait for <CR>.

I hope that you find it to be entertaining and educational.

Regards,
Joe Travis n6ypc


MORSE2TR.BHB

Douglas Miller

unread,
Oct 1, 2021, 1:16:54 PMOct 1
to se...@googlegroups.com

Not sure what you're using as a terminal for the CIN(0), but some of the clients buffer input by default, only sending when RETURN/ENTER is pressed. You might check the settings on the terminal program, making it unbuffered. That also might change the behavior of adding the <LF> to the <CR>.

Joseph Travis

unread,
Oct 1, 2021, 4:18:42 PMOct 1
to se...@googlegroups.com
BTW - You can edit the program lines 215 and 235 to include OUT commands to control relay RL102 on the H8-5 Serial I/O and Cassette interface board. The relay connections are on P101, pins 4 & 5.  The new program lines should be:

215 POKE 8201,Q AND 127:OUT 249,32:REM SOUND ON
235 POKE 8201,Q OR 128:OUT 249,0:REM SOUND OFF

Regards,
Joe Travis n6ypc




You received this message because you are subscribed to a topic in the Google Groups "SEBHC" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sebhc/2-rRgwwv_iY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sebhc+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sebhc/d2c407a8-bf9b-671c-9950-49984c52c4d4%40gmail.com.

glenn.f...@gmail.com

unread,
Oct 3, 2021, 8:32:32 PMOct 3
to se...@googlegroups.com

Joe: nice job!  I was able to save this file (remember to save it in “UNIX” format, “NL” for end of line, not CR/LF) and then use the BASIC “OLD” command to open it.  Ran fine.  Initially I forgot and ran it at 10Mhz CPU speed -you want a Morse code challenge, that’s it!

 

The reason CIN(0) requires a line feed is not internal to BASIC, it’s an HDOS issue.  Here’s the code for CIN:

 

 

So it’s really just calling .SCIN.  but normally HDOS will buffer console input so that you can make corrections (e.g. backspace).  To disable that I believe you need to call .CONSL (see Heath_595-2553-02_HDOS_System_Programmers_Guide.pdf (sebhc.github.io) p. 22) and tell the console to operate in “Character Mode”.  But I couldn’t find any way to add machine code calls to BHBASIC (you can do this in MBASIC)  so I’m stumped, at least for the moment, on how to do this.  I bet there’s an answer out there…

 

A few suggestions:

 

  • Find a way to allow the user to interrupt.  Perhaps use CNTRL 0 to add a ^B handler.  I found myself interrupting via ^C which just  crashes the program.  Also in one case it left the speaker in the “ON” mode…
  • Add an “EXIT” option to your main menu
  • Were you going to add the front panel LEDs to the mix? How’s that going?

 

Good work…

image001.png
Reply all
Reply to author
Forward
0 new messages