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.

137 lines
2.1KB

  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. STA T1HC1
  17. ;
  18. ACP00 JSR TSTATN
  19. LDA IFR1
  20. AND #$40 ; TEST IF TIME OUT
  21. BNE ACP00B ; RAN OUT,ITS AN EOI
  22. ;
  23. JSR DEBNC ; TEST CLOCK LOW
  24. AND #CLKIN
  25. BEQ ACP00 ; NO
  26. BNE ACP01 ; YES
  27. ;
  28. ACP00B JSR DATLOW ; SET DATA LINE LOW AS RESPONSE
  29. ;
  30. LDX #10 ; DELAY FOR TALKER TURNAROUND
  31. ACP02 DEX
  32. BNE ACP02
  33. ;
  34. JSR DATHI ; SET DATA LINE HI
  35. ;
  36. ACP02A JSR TSTATN
  37. JSR DEBNC ; WAIT FOR LOW CLOCK
  38. AND #CLKIN
  39. BEQ ACP02A
  40. ;
  41. LDA #0 ; SET EOI RECEIVED
  42. STA EOIFLG
  43. ;
  44. ACP01
  45. ACP03 LDA PB ; WAIT FOR CLOCK HIGH
  46. EOR #01 ; COMPLEMENT DATAIN
  47. LSR A ; SHIFT INTO CARRY
  48. AND #$02 ; CLKIN/2
  49. BNE ACP03
  50. ;
  51. NOP ; FILL SPACE LEFT BY SPEED-UP
  52. NOP ; TO FIX PAL VC20
  53. NOP ; 901229-02 ROM
  54. ROR DATA
  55. ;
  56. ACP03A JSR TSTATN
  57. JSR DEBNC
  58. AND #CLKIN ; WAIT FOR CLOCK LOW
  59. BEQ ACP03A
  60. ;
  61. DEC CONT ; MORE TO DO?
  62. BNE ACP03
  63. ;
  64. JSR DATLOW ; SET DATA LINE LOW
  65. LDA DATA
  66. RTS
  67. ;
  68. ;
  69. ;
  70. LISTEN SEI
  71. ;
  72. JSR FNDWCH ; TEST IF ACTIVE WRITE CHANNEL
  73. BCS LSN15
  74. ;
  75. LDA CHNRDY,X
  76. ROR A
  77. BCS LSN30
  78. ;
  79. LSN15 LDA ORGSA ; TEST IF OPEN
  80. AND #$F0
  81. CMP #$F0
  82. BEQ LSN30 ; ITS AN OPEN
  83. ;
  84. JMP ILERR ; NOT ACTIVE CHANNEL
  85. ;
  86. LSN30 JSR ACPTR ; GET A BYTE
  87. ;
  88. CLI
  89. JSR PUT ; PUT(DATA,EOIFLG,SA)
  90. ;
  91. JMP LISTEN ; AND KEEP ON LISTEN
  92. ;
  93. ;
  94. FRMERR
  95. ITERR
  96. ILERR LDA #00 ; RELEASE ALL BUS LINES
  97. STA PB
  98. JMP IDLE
  99. ;
  100. ;
  101. ;
  102. ATNLOW JMP ATNSRV
  103. ;
  104. ;
  105. ; TSTATN()
  106. ; [
  107. ; IF(ATNMOD)
  108. ; [
  109. ; IF(PB & $80) ATNS20();
  110. ; ELSE RETURN ;
  111. ; ]
  112. ; ELSE
  113. ; [
  114. ; IF(PB&$80) RETURN;
  115. ; ELSE ATNSRV();
  116. ; ]
  117. ; ]
  118. ;
  119. ;
  120. TSTATN LDA ATNMOD ; TEST IF IN ATN MODE
  121. BEQ TSTA50 ; NO
  122. ;
  123. LDA PB ; IN ATNMOD
  124. BPL TATN20 ; ATN GONE,DO WHAT WE ARE TOLD TO DO
  125. TSTRTN RTS ; STILL IN ATN MODE
  126. ;
  127. TSTA50 LDA PB ; NOT ATNMODE
  128. BPL TSTRTN ; NO ATN PRESENT
  129. ;
  130. JMP ATNSRV ; DO ATN COMMAND
  131. ;
  132. TATN20 JMP ATNS20
  133. ;
  134. ;
  135. ;
  136. .END