14.2. Basic Upstart Program

To make the assembled machine code run on a C64 or in an emulator, it's useful to include a little basic program that starts your code (for example: 10 sys 4096). The BasicUpstart macro is standard macro that helps you to create programs like that. The following program shows how it’s used:

        *= $0801 "Basic Upstart"
        BasicUpstart(start)    // 10 sys$0810

        *= $0810 "Program"
start:  inc $d020
        inc $d021
        jmp start

TIP: Insert at basic upstart program in the start of your programs and use the –execute option to start Vice. This will automatically load and execute your program in Vice after successful assembling.

There is a second variation of the basic upstart macro that also takes care of setting up memory blocks:

BasicUpstart2(start)    // 10 sys$0810
start:  inc $d020
        inc $d021
        jmp start

If you want to see the script code for the macros, you can look in the autoinclude.asm file in the KickAss.jar file.