// ============================================
// output - Disassembled Source
// ============================================
// KickAssembler syntax
// Generated by Restore 64 v0.2.1 alpha build 298, 2026-04-01 10:59:17
// https://restore64.dev by datucker / Rabenauge
//
// Load address: $0801  End: $0d8f  (1423 bytes)
// Entry point:  $0828 (via BASIC SYS 2088)
// IRQ handler:  $08fb (irq_08fb)
// IRQ handler:  $ea31 (loc_ea31)
//
// Code: 504 bytes, Data: 919 bytes
// Labels: 84, Subroutines: 3
//
// Cross-references: all OK
// ============================================


// --- Region $0809-$080f ---
.pc = $0809 "loc_0809"

loc_0809:
        sec
        sec
        .byte $14,$14                               // nop $14,x // ILLEGAL
        .byte $14,$14                               // nop $14,x // ILLEGAL

dat_080f:
        .byte $14                                   // .

// --- Region $0828-$0a1a ---
.pc = $0828 "main_0828"

main_0828:
        jmp loc_0842

dat_082b:
        .byte $85                                   // .

loc_082c:
        bpl loc_083b
        pha
        lda #$90
        pha
        ldx #$0e

loc_0834:
        lda txt_0813,x
        lsr
        ror
        clc
.label loc_083b = * + 1
        adc $10
        sta $10
        dex
        bne loc_0834
        rts

loc_0842:
        ldx #$c0

loc_0844:
        lda $0ccf,x
        sec
        sbc #$07
        sta $033f,x
        dex
        bne loc_0844
        lda #$28
        sta $d010
        ldx #$00
        stx $d017
        stx $d01d
        stx $d015
        stx $d01c
        stx $d020
        stx $d021

loc_0869:
        lda dat_0a1b,x
        sta $d027,x
        lda $0a21,x
        sta $07f8,x
        inx
        cpx #$07
        bne loc_0869
        ldx #$00

loc_087c:
        lda $0a27,x
        sta $d000,x
        inx
        cpx #$0c
        bne loc_087c
        lda #$03
        sta $d015
        lda #$33
        ldy #$0a
        jsr sub_0a07
        lda #$3f
        sta $d015
        jsr sub_08c7

loc_089b:
        ldy #$00

loc_089d:
        lda $da30,y
        and #$0f
        cmp #$02
        beq loc_08bf
        cmp #$01
        beq loc_08b7

loc_08aa:
        ldx #$90

loc_08ac:
        inx
        bne loc_08ac
        iny
        cpy #$78
        bne loc_089d
        jmp loc_089b

loc_08b7:
        lda #$02
        sta $da30,y
        jmp loc_08aa

loc_08bf:
        lda #$01
        sta $da30,y
        jmp loc_08aa
// Referenced by: jsr from $0898

sub_08c7:
        sei
        lda #$7f
        sta $dc0d
        ldx #$01
        stx $d01a
        inx
        stx $f9
        lda $0ccc
        sta $d012
        lda #$18
        sta $d011
        lda #$fb
        sta $0314
        lda #$08
        sta $0315
        cli
        rts

// Referenced by: jsr from $09b2, $09f2, $0a01
sub_08ec: {
        sta $af
        lda #$00
        sta $ae
loop:
        dec $ae
        bne loop
        dec $af
        bne loop
        rts
}

irq_08fb:
        lda $d019
        sta $d019
        and #$01
        beq loc_0923
        dec $f9
        bpl loc_090d
        lda #$01
        sta $f9

loc_090d:
        ldx $f9
        lda #$1b
        sta $d011
        lda $0cce,x
        sta $d016
        lda $0ccc,x
        sta $d012
        txa
        beq loc_0929

loc_0923:
        pla
        tay
        pla
        tax
        pla
        rti

loc_0929:
        ldy #$00

loc_092b:
        dec $0cce
        lda $0cce
        clc
        cmp #$ff
        bne loc_0976
        lda #$07
        sta $0cce
        ldx #$01

