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.

begin 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. .PAGE 'BEGIN DOS'
  2. BEGIN
  3. LDX #$FF
  4. TXS ; INITIALIZE STACK
  5. LDA PBD2
  6. AND #255-ERRLED-LED0-LED1
  7. STA PBD2 ; TURN LEDS OFF
  8. LDA PBD2 ; COMPUTE PRIMARY ADDR
  9. AND #7
  10. ORA #$48 ; TALK ADDRESS
  11. STA TLKADR
  12. EOR #$60 ; LISTEN ADDRESS
  13. STA LSNADR
  14. ;
  15. ; INITIALIZE BUFFER POINTER TABLE
  16. ;
  17. INTTAB
  18. LDX #0
  19. LDY #0
  20. INTT1
  21. LDA #0
  22. STA BUFTAB,X
  23. INX
  24. LDA BUFIND,Y
  25. STA BUFTAB,X
  26. INX
  27. INY
  28. CPY #BFCNT+2
  29. BNE INTT1
  30. LDA #<CMDBUF ; SET POINTER TO COMMAND BUFFER
  31. STA BUFTAB,X
  32. INX
  33. LDA #>CMDBUF
  34. STA BUFTAB,X
  35. INX
  36. LDA #<ERRBUF ; SET POINTER TO ERROR BUFFER
  37. STA BUFTAB,X
  38. INX
  39. LDA #>ERRBUF
  40. STA BUFTAB,X
  41. LDA #$FF
  42. LDX #MAXSA
  43. DSKIN1
  44. STA LINTAB,X
  45. DEX
  46. BPL DSKIN1
  47. LDX #MXCHNS-1
  48. DSKIN2
  49. STA BUF0,X ; SET BUFFERS AS UNUSED
  50. STA BUF1,X
  51. STA SS,X
  52. DEX
  53. BPL DSKIN2
  54. LDA #BFCNT+2 ; SET BUFFER POINTERS
  55. STA BUF0+CMDCHN
  56. LDA #BFCNT+3
  57. STA BUF0+ERRCHN
  58. LDA #ERRCHN
  59. STA LINTAB+ERRSA
  60. LDA #CMDCHN+$80
  61. STA LINTAB+CMDSA
  62. LDA #LXINT ; LINDX 0 TO 5 FREE
  63. STA LINUSE
  64. LDA #RDYLST
  65. STA CHNRDY+CMDCHN
  66. LDA #RDYTLK
  67. STA CHNRDY+ERRCHN
  68. LDA #0
  69. STA BUFUSE
  70. LDA #$D0
  71. STA BUFUSE+1
  72. JSR USRINT ; INITIALIZE USER JUMP TABLE
  73. LDA #0
  74. STA RESULT+1
  75. STA RESULT+2
  76. LDA SECTRS
  77. STA RESULT
  78. LDA #8
  79. JSR DIV006+2
  80. LDA ACCUM+1
  81. BEQ DSKIN3
  82. INC RESULT
  83. DSKIN3
  84. INC RESULT
  85. LDA RESULT
  86. STA BAMSIZ ; BAMSIZ = (SECTRS/8)+1
  87. LDX HEADS
  88. LDA #0
  89. CLC
  90. DSKIN4
  91. ADC BAMSIZ
  92. DEX
  93. BNE DSKIN4
  94. STA BTSIZE ; BTSIZE = HEADS*BAMSIZ
  95. LDX HEADS
  96. LDA #0
  97. CLC
  98. DSKIN5
  99. ADC SECTRS
  100. DEX
  101. BNE DSKIN5
  102. STA MAXCYL ; MAXCYL = HEADS*SECTRS
  103. LDA #0
  104. STA RESULT+1
  105. STA RESULT+2
  106. LDA #250
  107. STA RESULT
  108. LDA BTSIZE
  109. JSR DIV006+2
  110. LDA ACCUM+1
  111. CLC
  112. ADC #6
  113. STA MAPOFF ; MAPOFF = REMAINDER(250/BTSIZE)+6
  114. LDA RESULT
  115. STA TRKBAM ; TRKBAM = INT(250/BTSIZE)
  116. LDX CYLLOW
  117. INX
  118. STX MAXTRK
  119. LDA #'A
  120. STA VERNUM
  121. LDA #1
  122. STA WPSW
  123. STA WPSW+1 ; POWER UP INIT FLAG
  124. ;
  125. ; SET INDIRECT VECTORS
  126. ;
  127. LDA #<DIAGOK
  128. STA VNMI
  129. LDA #>DIAGOK
  130. STA VNMI+1
  131. LDA #10 ; SET UP SECTOR ALLOCATE
  132. STA SECINC
  133. LDA #5
  134. STA REVCNT ; SET UP RECOVERY COUNT
  135. STA RETRY
  136. ;
  137. ; SET VECTORS TO IDLE LOOP AND IEEE
  138. ;
  139. LDA #<VIDLE
  140. STA VECIDL
  141. LDA #>VIDLE
  142. STA VECIDL+1
  143. LDA #<VIEEE
  144. STA VECIEE
  145. LDA #>VIEEE
  146. STA VECIEE+1
  147. ;
  148. ; SET UP POWER UP MESSAGE
  149. ;
  150. MESAGE
  151. LDA #CBMVER ; DOS VERSION NUMBER
  152. JSR ERRTS0 ; TRANSFER MESSAGE
  153. ;
  154. ; ALLOW 'ATN' TO INTERRUPT
  155. ;
  156. STA ATNPE
  157. JMP BOOT ; CHECK POWER UP BOOT
  158. ;
  159. ; MUST BE CONTIGUOUS TO IDLE ROUTINE
  160. ;
  161. .END