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.

dskint.sf 4.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. .PAGE 'DSKINT.SF'
  2. ;
  3. ; ERROR DISPLAY ROUTINE
  4. ; BLINKS THE (ERROR #)+1 IN ALL THREE LEDS
  5. ;
  6. PEZRO LDX #0 ;ERROR #1 FOR ZERO PAGE
  7. .BYTE $2C ;SKIP NEXT TWO BYTES
  8. PERR LDX TEMP ;GET ERROR #
  9. TXS ;USE STACK AS STORAGE REG.
  10. PE20 TSX ;RESTORE ERROR #
  11. PE30 LDA #LED0+LED1
  12. ORA LEDPRT
  13. JMP PEA7A ;TURN ON LED !!!!PATCH SO DDRB LED IS OUTPUT!!!!
  14. REA7D TYA ;CLEAR INNER CTR !!!!PATCH RETURN!!!!
  15. PD10 CLC
  16. PD20 ADC #1 ;COUNT INNER CTR
  17. BNE PD20
  18. DEY ;DONE ?
  19. BNE PD10 ;NO
  20. ;
  21. LDA LEDPRT
  22. AND #$FF-LED0-LED1
  23. STA LEDPRT ;TURN OFF ALL LEDS
  24. PE40 ;WAIT
  25. TYA ;CLEAR INNER CTR
  26. PD11 CLC
  27. PD21 ADC #1 ;COUNT INNER CTR
  28. BNE PD21
  29. DEY ;DONE ?
  30. BNE PD11 ;NO
  31. ;
  32. DEX ;BLINKED # ?
  33. BPL PE30 ;NO - BLINK AGAIN
  34. CPX #$FC ;WAITED BETWEEN COUNTS ?
  35. BNE PE40 ;NO
  36. BEQ PE20 ;ALWAYS - ALL AGAIN
  37. .SKIP 3
  38. DSKINT
  39. SEI
  40. CLD
  41. LDX #$FF
  42. STX DDRA1
  43. INX ;LET .X:=0
  44. ;
  45. ;
  46. ;*********************************
  47. ;
  48. ; POWER UP DIAGNOSTIC
  49. ;
  50. ;*********************************
  51. ;
  52. LDY #0
  53. LDX #0
  54. PU10 TXA ;FILL Z-PAGE ACCEND PATTERN
  55. STA $0,X
  56. INX
  57. BNE PU10
  58. PU20 TXA ;CHECK PATTERN BY INC...
  59. CMP $0,X ;...BACK TO ORIG #
  60. BNE PEZRO ;BAD BITS
  61. PU30
  62. INC $0,X ;BUMP CONTENTS
  63. INY
  64. BNE PU30 ;NOT DONE
  65. ;
  66. CMP $0,X ;CHECK FOR GOOD COUNT
  67. BNE PEZRO ;SOMETHING'S WRONG
  68. ;
  69. STY $0,X ;LEAVE Z-PAGE ZEROED
  70. LDA $0,X ;CHECK IT
  71. BNE PEZRO ;WRONG
  72. ;
  73. INX ;NEXT!
  74. BNE PU20 ;NOT ALL DONE
  75. ;
  76. ;
  77. ; TEST TWO 64K-BIT ROMS
  78. ;
  79. ; ENTER X=START PAGE
  80. ; EXIT IF OK
  81. ;
  82. RM10 INC TEMP ;NEXT ERROR #
  83. STX IP+1 ;SAVE PAGE, START X=0
  84. LDA #0
  85. STA IP ;ZERO LO INDIRECT
  86. TAY
  87. LDX #32 ;32 PAGES IN 8K ROM
  88. CLC
  89. RT10 DEC IP+1 ;DO IT BACKWARDS
  90. RT20 ADC (IP),Y ;TOTAL CHECKSUM IN A
  91. INY
  92. BNE RT20
  93. DEX
  94. BNE RT10
  95. ADC #0 ;ADD IN LAST CARRY
  96. TAX ;SAVE LOWER PAGE IN X
  97. CMP IP+1 ;CORRECT ?
  98. BNE PERR2 ;NO - SHOW ERROR NUMBER
  99. ;
  100. CPX #$C0 ;DONE BOTH ROMS ?
  101. BNE RM10 ;NO
  102. .SKIP 3
  103. ; TEST ALL COMMON RAM
  104. ;
  105. CR20 LDA #$01 ;START OF 1ST BLOCK
  106. CR30 STA IP+1 ;SAVE PAGE #
  107. INC TEMP ;BUMP ERROR #
  108. ; ENTER X=# OF PAGES IN BLOCK
  109. ; IP PTR TO FIRST PAGE IN BLOCK
  110. ; EXIT IF OK
  111. ;
  112. RAMTST LDX #7 ;SAVE PAGE COUNT
  113. RA10 TYA ;FILL WITH ADR SENSITIVE PATTERN
  114. CLC
  115. ADC IP+1
  116. STA (IP),Y
  117. INY
  118. BNE RA10
  119. INC IP+1
  120. DEX
  121. BNE RA10
  122. LDX #7 ;RESTORE PAGE COUNT
  123. RA30 DEC IP+1 ;CHECK PATTERN BACKWARDS
  124. RA40 DEY
  125. TYA ;GEN PATTERN AGAIN
  126. CLC
  127. ADC IP+1
  128. CMP (IP),Y ;OK ?
  129. BNE PERR2 ;NO - SHOW ERROR #
  130. EOR #$FF ;YES - TEST INVERSE PATTERN
  131. STA (IP),Y
  132. EOR (IP),Y ;OK ?
  133. STA (IP),Y ;LEAVE MEMORY ZERO
  134. BNE PERR2 ;NO - SHOW ERROR #
  135. TYA
  136. BNE RA40
  137. DEX
  138. BNE RA30
  139. ;
  140. BEQ DIAGOK
  141. ;
  142. PERR2 JMP PERR
  143. .SKIP 3
  144. ;
  145. DIAGOK
  146. LDX #TOPWRT
  147. TXS
  148. LDA LEDPRT ;CLEAR LEDS
  149. AND #$FF-LED0-LED1
  150. STA LEDPRT
  151. ;
  152. LDA #1 ; NEG EDGE OF ATN
  153. STA PCR1
  154. LDA #%10000010
  155. STA IFR1
  156. STA IER1
  157. LDA PB ;COMPUTE PRIMARY ADDR
  158. AND #%01100000 ;PB5 AND PB6 ARE UNUSED LINE
  159. ASL A ;SHIFT TO LOWER
  160. ROL A
  161. ROL A
  162. ROL A
  163. ORA #$48 ;TALK ADDRESS
  164. STA TLKADR
  165. EOR #$60 ;LISTEN ADDRESS
  166. STA LSNADR
  167. ;
  168. ; INITIALIZE BUFFER PNTR TABLE
  169. ;
  170. INTTAB LDX #0
  171. LDY #0
  172. INTT1 LDA #0
  173. STA BUFTAB,X
  174. INX
  175. LDA BUFIND,Y
  176. STA BUFTAB,X
  177. INX
  178. INY
  179. CPY #BFCNT
  180. BNE INTT1
  181. ;
  182. LDA #<CMDBUF ;SET PNTR TO CMDBUF
  183. STA BUFTAB,X
  184. INX
  185. LDA #>CMDBUF
  186. STA BUFTAB,X
  187. INX
  188. LDA #<ERRBUF ;SET PNTR TO ERRBUF
  189. STA BUFTAB,X
  190. INX
  191. LDA #>ERRBUF
  192. STA BUFTAB,X
  193. ;
  194. LDA #$FF
  195. LDX #MAXSA
  196. DSKIN1 STA LINTAB,X
  197. DEX
  198. BPL DSKIN1
  199. ;
  200. LDX #MXCHNS-1
  201. DSKIN2
  202. STA BUF0,X ;SET BUFFERS AS UNUSED
  203. STA BUF1,X
  204. STA SS,X
  205. DEX
  206. BPL DSKIN2
  207. ;
  208. LDA #BFCNT ;SET BUFFER POINTERS
  209. STA BUF0+CMDCHN
  210. LDA #BFCNT+1
  211. STA BUF0+ERRCHN
  212. LDA #$FF
  213. STA BUF0+BLINDX
  214. STA BUF1+BLINDX
  215. .SKIP
  216. LDA #ERRCHN
  217. STA LINTAB+ERRSA
  218. LDA #CMDCHN+$80
  219. STA LINTAB+CMDSA
  220. LDA #LXINT ;LINDX 0 TO 5 FREE
  221. STA LINUSE
  222. .SKIP
  223. LDA #RDYLST
  224. STA CHNRDY+CMDCHN
  225. LDA #RDYTLK
  226. STA CHNRDY+ERRCHN
  227. LDA #$E0
  228. STA BUFUSE
  229. LDA #$FF
  230. STA BUFUSE+1
  231. LDA #1
  232. STA WPSW
  233. STA WPSW+1
  234. JSR USRINT ;INIT USER JMP
  235. JSR LRUINT
  236. ;
  237. ;**********************************
  238. ;
  239. ; CONTROLLER INITIALIZATION
  240. ;
  241. ;**********************************
  242. ;
  243. JSR CNTINT
  244. .SKIP 3
  245. ; SET INDIRECT VECTORS
  246. LDA #<DIAGOK
  247. STA VNMI
  248. LDA #>DIAGOK
  249. STA VNMI+1
  250. ;
  251. LDA #10 ;SET UP SECTOR OFFSET
  252. STA SECINC
  253. LDA #5
  254. STA REVCNT ;SET UP RECOVERY COUNT
  255. .SKIP
  256. ;*
  257. ;*******************************
  258. ;*
  259. ;* SETERR
  260. ;* SET UP POWER ON ERROR MSG
  261. ;*
  262. ;* CBM DOS V2.0 (C)1979
  263. ;*
  264. ;*******************************
  265. ;*
  266. ;*
  267. ;
  268. SETERR LDA #$73
  269. JSR ERRTS0
  270. ;
  271. ;
  272. ;MUST BE CONTIGUOUS TO .FILE IDLE
  273. ;
  274. ;********************************
  275. ; INIT THE SERIAL BUS
  276. ;
  277. ;********************************
  278. LDA #%00011010 ; ATNA,CLKOUT,DATOUT
  279. STA DDRB1
  280. ;
  281. LDA #$00 ; DATA HI, CLOCK HI,ATNA HI
  282. STA PB
  283. ;
  284. JSR BOOT
  285. ;
  286. .END