loc_093d:
        lda $0770,x
        dex
        sta $0770,x
        inx
        lda $db70,x
        dex
        sta $db70,x
        inx
        inx
        cpx #$28
        bne loc_093d
        ldx $f7
        lda $0b2c,x
        cmp #$ff
        beq loc_0972
        sec
        sbc #$05
        cmp #$40
        bcc loc_0964
        sbc #$40

loc_0964:
        sta $0797
        lda txt_0be4,x
        sta $db97
        inc $f7
        jmp loc_0976

loc_0972:
        lda #$00
        sta $f7

loc_0976:
        jsr $ffe4
        cmp #$00
        bne loc_0985
        iny
        cpy #$03
        bne loc_092b
        jmp $ea31

loc_0985:
        sei
        lda #$31
        sta $0314
        lda #$ea
        sta $0315
        lda #$08
        sta $d016
        lda #$f0
        sta $d01a
        lda #$81
        sta $dc0d
        cli
        lda #$3c
        sta $d015
        lda #$93
        jsr $ffd2
        ldx #$5e

loc_09ac:
        cpx #$1c
        beq loc_09d3

loc_09b0:
        lda #$02
        jsr sub_08ec
        inc $d004
        inc $d005
        dec $d006
        inc $d007
        inc $d008
        dec $d009
        dec $d00a
        dec $d00b
        dex
        bpl loc_09ac
        jmp loc_09e3

loc_09d3:
        lda #$ff
        sta $d006
        sta $d00a
        lda #$00
        sta $d010
        jmp loc_09b0

loc_09e3:
        lda #$0c
        sta $d015
        ldx #$30

loc_09ea:
        inc $d004
        dec $d006
        lda #$02
        jsr sub_08ec
        dex
        bpl loc_09ea
        lda #$9b
        ldy #$0c
        jsr sub_0a07
        lda #$c8
        jsr sub_08ec
        jmp $fce2
// Referenced by: jsr from $0890, $09fc

sub_0a07:
        sta $fd
        sty $fe
        ldy #$00

loc_0a0d:
        lda ($fd),y
        sec
        sbc #$03
        beq loc_0a1a
        jsr $ffd2
        iny
        bne loc_0a0d

loc_0a1a:
        rts

// ============================================
// Data blocks
// ============================================

// --- Region $0801-$0808 ---
.pc = $0801 "dat_0801"

dat_0801:
        // === BASIC loader stub ===
        .byte $23,$08                               // next line pointer ($0823)
        .byte $5b,$14                               // line number 5211
        .byte $9e                                   // SYS token
        .text " 20"                                 // SYS 2088 → main_0828

// --- Region $0810-$0827 ---
.pc = $0810 "Program $0810"
        .byte $14,$14,$14                           // ...

txt_0813:
        .text "DANISH CRACKERS"
        .byte $00                                   // string terminator
        .byte $00,$00,$00,$50,$42                   // ...PB

// --- Region $0a1b-$0d8f ---
.pc = $0a1b "dat_0a1b"

dat_0a1b:
        .byte $01,$01,$07,$07,$07,$07,$0d,$0e,$0f,$0f,$0f,$0f,$70,$4d,$b1 // ............pM.

txt_0a2a:
        .text "M!.9.!"
        .byte $ec,$39,$ec,$96,$11,$0b,$a2,$14,$14,$14,$14,$14 // .9..........

txt_0a3c:
        .text "##############"
        .byte $c4                                   // 'D' | $80 (end-of-string marker)
        .byte $d1,$cc,$d6,$cb                       // ....

txt_0a4f:
        .text "###"
        .byte $d5                                   // 'U' | $80 (end-of-string marker)
        .byte $c4,$c6,$ce,$c8,$d5,$d6,$10,$84,$14,$14,$14 // ...........

txt_0a5e:
        .text "################"
        .byte $d3                                   // 'S' | $80 (end-of-string marker)

txt_0a6f:
        .text "UHVHQWV"
        .byte $14,$14,$14,$14,$10                   // .....

txt_0a7b:
        .text "#########"
        .byte $15,$08,$af,$1f,$a5,$08,$a5,$1f,$a5,$08,$a5,$1f,$a5,$08,$a5,$1f // ................
        .byte $a5,$08,$a5,$1f,$a5,$08,$a5,$1f,$a5,$08,$a5,$1f,$a5,$08,$a5,$1f // ................
        .byte $a5,$08,$a5,$1f,$a5,$08,$a5,$1f,$a5,$08,$a5,$1f,$be,$10 // ..............

