You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

serlistn.src 3.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. .page 'ser.listn'
  2. ;
  3. ;
  4. ;
  5. acptr lda #8 ; set byte bit count
  6. sta cont
  7. ;
  8. acp00a jsr tstatn
  9. jsr debnc
  10. and #clkin
  11. bne acp00a
  12. ;
  13. jsr dathi ; make data line hi
  14. ;
  15. lda #1 ; wait 255 us
  16. ;
  17. ;------rom -05 8/18/83-------------
  18. jmp patch6 ;
  19. ;----------------------------------
  20. ;
  21. acp00 jsr tstatn
  22. lda ifr1
  23. and #$40 ; test if time out
  24. bne acp00b ; ran out,its an eoi
  25. ;
  26. jsr debnc ; test clock low
  27. and #clkin
  28. beq acp00 ; no
  29. bne acp01 ; yes
  30. ;
  31. acp00b jsr datlow ; set data line low as response
  32. ;
  33. ldx #10 ; delay for talker turnaround
  34. acp02 dex
  35. bne acp02
  36. ;
  37. jsr dathi ; set data line hi
  38. ;
  39. acp02a jsr tstatn
  40. jsr debnc ; wait for low clock
  41. and #clkin
  42. beq acp02a
  43. ;
  44. lda #0 ; set eoi received
  45. sta eoiflg
  46. ;
  47. acp01
  48. acp03 lda pb ; wait for clock high
  49. eor #01 ; complement datain
  50. lsr a ; shift into carry
  51. and #$02 ; clkin/2
  52. bne acp03
  53. ;
  54. nop ; fill space left by speed-up
  55. nop ; to fix pal vc20
  56. nop ; 901229-02 rom
  57. ror data
  58. ;
  59. acp03a jsr tstatn
  60. jsr debnc
  61. and #clkin ; wait for clock low
  62. beq acp03a
  63. ;
  64. dec cont ; more to do?
  65. bne acp03
  66. ;
  67. jsr datlow ; set data line low
  68. lda data
  69. rts
  70. ;
  71. ;
  72. ;
  73. listen sei
  74. ;
  75. jsr fndwch ; test if active write channel
  76. bcs lsn15
  77. ;
  78. lda chnrdy,x
  79. ror a
  80. bcs lsn30
  81. ;
  82. lsn15 lda orgsa ; test if open
  83. and #$f0
  84. cmp #$f0
  85. beq lsn30 ; its an open
  86. ;
  87. jmp ilerr ; not active channel
  88. ;
  89. lsn30 jsr acptr ; get a byte
  90. ;
  91. cli
  92. jsr put ; put(data,eoiflg,sa)
  93. ;
  94. jmp listen ; and keep on listen
  95. ;
  96. ;
  97. frmerr
  98. iterr
  99. ilerr lda #00 ; release all bus lines
  100. sta pb
  101. jmp idle
  102. ;
  103. ;
  104. ;
  105. atnlow jmp atnsrv
  106. ;
  107. ;
  108. ; tstatn()
  109. ; {
  110. ; if(atnmod)
  111. ; {
  112. ; if(pb & $80) atns20();
  113. ; else return ;
  114. ; }
  115. ; else
  116. ; {
  117. ; if(pb&$80) return;
  118. ; else atnsrv();
  119. ; }
  120. ; }
  121. ;
  122. ;
  123. tstatn lda atnmod ; test if in atn mode
  124. beq tsta50 ; no
  125. ;
  126. lda pb ; in atnmod
  127. bpl tatn20 ; atn gone,do what we are told to do
  128. tstrtn rts ; still in atn mode
  129. ;
  130. tsta50 lda pb ; not atnmode
  131. bpl tstrtn ; no atn present
  132. ;
  133. ;<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
  134. jmp ptch16 ; *rom ds 09/03/85* *GCB 11/20/86*, ser bus bug
  135. ; clear '22 int flag
  136. ; jmp atnsrv ; do atn command
  137. ;<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
  138. ;
  139. tatn20 jmp atns20
  140. ;
  141. ;
  142. ;
  143. ;.end