[Coco] Autostart binary

Robert Gault robert.gault at att.net
Tue May 3 07:33:09 EDT 2016


Arthur Flexser wrote:
> The simplest way to do it is not overwriting the stack, but rather
> overwriting one of Basic's vectors.  See the Color Basic Unravelled book
> (posted online) with its disassembly of Color Basic that shows where they
> are located, which is mainly addresses around $160 to $180 or thereabouts.
> These addresses get called by some elementary Basic functions like
> character out or file close, and are three bytes starting with a JMP
> opcode.  So you put a segment in the file that you want to autostart that
> overwrites this JMP with one to the preferred address within your program.
> So when Basic gets done loading your file and attempts to output OK or
> close the file, you are off and running.
>
> Art
>

What I frequently use is the vector at $16A by adding to source code
	org	$16A
	jmp	start

Robert




More information about the Coco mailing list