Saving B.A.S.I.C. programs while in CP/M using MBASIC

1,082 views
Skip to first unread message

wve...@aol.com

unread,
Aug 31, 2018, 7:04:57 PM8/31/18
to Altair-Duino
Hi,
I would like to save and load some B.A.S.I.C.programs using my Altairduino but can’t seem to do it😥. I first loaded CP/M, then MBASIC, then entered a short program to print “HELLO WORLD” over and over. I used the switch combinations as outlined on the Altair 8800 Simulator manual page 5. No luck😕. I am able to load and run all the programs listed in the A> directory both .bas and .com but when I try saving my own programs no luck. I hope someone can outline the proper procedure for me.
Many thanks,
Wayne

Juan Orlandini

unread,
Aug 31, 2018, 7:38:14 PM8/31/18
to Altair-Duino
You probably want to use the BASIC command SAVE. In your case type in:

SAVE “hello.bas”

Then when you want to run it again, use the BASIC command LOAD:

LOAD “hello.bas”

wve...@aol.com

unread,
Sep 1, 2018, 8:31:06 PM9/1/18
to Altair-Duino
Hi Juan,
Tried what you suggested but it didn’t work.
Thanks anyway,
Wayne

Tom Lake

unread,
Sep 2, 2018, 1:02:44 PM9/2/18
to Altair-Duino
It should have worked. Did you get an error message? If so what message? Don't give up! We'll help you any way we can but we're not there to see exactly what you're doing or what happens so you'll have to describe the entire process in great detail so we can get an idea of what's going on.

minwa...@gmail.com

unread,
Sep 4, 2018, 8:16:27 PM9/4/18
to Altair-Duino
I have just received & built an Altair-Duino kit and have the same issue. The steps I have done sound the same as the OP:
  • Boot the CP/M floppy
  • Run MBASIC
  • Type short program
  • SAVE"TEST.BAS" (no error)
  • Quit MBASIC
  • DIR - TEST.BAS is not listed
Interestingly if I save the file twice in a row with the same filename, the second time I get 'Bdos Err On A: R/O' - almost as if the file was saved correctly the first time. Loading existing .BAS files works as expected.

I also have issues saving other things, so not isolated to MBASIC:
  • SAVE in Zork 1 floppy gives 'Bdos Err On A: R/O' error.
  • SAVE in Zork 1 on HDD does not error, but file is not present when DIR-ing.
  • Formatting a disk returns:
'ERROR OCCURRED ON TRACK 0 SECTOR 5
BAD SECTOR - SUGGEST FORMATTING OR
DISGARDING THIS DISKETTE'

I can write to the SD card in a computer (Mac specifically), and I've also been able to delete files from the SD card using the 'File Manager for SD Card' in the Configuration menu. I've checked that the files are not read-only.

I'm new to this so not sure what else to check. Everything else I've tried so far works as expected. Any advice much appreciated!

Udo Munk

unread,
Sep 4, 2018, 10:53:49 PM9/4/18
to Altair-Duino
This is exactly what happens if the disk image is write protected.
The 88-DCDD has no status bit for disk R/O, so it is not possible
to return this information from the BIOS to the BDOS.

If you write a file to a write protected disk, lets say:
save 4 b:dump.com
it will return without errors, but the file of course won't show
with dir. If you try to write another file to the disk now the
directory checksum will be wrong and now you'll get a R/O
error. And formatting of a disk also won't work starting at
track 5, because from there the bits are verify after each
track written.

Put the SD card into an OSX machine and show us
ls -la /Volumes/whatever_name

Mark Moulding

unread,
Sep 5, 2018, 12:52:15 AM9/5/18
to Altair-Duino
I wonder if you're havcing the same problem I had with the AltairDuino I built a few weeks ago.  The build of the firmware I had wouldn't write at all to the SD card.  Furthermore, when I tried to rebuild it from the sources on GitHub, the resulting build was also bad; finally, I received a copy of the pre-built binaries that I installed, and it worked fine thereafter.

