;---------------------------------------
;Cross asm client
;v1.0 (c) BruSH/ElysiuM
;---------------------------------------

addy     = $fb
licz     = $fd
ktory    = $fa
runad    = $f8


         *= $1000

start    sei
         lda #$37
         sta $01
         jsr $e518
         jsr $fd15
         jsr $fda3
         lda #<start
         sta $0318
         sta $fffa
         lda #>start
         sta $0319
         sta $fffb
         lda #$00
         sta $d011
         sta $dd03
         ldx #$00

         lda $dd02
         ora #$04
         sta $dd02
         lda #$fb
         and $dd00
         sta $dd00

next     jsr get
         sta addy
         jsr get
         sta addy+1

         cpx #$00
         bne om1
         sta runad+1
         lda addy
         sta runad
         inx

om1      lda addy+1
         bne om2
         lda addy
         beq startit

om2      jsr get
         sta licz
         jsr get
         sta licz+1

         ldy #$00

om5      jsr get
         sta (addy),y
         inc $d020
         inc addy
         bne om3
         inc addy+1

om3      lda licz
         bne om4
         dec licz+1
om4      dec licz

         lda licz+1
         bne om5
         lda licz
         bne om5
         beq next

;---------------------------------------

startit  sei
         jmp (runad)

;---------------------------------------

get      lda #$10
wait2    bit $dd0d
         beq wait2
         lda $dd01
         rts

;---------------------------------------

