[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Appl //c Basic



Scott Brown (browns@mackay.net.au) wrote:
: Hi
: I have made a bootable disk, that has the prodos.system and the basic.system
: files on it.  I am trying to write a login program for the disk as something
: to do.  I was wondering two things:

...Which I am going to respond to in reverse order.  It's simpler that way.

: 2.  How do i get the computer to run the program when it boots the disk?

Since you are using ProDOS, you need to name the program "STARTUP".  The
boot process begins by loading ProDOS.  Then ProDOS looks for the first
.system program on the disk, which happens to be BASIC.SYSTEM. 
BASIC.SYSTEM then looks for a program called STARTUP which it will load
and then run.

: 1.  Is there a basic command that will disable the control-reset function to
: get to the basic prompt?

No.  But there are some tricks you can use.

Once your program is running, you can play with the RESET vector located
in Page 3.  Where did I put that "Apple ][ Users Guide"...

...Doggone it I can't find it right now.  But you can reset the RESET
vector to point at any location in memory that you want...or you can just
reset the power-up byte so that on RESET the system will re-boot as though
the person had also pressed "Open-Apple".

Of course, that won't stop the user from pressing Ctrl-C and stopping your
program.  To do that you need to make sure that you have an ONERR GOTO
trap in there...that way pressing Ctrl-C will generate an Error #255 which
you can trap and recover from in your error handling routine.

That alone won't do it, though.  You see, if the user presses CTRL-C
before your program begins executing, it will never start running. 
Unfortunately there isn't much you can do about that.  You don't have that
problem if you write your program in Assembly and designate it as the
startup file (in ProDOS it has to be a .SYSTEM file, and I'm not sure what
the rules are for those).  Or, I suppose perhaps you could modify
BASIC.SYSTEM to trap the Ctrl-C and make sure the program starts first
before Applesoft gets a chance to see the keypress...

--Dave Althoff, ][.
-- 
    /X\        _       _               _  *** Now open every day! ***
   /XXX\      /X\     /X\_      _     /X\__      _     _        _____  
  /XXXXX\    /XXX\  _/XXXX\_   /X\   /XXXXX\    /X\   /X\      /XXXXX
_/XXXXXXX\__/XXXXX\/XXXXXXXX\_/XXX\_/XXXXXXX\__/XXX\_/XXX\_/\_/XXXXXX