home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d9xx / d942 / as65.lha / AS65 / Connect_C64 / receive.asm < prev    next >
Assembly Source File  |  1993-12-20  |  2KB  |  75 lines

  1.                         ;*****************************
  2.                         ;Datenübertragung AMIGA -> C64
  3.                         ;
  4.                         ;Daten empfangen
  5.                         ;*****************************
  6.  
  7.  
  8. receive_data        ?print 200,"WAITING FOR DATA"
  9.                         sei
  10.  
  11.                         ;====================
  12.                         ;auf Startbyte warten
  13.                         ;====================
  14.  
  15. wait_byte            inx
  16.                         stx SCREEN_ADR
  17.  
  18.                         lda #$10                ;Maske für BIT 4 laden
  19.                         bit CIA_ICR            ;liegt Byte an?
  20.                         bne get_byte        ;ja, Byte holen
  21.                         lda CIA_PORT        ;Signal auf Port-Controll-Ltg. ausgeben
  22.                         bne wait_byte
  23.                         beq wait_byte
  24.  
  25.  
  26.                         ;===================
  27.                         ;Byte vom Port holen
  28.                         ;===================
  29.  
  30. get_byte                lda CIA_PORT        ;Byte vom Port holen
  31.                         sta SCREEN_ADR+2    ;und zur Kontrolle ausgeben
  32.                         ldy #$00
  33.                         sta (BUFF_PTR),y    ;und in den Buffer schreiben
  34.                         ?print 200,"RECEIVING DATA  "
  35.                         inc BUFF_PTR        ;Bufferptr. low erhöhen
  36.                         bne time_out        ;kein Überlauf
  37.                         inc BUFF_PTR+1        ;Bufferptr. high erhöhen
  38.  
  39.  
  40.                         ;=======
  41.                         ;Timeout
  42.                         ;=======
  43.  
  44. time_out                lda #$40                ;high Byte des Timeout Zählers
  45.                         sta $02
  46.                         ldx #$00                ;low Byte Timeout
  47.  
  48. time_out1            lda #$10                ;Maske für BIT 4 laden
  49.                         bit CIA_ICR            ;liegt Byte an?
  50.                         bne get_byte        ;ja, Byte holen
  51.                         dex                    ;Timeout Zähler-1
  52.                         bne time_out1
  53.                         dec $02                ;Timeout high Byte-1
  54.                         bne time_out1
  55.  
  56.                         ;======================================
  57.                         ;Timeout erreicht, Rücksprung zum Basic
  58.                         ;======================================
  59.  
  60.                         lda #$37
  61.                         sta $01                ;Basicinterpreter wieder einschalten
  62.                         cli
  63.                         ?print 240,"ALLRIGHT"
  64.                         lda #10                ;Curor auf Zeile setzen
  65.                         sta $d6
  66.  
  67.                         ldx #$00
  68.                         ldy #$00
  69.  
  70. wait                    dex
  71.                         bne wait
  72.                         dey
  73.                         bne wait
  74.                         jmp start            ; Neustart
  75.