12.6. Exporting Labels to other Sourcefiles

By using the –symbolfile option at the commandline it’s possible export all the assembled symbols. The line

java –jar KickAss.jar source1.asm –symbolfile 

will generate the file source1.sym while assembling. Lets say the content of source1 is:

.filenamespace source1
        *=$2000
clearColor:
        lda #0
        sta $d020
        sta $d021
        rts

The content of source1.sym will be:

.namespace source1 {
        .label clearColor = $2000
}

It's now possible to refer to the labels of source1.asm from another file just by importing the .sym file:

.import source “source1.sym”
jsr source1.clearColor