towson%amsaa@sri-unix.UUCP (02/24/84)
From: David Towson (CSD) <towson@amsaa> Ray - I know absolutely nothing about the c64, but I can tell you about a method of providing autostart that is used with the TRS-80, and can probably be used with the c64. After any command is executed and there is a return to the operating system command mode, what typically happens is that something will be written to the screen. Examples are: READY if you are in BASIC, and DOS READY if you are in DOS. In the TRS-80, the address of the screen-driver is kept in system-ram. That is, it is an alterable vector that is normally set at system initialization to point to a standard ROM routine, but which can be changed by the user if a custom screen-driver is installed. A character to be written to the screen is put into a processor register, and then a call is made to the screen-driver vector, which redirects the call to the actual driver. If during program load the start address of the program is substituted in the screen-driver vector for the address of the screen-driver, then when the load is complete and the OS tries to give you your prompt, the program just loaded gets called instead of the screen-driver, and presto, the program is off and running. Of course, the first things such a program must do are to clean-up the stack (because there's never going to be a return from that "call" to the "screen-driver"), and to restore a valid screen-driver address to the vector that was "borrowed" to accomplish the autostart. Neat, huh ? Dave towson@amsaa