1551USB Loader for Tape Buffer
Suche
Index
FAQ
Kontakt
Zurück
!to"c1551usb.prg",cbm
;
;
;   1551USB-Loader for tape buffer
;
;   free mem at $1000 up to $ffff
; 
;   Compiler: ACME



   p_lo    = $d0  ; pointer lo
   p_hi    = $d1  ; pointer hi 
   blocks  = $d2
   t_lo    = $d4
   t_hi    = $d5
; drive 9
; TIA 6523  
   porta = $fec0
; data port
   portb = $fec1
; pb0: st0
; pb1: st1
   portc = $fec2
; pc6: ack
; pc7: dav
   ddra  = $fec3
   ddrb  = $fec4 
   ddrc  = $fec5

; start sys819
*=$0333
start:           
                   sei
                   lda #%01000000
                   sta ddrc
                   and #$00
                   sta portc   
                   sta ddra
                   sta ddrb
                   tay 
                   tax 
                   lda portb
                   cmp #$03 
                   beq idle
notfound:          jmp eot                  ; interface not found and quit  
idle:              lda portc
                   cmp #$80
                   bne idle
load:              

                   lda porta                ; get pointer lo
                   sta p_lo
                   lda #$40
                   sta portc                ; set ack (pc6)
                   lda #$00
                   sta portc                ; and delete ack  
-                  lda portc            
                   cmp #$80                 ; wait for dav (pc7) 
                   bne - 

                   lda porta                ; get pointer hi
                   sta p_hi
                   lda #$40
                   sta portc                ; set ack (pc6)
                   asl
                   sta portc                ; and delete ack  
-                  lda portc            
                   cmp #$80                 ; wait for dav (pc7) 
                   bne - 

                   lda porta                ; get blocks
                   sta blocks
                   lda #$40
                   sta portc                ; set ack (pc6)
                   asl
                   sta portc                ; and delete ack  
-                  lda portc            
                   cmp #$80                 ; wait for dav (pc7) 
                   bne - 


                   lda porta                ; get load-addr lo
                   sta t_lo
                   lda #$40
                   sta portc                ; set ack (pc6)
                   asl
                   sta portc                ; and delete ack  
-                  lda portc            
                   cmp #$80                 ; wait for dav (pc7) 
                   bne - 

                   lda porta                ; get load-addr hi
                   sta t_hi
                   lda #$40
                   sta portc                ; set ack (pc6)
                   asl
                   sta portc                ; and delete ack  
-                  lda portc            
                   cmp #$80                 ; wait for dav (pc7) 
                   bne - 

; load prg   
                   ldy #$00                      
loadprg:           
--                 lda porta                ; get byte
                   sta (t_lo),y             ; save
                   lda #$40
                   sta portc                ; set ack (pc6)
                   asl
                   sta portc                ; and delete ack  

-                  lda portc            
                   cmp #$80                 ; wait for dav (pc7) 
                   bne -                     
                   iny  
                   bne --         
                   inx
                   cpx blocks
                   beq eot
                   inc t_hi                   
                   bne --         
eot:               jmp end
end:               cli
                   rts

 

Letzte Änderung: 2019-01-06 09:46:34
  Rubrik:  DIY : Do it yourself
Rubriken-Übersicht
 3 Besucher online 

Valid XHTML 1.0 Transitional Valid CSS!