txt_0ab2:
        .text "#########"
        .byte $a4                                   // '$' | $80 (end-of-string marker)

txt_0abc:
        .text "####"
        .byte $ca                                   // 'J' | $80 (end-of-string marker)
        .byte $cb,$d2,$d6,$d7,$c5,$d8,$d6,$d7,$c8,$d5,$d6
        .text "####"
        .byte $15
        .byte $08,$a4,$10                           // ...

txt_0ad4:
        .text "#########"
        .byte $15,$08,$bf,$95,$1f,$a5,$08,$a5,$1f,$a5,$08,$a5,$1f,$a5,$08,$a5 // ................
        .byte $1f,$a5,$08,$a5,$1f,$a5,$08,$a5,$1f,$a5,$08,$a5,$1f,$a5,$08,$a5 // ................
        .byte $1f,$a5,$08,$a5,$1f,$a5,$08,$a5,$1f,$a5,$08,$a5,$1f,$15,$c1,$10 // ................
        .byte $14,$14                               // ..

txt_0b0f:
        .text "###############"
        .byte $9a                                   // .

txt_0b1f:
        .text "KLW"
        .byte $a3                                   // '#' | $80 (end-of-string marker)

txt_0b23:
        .text "DQ"
        .byte $5c                                   // backslash character
        .byte $a3                                   // '#' | $80 (end-of-string marker)
        .byte $4e,$48,$5c,$10,$03,$89,$88
        .text "25674"
        .byte $95
        .byte $25,$25,$25
        .byte $25,$25,$99                           // %%.

txt_0b3a:
        .text "MNX%UWTLWFR%"
        .byte $5c                                   // backslash character
        .text "FX%HWFHPJI"
        .byte $a5                                   // '%' | $80 (end-of-string marker)
        .byte $47,$5e,$a5,$89,$86,$93,$8e,$98,$8d,$a5,$88,$97,$86,$88,$90,$8a // G^..............
        .byte $97,$98,$a5                           // ...

txt_0b65:
        .text "NS"
        .byte $a5                                   // '%' | $80 (end-of-string marker)

txt_0b68:
        .text "6>=93"
        .byte $a5                                   // '%' | $80 (end-of-string marker)
        .byte $a5,$a5,$a5,$a5,$a5                   // .....

txt_0b73:
        .text "/////"
        .byte $a5                                   // '%' | $80 (end-of-string marker)
        .byte $a5,$a5,$a5,$a5,$a5,$89,$86,$93,$8e,$98,$8d,$a5,$88,$97,$86,$88 // ................
        .byte $90,$8a,$97,$98,$a5                   // .....

txt_0b8e:
        .text "NX?%"
        .byte $a5                                   // '%' | $80 (end-of-string marker)
        .byte $41,$41,$25,$99,$8d,$8a,$25,$8f,$94,$90,$8a,$97 // AA%...%.....

txt_0b9f:
        .text "%CC%%+%%AA%"
        .byte $8f,$4a,$51,$51,$5e                   // .JQQ^

txt_0baf:
        .text "KNXM%CC%"
        .byte $a5                                   // '%' | $80 (end-of-string marker)
        .byte $a5,$a5,$87                           // ...

txt_0bbb:
        .text "J"
        .byte $5c                                   // backslash character
        .text "FWJ"
        .byte $a5                                   // '%' | $80 (end-of-string marker)

txt_0bc1:
        .text "TK"
        .byte $a5                                   // '%' | $80 (end-of-string marker)

txt_0bc4:
        .text "NRNYFYNTSX&&&&"
        .byte $a5                                   // '%' | $80 (end-of-string marker)
        .byte $a5,$a5,$a5,$a5,$a5                   // .....

txt_0bd8:
        .text "/////"
        .byte $a5                                   // '%' | $80 (end-of-string marker)
        .byte $a5,$a5,$a5,$a5,$a5,$ff               // ......

