Plus/4 - TCBM Low Level
Suche
Index
FAQ
Kontakt
Zurück

Commodore Plus/4 Low-Level Routines for Floppy 1551 TCBM-Transfer


; getbyte
LEC8B       STX   $BA
            BIT   $F9
            BVS   LEC96                    ; 1551 getbyte
            LDX   $BA
            JMP   LE252                    ; IEC ACPTR

LEC96       LDA   $F9                      ; IEC flag
            AND   #$30                     ; clear LSB
            TAX                            ; x-reg : 48 = #8, 0 = #9
            LDA   #$84                     ; $80: 1551 wake up $4: Job4= Computer receives
            STA   $FEC0,x                  ; PortA
LECA0       LDA   $FEC2,x                  ; Read ST
            BMI   LECA0                    ; wait for ST >0
            LDA   #$00
            STA   $FEC3,x                  ; DDRA = 0 :in
            STA   $FEC2,x                  ; clear DAV:0
LECAD       LDA   $FEC2,x
            BPL   LECAD                    ; wait for ACK:0
            LDA   $FEC1,x                  ; read ST
            AND   #$03
            CMP   #$03
            BNE   LECBD                    ; check Status-Bits
            LDA   #$40
LECBD       JSR   LF41E                    ; and write new Status to $90
            LDA   $FEC0,x                  ; get Byte
            PHA                            ; and push to stack
            LDA   #$40                     ; Set Bit 6 = DAV:1
            STA   $FEC2,x
LECC9       LDA   $FEC2,x                  ; read ST
            BMI   LECC9                    ; wait for ST >0
            LDA   #$FF
            STA   $FEC3,x                  ; DDRA to output
            LDA   #$00
            STA   $FEC0,x                  ; PortA = $00
            STA   $FEC2,x                  ; clear DAV:0
            JMP   LEDD4                    ; finish (IEC)

LECE6       PHA                            ; push to stack
            STA   $05E8
            LDA   #$83
LECEC       STX   $BA
            PHA
            LDA   $F9                      ; flag
            AND   #$30
            TAX
            PLA
            STA   $FEC0,x                  ; write to PortA
LECF8       LDA   $FEC2,x                  ; wait for ST >0
            BMI   LECF8
            LDA   $05E8                    ; get databyte
            STA   $FEC0,x                  ; write to PortA
            LDA   #$00
            STA   $FEC2,x                  ; DAV = 0
LED08       LDA   $FEC2,x                  ; wait for ACK = 1
            BPL   LED08
            LDA   $FEC1,x                  ; read status-bits
            AND   #$03
            JSR   LF41E                    ; set status
            JMP   LEDDB
;---------------------------------------------------------------------------------------------------
LEDD4       LDA   $FEC2,x                  ; read ST
            BPL   LEDD4
            BMI   LEDE0                    ; wait for ACK:0
LEDDB       LDA   #$00
            STA   $FEC0,x                  ; set port to #$00
LEDE0       LDA   #$40
            STA   $FEC2,x                  ; Set Bit 6 = DAV:1
            LDX   $BA
            PLA
            CLC
            RTS
; ---------------------------------------------------------------------------------------------------
;part of ioinit
LEDEA       STA   $FEF2                    ; TIA-Copy , Akku #$40
            STA   $FEC5                    ; set DDRC
            STA   $FEC2                    ; set DAV
            DEX
            STX   $FEC3                    ; set DDRA to output
            JMP   LCFEA
;----------------------------------------------------------------------------------------------------
LF41E       ORA   $90
            STA   $90
            RTS
;----------------------------------------------------------------------------------------------------


 

Letzte Änderung: 2022-04-18 10:32:57
  Rubrik:  Floppy
Rubriken-Übersicht
 6 Besucher online 

Valid XHTML 1.0 Transitional Valid CSS!