PRENIB
.Page
;++
;
; New PreNibble routine
; This routine will create 5 bytes ( 4 from the 524 byte i/o buffer and
; one from the checksum ) and will save them in the zero page for use
; during the writing operation. It is a brute force operation, reading
; will call a routine that will combine theh top 2 bits of each into
; one byte that is returned within the 'A' register.
;
; Buffer[1] == >AAAAAAAA<
; Buffer[2] == >BBBBBBBB<
; Buffer[3] == >CCCCCCCC<
; Result := Nibl[00AABBCC]
;--
;
; REGISTERS
; ALL == DESTROYED
;
; Local Equates
;--
C1BTo1 .Equ 02FF
C1BTo2 .Equ 0300
C1BTo3 .Equ 0301
C2BTo1 .Equ 03FE
C2bTo2 .Equ 03FF
;++
; Global Equates
; CkSum1
; CkSum2
; CkSum3
; CpCkSum
; CpBy01
; CpBy02
;--
.Page
PreNib .Equ * ; Entry point for all callers
Ldy C1BTo1
Ldx C1BTo2
Lda C1BTo3
Jsr Fr3To1
Sta CpBy01 ; Save the new composite byte
Ldy C2BTo1
Ldx C2BTo2
Lda #00 ; Only two bytes in this one
Jsr FrTo1
Sta CpBy02 ; Save the new composite byte
Ldy CkSum1
Ldx CkSum2
Lda CkSum3
Jsr Fr3To1
Sta CpCkSum
Rts ; Back to the caller