Do you know if you can write *anything* to the SD card?  A few things to try are:

- Under CP/M, try SAVE 1 JUNK.COM
- Within the AltairDuino "monitor", try to change the configuration (serial port baud rate, for example, or default AUX-1 UP action, and see if that sticks

If neither of these work, then I'd bet that you're facing the same issue that I did.  Note that everything else seemed to work fine - it's just as though the Micro-SD card was memory-protected, except that those cards don't have the "protect" "switch"...
~~
Mark

minwa...@gmail.com

unread,
Sep 5, 2018, 3:21:52 AM9/5/18
to Altair-Duino
Thanks for your reply! Here is the output of ls -la. Looks ok to me?

Screen Shot 2018-09-05 at 08.19.57.png

minwa...@gmail.com

unread,
Sep 5, 2018, 3:33:53 AM9/5/18
to Altair-Duino
SAVE 1 JUNK.COM doesn't seem to do anything in CP/M - file not visible with a DIR. I didn't realise before but making a change in Configuration, and saving, doesn't error, but when I load the config back, the changes are not there.

I am able to delete files using the 'File Manager for SD Card', but that is the only write action that seems to work.

I did read your thread on the similar issue and wondered if it might be the same thing. Perhaps I should try the solution from David Hansel which seemed to work for you...

Many thanks!

Udo Munk

unread,
Sep 5, 2018, 6:31:19 AM9/5/18
to Altair-Duino
The ls looks OK, all files have write permission set, so the reason why files can't be
written is elsewhere. The behaviour under CP/M is normal if the disk can't be written,
this is because the hardware cannot detect that bytes written aren't on the disk. You
would see the same on a real Altair with a write protected disk.

minwa...@gmail.com

unread,
Sep 5, 2018, 1:59:07 PM9/5/18
to Altair-Duino
OK so just to confirm, it seems I did have the same problem as Mark. Flashing the Arduino using the instructions from David Hansel from the following thread did the trick:


Hope this helps the OP and others. Thank you for the replies!

Lee Emerick

unread,
May 7, 2019, 10:39:00 AM5/7/19
to Altair-Duino
Juan,

This worked for MBASIC under CP/M on RC2014 using the compact flash adapter. Many thanks!

Frank P.

unread,
May 7, 2019, 12:01:26 PM5/7/19
to Altair-Duino
Beware that when saving from MBASIC running under CP/M (at least on hard disk; I haven't tried it on a floppy) the following 2 save commands produce two different files on the disk:
SAVE "MYPROG.BAS"
SAVE "myprog.bas"

It's the only instance I've seen under CP/M so far where case-sensitive filenames can be created. Likewise, deleting those two files from MBASIC requires:
KILL "MYPROG.BAS"
KILL "myprog.bas"

Tom Lake

unread,
May 7, 2019, 6:07:29 PM5/7/19
to Altair-Duino
I know I'm being pedantic but BASIC is BASIC and not B.A.S.I.C. The words "Beginners All-purpose Symbolic Instruction Code" didn't come until after BASIC was used as a name - sort of a retrofit. That reminds me of one time I was in a computer store and someone came in and asked the clerk if a particular comm package supported A-S-C 2. His eyes lit up, knowing he could sell them anything! I chuckled and they asked what was so funny. I explained that the II in ASCII is not the Roman numeral II. The word stands for American Standard Code for Information Interchange and is pronounced ASKEE. 

Tom L

C64 C64

unread,
May 25, 2019, 7:46:47 AM5/25/19
to Altair-Duino
A nearby electronics superstore had a salesman who could explain the difference between "Scasi" and SCSI. Also he could physically show you the Front-Side-Bus and demonstrate how convenient it is to plug in mice and keyboards with the new square plugs.

I have asked him if they happen to have a Cray-3 in stock and he told me to come back after Christmas when they receive new stock.

Reply all
Reply to author
Forward
0 new messages