Correct way of quitting from an Atom program....

discussion of games, software, hardware & emulators relating to the Acorn Atom
Post Reply
Prime
Posts: 2533
Joined: Sun May 31, 2009 11:52 pm
Contact:

Correct way of quitting from an Atom program....

Post by Prime » Sat Mar 31, 2018 3:38 pm

Hi all,

In porting the System disk utilities to the Atom, I have come across a small problem. The code that runs on the system will generally error out by calling the inline print routine and then executing a BRK :

Code: Select all

.QuitTooSmall
        JSR		INLINE_PRINT
        EQUS    "Destination too small"
	BRK
On the system this will return to the command interpreter loop, but on the Atom it seems to print an Error number and then hang :(
What would be the correct way of printing the error and then returning to basic?

Cheers.

Phill.

Prime
Posts: 2533
Joined: Sun May 31, 2009 11:52 pm
Contact:

Re: Correct way of quitting from an Atom program....

Post by Prime » Sat Mar 31, 2018 9:51 pm

Hi all,

To answer my own question, the fix is that on the Atom, the code needs to start at $2900, rather than $2800 for the System, otherwise the BRK causes a crash because basic can't exit cleanly to command mode.....it ends up looking for the end of the basic program in the middle of the loaded executable :(

Cheers.

Phill.

User avatar
hoglet
Posts: 7446
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol
Contact:

Re: Correct way of quitting from an Atom program....

Post by hoglet » Sun Apr 01, 2018 6:15 am

I think another way is to force a jump to #C2B2

(that is also the execution access of basic program created with SAVE)

That also sets PAGE (?18) to #29 and writes the 0D FF end of program marker. So pretty much the same as pressing BREAK.

The ROM disassembly is quite good for understanding this stuff:
http://www.acornatom.nl/atom_handleidin ... m/c000.txt

Start at C2B2....

Post Reply