Guest User

Untitled

a guest
Jul 2nd, 2018
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; Proposal #1
  2.  
  3. ;(1541)
  4.  
  5. convers
  6.      !byte %1111, %0111, %1101, %0101, %1011, %0011, %1001, %0001
  7.      !byte %1110, %0110, %1100, %0100, %1010, %0010, %1000, %0000
  8.  
  9.     ldy #$00   
  10. send   
  11.     lda buffer,y    ; 4 X=abcdefgh 
  12.     ldx #$0f        ; 2
  13.     sbx #$00        ; 2
  14.     lsr             ; 2
  15.     lsr             ; 2
  16.     lsr             ; 2
  17.     lsr             ; 2
  18.     sta .y0+1       ; 4
  19.     lda convers,x   ; 4             Load: 24
  20.    
  21. waitloop
  22.     bit $1800       ; 4
  23.     bpl waitloop    ; 2/3 (6+?)     Wait: 6+
  24.    
  25.     sta $1800       ; 4 (Send hg)
  26.     asl             ; 2
  27.     ldx #%00001010  ; 2
  28.     sax $1800       ; 4 (Send fe)
  29. .y0
  30.     lda convers     ; 4
  31.     sax $1800       ; 4 (Send dc)
  32.     asl             ; 2
  33.     iny             ; 2            
  34.     sax $1800       ; 4 (Send ba)   Transfer: 28
  35.    
  36.     bne send        ; 3/2           Loop ctrl: 3
  37.  
  38.  
  39. ; Proposal #2
  40.  
  41. ;(1541)
  42.  
  43.     ldy #$00   
  44. send   
  45.     ldx buffer,y    ; 4 X=abcdefgh 
  46.     lda convers,x   ; 4 X=abcdefgh => A=hfgedbca
  47.     tax             ; 2
  48.     lsr             ; 2
  49.     lsr             ; 2
  50.     lsr             ; 2
  51.     lsr             ; 2 A=0000hfge  Load: 18
  52.    
  53. waitloop
  54.     bit $1800       ; 4
  55.     bpl waitloop    ; 2/3           Wait: 6+
  56.    
  57.     sta $1800       ; 4 (Send hg)
  58.     asl             ; 2
  59.     and #$0f        ; 2
  60.     sta $1800       ; 4 (Send fe)
  61.     txa             ; 2 X=hfgedbca
  62.     ldx #%00001010  ; 2
  63.     sax $1800       ; 4 (Send dc)
  64.     asl             ; 2
  65.     iny             ; 2            
  66.     sax $1800       ; 4 (Send ba)    Transfer: 28
  67.    
  68.     bne send        ; 3/2   (3)      Loop ctrl: 3
  69.  
  70. convers
  71. ; 256 byte conversion table
Add Comment
Please, Sign In to add comment