WRITE16.Text
WRITE16.Text
| Filename | WRITE16.Text |
|---|---|
| Size | 0.01 MB |
| Subsection | firmware / ROM88 |
| Downloads | 1 |
Contents
.Page
;++
; Write16
;
; $10 Ldx Q6L ; 1 1 Assume worst case
; Bpl $10 ; 3 4 branch taken
; Ldx Q6L ; 4 8 bit will be set
; Bpl $10 ; 2 10 fall thru
; Sta Q6H ; 4 14 put the data into reg
; 31 cycles max after bit is set before UnderRun bit is set. Using above code
; as start of time critical code,
; total time = ((32-14)+31) = 49 cycles
;--
.Page
.Org 1A00
Write16 .Equ *
Ldx IIob+Sector
Lda Nibl,x
Sta Sv4
Ldy #0 ; No speed check bytes
Sty InxPtrH
Tya ; Flag will tell Sync20 to use data mark fields
Iny ; Write only one set of self_sync bytes
Jsr Sync20 ; 6 6 Turn on write circuitry & write self-sync bytes
Ldy #0F4 ; 2 8
Lda #0AD ; 2 10 Last byte of header field
Bne Pg1x ; 3 13
Pg1 .Equ * ; Code to write out las 12 bytes of page #1
Stx Sv4 ; 3
Pg1x Ldx Q6L ; 4 17
Bpl Pg1x ; 2,3 19/20
Sta Q6H ; 4 14 Worst case possible
Ldx Page01+2,y ; 4 18
Lda Nibl,x ; 4 22
Sta Sv3 ; 3 25
Txa ; 2 27
Lsr A ; 2 29
Lsr A ; 2 31
Sta Temp1 ; 3 34
Ldx Page01+1,y ; 4 38
Lda Nibl,x ; 4 42
Sta Sv2 ; 3 45
Txa ; 2 47
And #0C0 ; 2 49
Ora Temp1 ; 3 52
Lsr A ; 2 54
Ldx Sv4 ; 3 57 61-14 = 47
Stx Q6H ; 4 61 Write last byte of previous loop
Lsr A ; 2 2
Sta Temp1 ; 3 5
Lda Page01,y ; 4 9
And #0C0 ; 2 11
Ora Temp1 ; 3 14
Lsr A ; 2 16
Lsr A ; 2 18
Tax ; 2 20
Lda Nibl,x ; 4 24
Sta Q6H ; 4 28
Ldx Page01,y ; 4 4
Iny ; 2 6
Iny ; 2 8
Lda Nibl,x ; 2 12
$15 Ldx Q6L ; 4 16
Bpl $15 ; 2,3 18
Sta Q6H ; 4 22
Lda Sv2 ; 3 3 Second byte of loop
Ldx Sv3 ; 3 6 Third byte
Iny ; 2 8
Bne Pg1 ; 2,3 10 Fetch rest of 12 bytes
; fall thru $|& start on Page #2
;++
;
;--
Pg2 .Equ * ; Code to write out first 255 bytes of Page #2
Stx Sv4 ; 3
$40 Ldx Q6L ; 4
Bpl $40 ; 2,3
Sta Q6H ; 4 14 Worst case possible
Ldx Page02,y ; 4 18
Lda Nibl,x ; 4 22
Sta Sv3 ; 3 25
Txa ; 2 27
Lsr A ; 2 29
Lsr A ; 2 31
Sta Temp1 ; 3 34
Ldx Page02+1,y ; 4 38
Lda Nibl,x ; 4 42
Sta Sv2 ; 3 45
Txa ; 2 47
And #0C0 ; 2 49
Ora Temp1 ; 3 52
Lsr A ; 2 54
Ldx Sv4 ; 3 57 61-14=47
Stx Q6H ; 4 61 Write out last byte of previous loop
Lsr A ; 2 2
Sta Temp1 ; 3 5
Lda Page02,y ; 4 9
And #0C0 ; 2 11
Ora Temp1 ; 3 14
Lsr A ; 2 16
Lsr A ; 2 18
Tax ; 2 20
Lda Nibl,x ; 4 24
Sta Q6H ; 4 28
Ldx Page02 ; 4 4
Iny ; 2 6
Iny ; 2 8
Lda Nibl,x ; 4 12
$55 Ldx Q6L ; 4 16
Bpl $55 ; 2,3 18
Sta Q6H ; 4 22
Lda Sv2 ; 3 3 Second byte of loop
Ldx Sv3 ; 3 6 Third byte
Iny ; 2 8
Cpy #Pg2Len ; 2 10
Bne Pg2 ; 2,3 12 Fetch rest of 255 bytes
Jsr WrAX ; 6 26/6 Write Nibls in A and X
Lda Page03 ; 4 10
Lda Nibl,x ; 4 14
Sta Sv4 ; 3 17
Lda CpBy01 ; 3 20
Jsr WrNibl ; 6 26/6
Ldy #02 ; 2 8 For use in Pg3
Ldx Page02+0FF ; 4 12
Jsr WrByteX ; 6 18/6
Ldx Page03 ; 4 10
Lda Nibl,x ; 4 14
Bne Pg3x ; 3 17
WrAX .Equ * ; Write nibls that are in A & X (Sv3)
…
Showing first 3,000 characters of 5,310 total. Open the full document →