15

I recently bought an Apple IIe at an auction. It was extremely cheap but worked. I have no experience with such old computers.

I just started the computer and wrote some BASIC programs for fun. Everything seemed to work fine (multiple times). I could save and load files.

Then I wanted to save a program (maybe 12 lines of code) and it took a lot of time when I entered SAVE. If I enter CATALOG it just returns a syntax error. Any idea how to diagnose the problem?

Giacomo1968
  • 449
  • 3
  • 9
Samuel
  • 151
  • 2
  • 3
    You may want to add information about the configuration. Like is that disk based or cassette. What drives, etc. – Raffzahn Oct 13 '22 at 02:36

1 Answers1

10

I wanted to save a program (maybe 12 lines of code) and it took a lot of time when I entered SAVE . If I enter CATALOG it just returns a syntax error.

You're using floppies and DOS. Right?

Because this sounds a lot like DOS being detached (*1). That means DOS is no longer active and hooked into command line processing. In that case, a SAVE command would by default save to cassette, which will take some time but other than that issue no further response.

Likewise typing any DOS command - like CATALOG - will lead to a Syntax ERROR, as BASIC does not know anything about Disks and DOS is not listening.

Detaching DOS may happen if RESET is pressed twice in fast succession.

After a single RESET DOS usually rehooks itself, but if a second RESET comes short enough it will be stopped from doing so.

With old machines this may as well happen due a bouncing reset key.

How to get out?

  1. Of course the most simple way would be classic help desk manner of switching the machine off and on again. Not gentle and not saving any work done.

  2. A bit more gentle might be issuing a PR#6 to reboot without switching off first - still all program and data is lost.

  3. Best would be of course to reconnect DOS (or PRODOS) by doing a CALL 978 ($3D2) (*2). If that works, all program and data should be still present and the computer work as before. If not Step 1 has to be taken.


*1 - Everything said about DOS works of course the same way for ProDOS.

*2 - Documentation often mentions calling -25153 ($9DBF) instead to reconnects, but that address only works with an unmodified DOS 3.3, so better use the official reconnect call.

Raffzahn
  • 222,541
  • 22
  • 631
  • 918
  • 1
    Could this be due to a bad connection to the memory chip containing proDos code? – UncleBod Oct 13 '22 at 04:56
  • 1
    @UncleBod Everything can be due bad memory, still, that behaviour is typical for pressing reset twice or a bouncing reset key. – Raffzahn Oct 13 '22 at 10:26
  • 6
    Just in case it wasn't completely clear, it's important to know that DOS wasn't 'part of the OS' or 'burned into ROM' - DOS was loaded from the floppy disk when you boot the computer. As such, it hangs around in a specific block of RAM and 'hooks' itself into the command interpreter. If DOS gets 'unhooked' (or never loaded in the first place) then DOS commands like CATALOG aren't going to work. – Geo... Oct 13 '22 at 14:31
  • 1
    Follow-up question, re: double-reset disconnect: https://retrocomputing.stackexchange.com/q/25393/56 – fadden Oct 13 '22 at 20:42
  • @fadden Lovely! I'm already curious about what answers will show up :)) – Raffzahn Oct 13 '22 at 21:11
  • 1
    The most common cause of disconnects, from my experience, was using the PR# command built into BASIC. DOS has its own PR# command, which must either be typed directly from the keyboard or printing it it between a chr$(4) and chr$(13). A program that attempts to activate an 80-column card via PR#3 rather than PRINT CHR(4);"PR#3", for example, will disconnect DOS. – supercat Oct 13 '22 at 22:14
  • @supercat true that. – Raffzahn Oct 13 '22 at 22:28
  • 1
    Ah, reset DOS hooks on Apple II; haven't thought about that one in almost forty years. – Kaz Oct 14 '22 at 01:37
  • The poster said CATALOG resulted in a syntax error, but SAVE did not. If DOS were detached, wouldn't SAVE also cause a syntax error? – bmow Oct 25 '22 at 00:22
  • @bmow Why? SAVE is (like LOAD) not only a Command in DOS, but as well valid command for BASIC without DOS - how else would one save a program to cassette? If DOS is active, it catches SAVE and redirects it to saving on disk. if DOS is not present (or unhooked), the ROM save routine takes over, playes some sound on the cassette port, which takes some time, and then returns without any further message to command prompt. Exactly the behaviour described. – Raffzahn Oct 25 '22 at 00:50