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: Greg King (gngking_at_erols.com)
Date: 2003-02-13 08:43:11


-----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.


Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2003-02-13 10:27:20 CET