txt_0be4:
        .text "GGGGGGGG     HHHHHHHHHHHHHHHH HHHHHHH"
        .byte $a0                                   // ' ' | $80 (end-of-string marker)

txt_0c0a:
        .text "HH"
        .byte $a0                                   // ' ' | $80 (end-of-string marker)

txt_0c0d:
        .text "GGGGGG"
        .byte $a0                                   // ' ' | $80 (end-of-string marker)

txt_0c14:
        .text "GGGGGGGG"
        .byte $a0                                   // ' ' | $80 (end-of-string marker)

txt_0c1d:
        .text "HH"
        .byte $a0                                   // ' ' | $80 (end-of-string marker)

txt_0c20:
        .text "HHHHH"
        .byte $a0                                   // ' ' | $80 (end-of-string marker)
        .byte $a0,$a0,$a0,$a0,$a0                   // .....

txt_0c2b:
        .text "EEEEE"
        .byte $a0                                   // ' ' | $80 (end-of-string marker)
        .byte $a0,$a0,$a0,$a0,$a0                   // .....

txt_0c36:
        .text "GGGGGG"
        .byte $a0                                   // ' ' | $80 (end-of-string marker)

txt_0c3d:
        .text "GGGGGGGG"
        .byte $a0                                   // ' ' | $80 (end-of-string marker)

txt_0c46:
        .text "HHH "
        .byte $a0                                   // ' ' | $80 (end-of-string marker)

txt_0c4b:
        .text "NN AAA AAAAA NN  N  NN AAAAAAAAA NN "
        .byte $a0                                   // ' ' | $80 (end-of-string marker)
        .byte $a0,$a0                               // ..

txt_0c72:
        .text "CCCCCC"
        .byte $a0                                   // ' ' | $80 (end-of-string marker)

txt_0c79:
        .text "CC"
        .byte $a0                                   // ' ' | $80 (end-of-string marker)

txt_0c7c:
        .text "CCCCCCCCCCCCCC"
        .byte $a0                                   // ' ' | $80 (end-of-string marker)
        .byte $a0,$a0,$a0,$a0,$a0                   // .....

txt_0c90:
        .text "EEEEE"
        .byte $a0                                   // ' ' | $80 (end-of-string marker)
        .byte $a0,$a0,$a0,$a0,$a0,$96,$14,$14,$14,$14,$14,$14,$14,$14,$14,$14 // ................
        .byte $14,$14,$14,$14,$a1                   // .....

txt_0cab:
        .text "#######"
        .byte $d7                                   // 'W' | $80 (end-of-string marker)

txt_0cb3:
        .text "KH"
        .byte $5c                                   // backslash character
        .text "#PDNH*HP/#"
        .byte $da                                   // 'Z' | $80 (end-of-string marker)

txt_0cc1:
        .text "H#EUHDN*HP1"
        .byte $03,$e1,$02,$0b,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07 // ................
        .fill 9, $07
        .byte $26,$06,$87,$38,$e7,$e7,$68,$e7,$3f,$68,$e7,$23,$68,$e7,$25,$68 // &..8..h.?h.#h.%h
        .byte $e7,$25,$38,$e7,$25,$20,$e7,$25,$08,$e7,$25,$08,$e7,$23,$08,$e7 // .%8.% .%..%..#..
        .byte $3f,$08,$e7,$e7,$08,$06,$87,$07,$07,$07,$07,$07,$07,$07,$07,$07 // ?...............
        .fill 17, $07
        .byte $46,$e7,$07,$f7,$7f,$07,$e7,$43,$08,$e7,$43,$08,$e7,$07,$08,$e7 // F......C..C.....
        .byte $07,$08,$e7,$07,$08,$e7,$07,$08,$e7,$07,$08,$e7,$43,$07,$e7,$43 // ............C..C
        .byte $07,$f7,$7f,$07,$46,$e7,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07 // ....F...........
        .fill 12, $07
        .byte $46,$c7,$f7,$6d,$68,$9f,$6d,$3a,$07,$6d,$3a,$07,$3d,$3a,$07,$0d // F..mh.m:.m:.=:..
        .byte $68,$9f,$0e,$c7,$f7,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07 // h...............
        .fill 14, $07
