Test 3

* okreslenie, w ktorych cyklach
* w linii antic odswieza pamiec

        opt 21
        org $9000

cykl    equ $f0
one     equ $f1
two     equ $f2
pom     equ $f4
x       equ $f5

        lda $230 zapamietaj dlv
        pha
        lda $231
        pha

        lda <dlist
        sta $230
        lda >dlist
        sta $231

        lda <dli
        sta $200
        lda >dli
        sta $201

begin   jsr odswiez

klawisz lda $2fc
        cmp #$ff
        beq klawisz

        pha
        lda #$40
        sta $D40E nmien
        lda #$ff
        sta $2fc
        pla

        cmp #$28 R
        bne koniec

        jsr odswiez

        lda #$c0
        sta $D40E nmien

        jmp klawisz

koniec  pla        odtworz dlv
        sta $231
        pla
        sta $230

        rts

odswiez ldx #0
        stx cykl

        jsr offset

        ldy #39
        lda #0
kasuj   sta wynik,y
        dey
        bpl kasuj

        rts

dli     pha
        sta $d40a wsync
        sta $d40a

sterta  org *+59

start   sta $d40a
        cmp 0
        lda $d40b vcount

        cmp #$11
        bcc niedmar

        txa
        clc
        adc cykl

        sta $600,x
        inx
        cpx #9
        beq end

niedmar inc cykl

        jsr offset

        pla
        rti

end     lda #$40
        sta $D40E nmien

        ldy #2

        ldx #0
dmar    lda $600,x
        inx
        jsr display
        iny
        cpx #9
        bcc dmar

rti     pla
        rti

offset  stx x

        ldy #0
        lda cykl

        clc
        adc #3

        lsr @
        tax
        bcc bez_cmp

        lda #$c5     cmp 0
        sta sterta,y
        iny
        lda #0
        sta sterta,y
        iny

        dex
        beq bez_nop

bez_cmp lda #$ea     nop
l1      sta sterta,y
        iny
        dex
        bne l1

bez_nop lda skok,x   jmp start
        sta sterta,y
        iny
        inx
        cpx <ile
        bcc bez_nop

        ldx x

        rts

skok    jmp start
ile     equ *-skok

display sta one
        lda #8
        sta pom
        lda #0
        sta two
        sta two+1
        sed
cnv     asl one
        adc two
        sta two
        rol two+1
        dec pom
        bne cnv
        cld
        pha
        lda two+1
        jsr disp1
        pla
        jmp disp2

disp2   pha
        lsr @
        lsr @
        lsr @
        lsr @
        jsr disp1
        pla
disp1   and #$F
        ora #'0'-32
        cmp #'9'-32+1
        bcc dalej
        adc #6
dalej   sta wynik,y
        iny
        rts

dlist   dta b($70)
        dta b($70)
        dta b($70+$80)

linia1  dta b($10)

        dta b($42),a(pusta)
        dta b($42),a(wynik)
        dta b($42),a(pusta)

        dta b($70)
        dta b($42),a(info1)
        dta b($41),a(dlist)

info1   dta d'  Start test: R'

pusta   dta a(0),a(0),a(0),a(0),a(0)
        dta a(0),a(0),a(0),a(0),a(0)
        dta a(0),a(0),a(0),a(0),a(0)
        dta a(0),a(0),a(0),a(0),a(0)

wynik   org *+40

        end

Powrót