Re: [cc65] How can I cause the "FILE NOT FOUND" msg to print to screen usingexisting kernal or basic routines for the C64?

Date view Thread view Subject view

From: Michael McIntosh (michael_at_lifepod.com)
Date: 2003-02-13 16:28:38


Thanks for the suggestion. :) The initial size constraint I was running
into stopped being an issue after I removed a basic stub routine I wrote.
If an end-user used LOAD "*",8 (into basic memory at $801) instead of LOAD
"*",8,1 (into $2A7) I had code in place that would copy the entire program
from $801 to $2A7 and execute it from there. I probably freed around 20 to
30 bytes of the program. Your suggestion would probably shave off another
10 to 15 bytes, which would be very useful if someone planned to do
something more complex than load and execute a file.

Michael

+++ Codito, Ergo Sum +++

On Thu, 13 Feb 2003, Greg King wrote:

> -----Original Message-----
> From: Michael McIntosh
> Date: Tuesday, February 11, 2003, 03:07 PM
> >
> > I am writing a program that runs automatically upon loading by overwriting
> > the BASIC warm-start vector while loading, and causing it to execute code
> > at $02A7 when it finishes loading.  That code, in turn, loads another
> > program, and executes it.
> >
> > I have to write this code in assembly because I only have 89 bytes to work
> > with ($02A7-$02FF).
>
> You can make your program smaller by removing lines that are not needed:
>
>     ldx $ba ; get device # that loaded this program
>     ldy #1 ; (load at address that's stored in file)
>     jsr setlfs ; store numbers (Kernal call)
>     lda #(.strlen(PROGRAM_NAME)) ; get length of filename
>     ldx #<(_filename) ; set lower address of filename
>     ldy #>(_filename) ; set upper address of filename
>     jsr setnam ; set file-name (kernal call)
>     lda #0 ; set flag for load, not verify, operation
>     jsr load ; load program-file (kernal call)
>     bcc EXEC ; branch to execution if no load-error
>     jmp $e104 ; jump into C64 BASIC's error-routines
>
> EXEC:
>     jmp PROGRAM_ADDR ; jump to program's entry-point
>
> ----------------------------------------------------------------------
> To unsubscribe from the list send mail to majordomo_at_musoftware.de with
> the string "unsubscribe cc65" in the body(!) of the mail.
>

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo_at_musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.


Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2003-02-13 16:29:02 CET