Browse Source

added DOS_D9065

master
Michael Steil 2 years ago
parent
commit
93862df767
75 changed files with 10272 additions and 0 deletions
  1. 124
    0
      DOS_D9065/addfil
  2. 179
    0
      DOS_D9065/addrel
  3. 65
    0
      DOS_D9065/allromcheck
  4. 48
    0
      DOS_D9065/autoit
  5. 161
    0
      DOS_D9065/begin
  6. 426
    0
      DOS_D9065/block
  7. 15
    0
      DOS_D9065/changes
  8. 45
    0
      DOS_D9065/chksum
  9. 209
    0
      DOS_D9065/close
  10. 122
    0
      DOS_D9065/comprs
  11. 108
    0
      DOS_D9065/copyall
  12. 67
    0
      DOS_D9065/copysetup
  13. 44
    0
      DOS_D9065/dos
  14. 201
    0
      DOS_D9065/dskint
  15. 207
    0
      DOS_D9065/duplct
  16. 2
    0
      DOS_D9065/echksm
  17. 55
    0
      DOS_D9065/equate
  18. 4
    0
      DOS_D9065/erom
  19. 451
    0
      DOS_D9065/erproc
  20. 5
    0
      DOS_D9065/fmt40
  21. 172
    0
      DOS_D9065/fndrel
  22. 301
    0
      DOS_D9065/frets
  23. 44
    0
      DOS_D9065/getact
  24. 50
    0
      DOS_D9065/i_odef
  25. 80
    0
      DOS_D9065/idle
  26. 226
    0
      DOS_D9065/ieee
  27. 204
    0
      DOS_D9065/init
  28. 153
    0
      DOS_D9065/jobs
  29. 402
    0
      DOS_D9065/lookup
  30. 120
    0
      DOS_D9065/lstdir
  31. 2
    0
      DOS_D9065/m.nl
  32. 2
    0
      DOS_D9065/m.ns
  33. 240
    0
      DOS_D9065/map
  34. 61
    0
      DOS_D9065/master
  35. 60
    0
      DOS_D9065/master.old
  36. 69
    0
      DOS_D9065/memrw
  37. 59
    0
      DOS_D9065/mver
  38. 278
    0
      DOS_D9065/new
  39. 142
    0
      DOS_D9065/newss
  40. 63
    0
      DOS_D9065/nulbuf
  41. 206
    0
      DOS_D9065/opchnl
  42. 405
    0
      DOS_D9065/open
  43. 206
    0
      DOS_D9065/opx
  44. 281
    0
      DOS_D9065/parsex
  45. 5
    0
      DOS_D9065/patc
  46. 64
    0
      DOS_D9065/patchlst
  47. 213
    0
      DOS_D9065/ramvar
  48. 144
    0
      DOS_D9065/record
  49. 130
    0
      DOS_D9065/rel1
  50. 154
    0
      DOS_D9065/rel2
  51. 59
    0
      DOS_D9065/rel3
  52. 85
    0
      DOS_D9065/rel4
  53. 217
    0
      DOS_D9065/rename
  54. 5
    0
      DOS_D9065/rom
  55. 135
    0
      DOS_D9065/romtbl
  56. 69
    0
      DOS_D9065/scrtch
  57. 110
    0
      DOS_D9065/setdrv
  58. 23
    0
      DOS_D9065/sidsec
  59. 47
    0
      DOS_D9065/ssend
  60. 25
    0
      DOS_D9065/sss
  61. 49
    0
      DOS_D9065/sstest
  62. 196
    0
      DOS_D9065/ssutil
  63. 120
    0
      DOS_D9065/system
  64. 129
    0
      DOS_D9065/temp
  65. 281
    0
      DOS_D9065/trnsfr
  66. 433
    0
      DOS_D9065/tst2
  67. 233
    0
      DOS_D9065/tst3
  68. 250
    0
      DOS_D9065/tst4
  69. 89
    0
      DOS_D9065/tstflg
  70. 198
    0
      DOS_D9065/tstfnd
  71. 181
    0
      DOS_D9065/tsutil
  72. 149
    0
      DOS_D9065/utlodr
  73. 20
    0
      DOS_D9065/vector
  74. 89
    0
      DOS_D9065/verdir
  75. 6
    0
      README.md

+ 124
- 0
DOS_D9065/addfil View File

@@ -0,0 +1,124 @@
.PAGE 'ADDFIL'
;
; ADD FILE TO DIRECTORY
;
ADDFIL
LDA SA ; SAVE VARIABLES
PHA
LDA LINDX
PHA
LDA SECTOR
PHA
LDA TRACK
PHA
LDA #IRSA
STA SA
JSR CURBLK ; USE LAST ACCESSED SEARCH
LDA TYPE
PHA
LDA FILDRV
AND #1
STA DRVNUM
LDX JOBNUM
EOR LSTJOB,X
LSR A
BCC AF08 ; SAME DRIVE AS REQUIRED
LDX #1
STX DELIND ; LOOK FOR DELETED ENTRY
JSR SRCHST
BEQ AF15 ; ALL FULL, NEW SECTOR
BNE AF20 ; FOUND ONE
AF08
LDA DELENT
BEQ AF10 ; DELETED ENTRY NOT LOCATED
LDA DELSEC
CMP SECTOR
BNE AF09 ; SECTOR IS NOT RESIDENT
LDA DELTRK
CMP TRACK
BEQ AF20 ; TRACK AND SECTOR ARE RESIDENT
AF09
LDA DELSEC
STA SECTOR
LDA DELTRK
STA TRACK
JSR DRTRD ; READ IN THE TRACK AND SECTOR
JMP AF20
AF10
LDA #1 ; FIND DELETED ENTRY
STA DELIND
JSR SEARCH
BNE AF20
AF15
JSR NXDRBK ; ALL FULL, NEW SECTOR
LDA SECTOR
STA DELSEC
LDA #$FF
STA DELENT
LDA TRACK
STA DELTRK
LDA #2
STA DELIND
AF20
LDA DELIND
JSR SETPNT
PLA
STA TYPE ; SET TYPE
CMP #RELTYP
BNE AF25
ORA #$80
AF25
JSR PUTBYT
PLA
STA FILTRK ; ...TABLE & ENTRY
JSR PUTBYT
PLA
STA FILSEC ; SET SECTOR LINK IN...
JSR PUTBYT ; ...TABLE & ENTRY
JSR GETACT
TAY
LDA FILTBL
TAX
LDA #16
JSR TRNAME ; TRANSFER NAME
LDY #16
LDA #0 ; CLEAR # OF BLOCKS &...
AF30
STA (DIRBUF),Y ; ...& REPLACE LINKS
INY
CPY #27
BCC AF30
LDA TYPE ; A RELATIVE FILE?
CMP #RELTYP
BNE AF50 ; NO
LDY #16 ; YES
LDA TRKSS ; GET SS TRACK
STA (DIRBUF),Y ; PUT IN DIRECTORY
INY
LDA SECSS ; GET SS SECTOR
STA (DIRBUF),Y ; PUT IN
INY
LDA REC ; GET RECORD SIZE
STA (DIRBUF),Y
AF50
JSR DRTWRT ; WRITE IT OUT
PLA
STA LINDX
TAX
PLA
STA SA
LDA DELSEC
STA ENTSEC
STA DSEC,X
LDA DELTRK
STA ENTTRK
STA DTRK,X
LDA DELIND
STA ENTIND
STA DIND,X
LDA TYPE
STA PATTYP
LDA DRVNUM
STA FILDRV
RTS
.END

+ 179
- 0
DOS_D9065/addrel View File

@@ -0,0 +1,179 @@
.PAGE 'ADDREL'
ADDREL
JSR ADRELS
JSR FNDREL ; CALC SS PTRS
ADDR1
JSR NUMFRE ; CALC AVAILABLE...
LDY LINDX ; RECORD SPAN?
LDX RS,Y
DEX
TXA
CLC
ADC RELPTR
BCC AR10 ; NO SPAN
INC SSIND ; INC SS PTRS & CHECK
INC SSIND
BNE AR10
INC SSNUM
LDA #SSIOFF
STA SSIND
AR10
LDA R1
CLC
ADC #2
JSR SETSSP
LDA SSNUM
CMP #NSSL
BCC AR25 ; VALID RANGE
LDA #0
STA SSNUM
INC GRPNUM
BNE AR25 ; JUMP
AR20
LDA #BIGFIL
JSR CMDERR ; TOO MANY SS'S
AR25
LDA SSIND ; CALC # BLOCKS NEEDED...
SEC ; ...& CHECK AGAINST AVAIL.
SBC R1
BCS AR30
SBC #SSIOFF-1
CLC
AR30
STA T3
LDA SSNUM
SBC R0
BCS ADDBI1
INC R3
ADC #6
ADDBI1
STA T4
LDA GRPNUM
SEC
SBC R3
STA R3
JSR SSSCAL
LDA RESULT+1
BNE AR35
LDX RESULT
BNE ADDBI2
RTS
ADDBI2
DEX
BNE AR35
AR34
INC R2
AR35
CMP NBTEMP+1
BCC AR40 ; OK!!
BNE AR20
LDA NBTEMP
CMP T1
BCC AR20 ; NOT ENOUGH BLOCKS
AR40
LDA #1
JSR DRDBYT ; LOOK AT SECTOR LINK
CLC
ADC #1 ; +1 IS NR
LDX LINDX
STA NR,X
JSR NXTTS ; GET NEXT BLOCK...
JSR SETLNK ; ...& SET LINK.
LDA R2
BNE AR50 ; ADD ONE BLOCK
JSR WRTOUT ; WRITE CURRENT LAST REC
AR45
JSR DBLBUF ; SWITCH BUFS
JSR SETHDR ; SET HDR FROM T & S
JSR NXTTS ; GET ANOTHER
JSR SETLNK ; SET UP LINK
JSR NULBUF ; CLEAN IT OUT
JMP AR55
AR50
JSR DBLBUF ; SWITCH BUFS
JSR SETHDR ; SET HDR FROM T & S
JSR NULBUF ; CLEAN BUFFER
JSR NULLNK ; LAST BLOCK = 0, LSTCHR
AR55
JSR WRTOUT ; WRITE BUFFER
JSR GETLNK ; GET T&S FROM LINK
LDA TRACK
PHA ; SAVE 'EM
LDA SECTOR
PHA
JSR GETHDR ; NOW GET HDR T&S
LDA SECTOR
PHA ; SAVE 'EM
LDA TRACK
PHA
JSR GSSPNT ; CHECK SS PTR
TAX
BNE AR60
JSR NEWSS ; NEED ANOTHER SS
LDA #SSIOFF
JSR SETSSP ; .A = BT VAL
INC R0 ; ADVANCE SS COUNT
AR60
PLA
JSR PUTSS ; RECORD T&S...
PLA
JSR PUTSS ; ...IN SS.
PLA ; GET T&S FROM LINK
STA SECTOR
PLA
STA TRACK
BEQ AR65 ; T = 0, THAT'S ALL!!
LDA R5
CMP GRPNUM
BCC AR45
AR61
LDA R0
CMP SSNUM
BNE AR45 ; NOT DONE YET
JSR GSSPNT
CMP SSIND
BCC AR45 ; ALMOST DONE
BCS AR50 ; ONE MORE BLOCK LEFT
AR65
JSR GSSPNT
PHA
LDA #0
JSR SSDIR
LDA #0
TAY
STA (DIRBUF),Y
INY
PLA
SEC
SBC #1
STA (DIRBUF),Y
JSR WRTSS ; WRITE SS
JSR WATJOB
JSR MAPOUT
JSR FNDREL
JSR DBLBUF ; GET BACK TO LEADING BUFFER
JSR SSPOS
BVS AR70
JMP POSITN
AR70
LDA #LRF
JSR SETFLG
LDA #NOREC
JSR CMDERR
ADRELS
JSR SETDRN
JSR SSEND ; SET UP END OF FILE
JSR POSBUF
LDA GRPNUM
STA R5
STA R3
ADREL1
LDA SSIND
STA R1 ; SAVE SS INDEX
LDA SSNUM
STA R0 ; SAVE SS NUMBER
LDA #0
STA R2 ; CLEAR FLAG FOR ONE BLOCK
STA RECPTR ; TO 1ST BYTE IN RECORD
RTS
.END

+ 65
- 0
DOS_D9065/allromcheck View File

@@ -0,0 +1,65 @@
IP=0 ;ZPAGE POINTER
*=$F800
START SEI
LDY #0
LDA #$20
LOOP
STA $8000,Y ;CLEAR SCREEN
STA $8100,Y
STA $8200,Y
STA $8300,Y
INY
BNE LOOP
CALC
LDA #$B0 ;SET FOR $A SLOT
STA IP+1
LDA #0
STA IP ;ZERO LO INDIRECT
TAY
LDX #16 ;16 PAGES IN 4K ROM
CLC
RT10 DEC IP+1 ;DO IT BACKWARDS
RT20 ADC (IP),Y ;TOTAL CHECKSUM IN A
INY
BNE RT20
DEX
BNE RT10
ADC #0 ;ADD IN LAST CARRY
PHA
AND #$F
TAX
LDA HEX,X
STA $8029 ;POKE LOW NYBBLE
PLA
LSR A
LSR A
LSR A
LSR A
TAX
LDA HEX,X
STA $8028 ;POKE HIGH NYBBLE
JSR WAIT
LDA $8028
EOR #$40
STA $8028
LDA $8029
EOR #$40
STA $8029
JSR WAIT
JMP CALC
;
WAIT
LDY #0
W2
LDX #0
W3
DEX
BNE W3
DEY
BNE W2
RTS
HEX .BYTE '0123456789'
.BYTE 1,2,3,4,5,6 ;SCREEN ALPHA
*=$FFFC
.WORD START
.END

+ 48
- 0
DOS_D9065/autoit View File

@@ -0,0 +1,48 @@
.PAGE 'AUTOIT'
;RSR TEST SUBROUTINES
;
; THIS AUTO INIT SUBROUTINE WILL
; CHECK IF DRVNUM DRIVE IS INITED
;
; IF CATALOG CALLS THIS ROUTINE
; BEFORE ANY HEADER INFO IS TRANSFERED
; THIS ROUTINE WORKS.
;
; THIS ROUTINE WILL END IN ERROR
; IF ANY ERROR BUT DISK ID OCCURS
;
AUTOIT LDX #$FF ;FLAG FOR ERROR RTN
STX JOBRTN
JSR INITSU ;.A=DRVNUM< >=ERROR
CMP #03 ;CHK MISSING DISK
BEQ CATID3
CATID5 CMP #2 ;CHK FOR OKAY
BCC CATID4
CATID2 JMP ERROR ;MUST BE AN ERROR
CATID3 LDY DRVCNT ;CHK FOR SINGLE
BEQ CATID2
LDA #0 ;ONLY ONE GOOD DRIVE?
STA DRVCNT
LDA DRVNUM ;FLIP TO CHK OTHER DRV
EOR #1
STA DRVNUM
JMP AUTOIT
;
CATID4 TXA ;X PRESERVED
ASL A ;MULT *8
ASL A
ASL A
TAY
LDA DRVNUM
ASL A
TAX
LDA HDRS,Y ;CHK DISK ID
CMP DSKID,X ;AGAINST OLD ID
BNE CATID1
LDA HDRS+1,Y
CMP DSKID+1,X
BNE CATID1
RTS ;SAME ID
CATID1 JMP INITDR ;DIFF SO INIT
;
.END

+ 161
- 0
DOS_D9065/begin View File

@@ -0,0 +1,161 @@
.PAGE 'BEGIN DOS'
BEGIN
LDX #$FF
TXS ; INITIALIZE STACK
LDA PBD2
AND #255-ERRLED-LED0-LED1
STA PBD2 ; TURN LEDS OFF
LDA PBD2 ; COMPUTE PRIMARY ADDR
AND #7
ORA #$48 ; TALK ADDRESS
STA TLKADR
EOR #$60 ; LISTEN ADDRESS
STA LSNADR
;
; INITIALIZE BUFFER POINTER TABLE
;
INTTAB
LDX #0
LDY #0
INTT1
LDA #0
STA BUFTAB,X
INX
LDA BUFIND,Y
STA BUFTAB,X
INX
INY
CPY #BFCNT+2
BNE INTT1
LDA #<CMDBUF ; SET POINTER TO COMMAND BUFFER
STA BUFTAB,X
INX
LDA #>CMDBUF
STA BUFTAB,X
INX
LDA #<ERRBUF ; SET POINTER TO ERROR BUFFER
STA BUFTAB,X
INX
LDA #>ERRBUF
STA BUFTAB,X
LDA #$FF
LDX #MAXSA
DSKIN1
STA LINTAB,X
DEX
BPL DSKIN1
LDX #MXCHNS-1
DSKIN2
STA BUF0,X ; SET BUFFERS AS UNUSED
STA BUF1,X
STA SS,X
DEX
BPL DSKIN2
LDA #BFCNT+2 ; SET BUFFER POINTERS
STA BUF0+CMDCHN
LDA #BFCNT+3
STA BUF0+ERRCHN
LDA #ERRCHN
STA LINTAB+ERRSA
LDA #CMDCHN+$80
STA LINTAB+CMDSA
LDA #LXINT ; LINDX 0 TO 5 FREE
STA LINUSE
LDA #RDYLST
STA CHNRDY+CMDCHN
LDA #RDYTLK
STA CHNRDY+ERRCHN
LDA #0
STA BUFUSE
LDA #$D0
STA BUFUSE+1
JSR USRINT ; INITIALIZE USER JUMP TABLE
LDA #0
STA RESULT+1
STA RESULT+2
LDA SECTRS
STA RESULT
LDA #8
JSR DIV006+2
LDA ACCUM+1
BEQ DSKIN3
INC RESULT
DSKIN3
INC RESULT
LDA RESULT
STA BAMSIZ ; BAMSIZ = (SECTRS/8)+1
LDX HEADS
LDA #0
CLC
DSKIN4
ADC BAMSIZ
DEX
BNE DSKIN4
STA BTSIZE ; BTSIZE = HEADS*BAMSIZ
LDX HEADS
LDA #0
CLC
DSKIN5
ADC SECTRS
DEX
BNE DSKIN5
STA MAXCYL ; MAXCYL = HEADS*SECTRS
LDA #0
STA RESULT+1
STA RESULT+2
LDA #250
STA RESULT
LDA BTSIZE
JSR DIV006+2
LDA ACCUM+1
CLC
ADC #6
STA MAPOFF ; MAPOFF = REMAINDER(250/BTSIZE)+6
LDA RESULT
STA TRKBAM ; TRKBAM = INT(250/BTSIZE)
LDX CYLLOW
INX
STX MAXTRK
LDA #'A
STA VERNUM
LDA #1
STA WPSW
STA WPSW+1 ; POWER UP INIT FLAG
;
; SET INDIRECT VECTORS
;
LDA #<DIAGOK
STA VNMI
LDA #>DIAGOK
STA VNMI+1
LDA #10 ; SET UP SECTOR ALLOCATE
STA SECINC
LDA #5
STA REVCNT ; SET UP RECOVERY COUNT
STA RETRY
;
; SET VECTORS TO IDLE LOOP AND IEEE
;
LDA #<VIDLE
STA VECIDL
LDA #>VIDLE
STA VECIDL+1
LDA #<VIEEE
STA VECIEE
LDA #>VIEEE
STA VECIEE+1
;
; SET UP POWER UP MESSAGE
;
MESAGE
LDA #CBMVER ; DOS VERSION NUMBER
JSR ERRTS0 ; TRANSFER MESSAGE
;
; ALLOW 'ATN' TO INTERRUPT
;
STA ATNPE
JMP BOOT ; CHECK POWER UP BOOT
;
; MUST BE CONTIGUOUS TO IDLE ROUTINE
;
.END

+ 426
- 0
DOS_D9065/block View File

@@ -0,0 +1,426 @@
.PAGE 'BLOCK COMMAND'
;
; USER COMMANDS
;
USER
LDY CMDBUF+1
CPY #'0
BNE US10 ; 0 RESETS PNTR
USRINT
LDA #<UBLOCK ; SET DEFAULT BLOCK ADD
STA USRJMP
LDA #>UBLOCK
STA USRJMP+1
RTS
US10
JSR USREXC ; EXECUTE CODE BY TABLE
JMP ENDCMD
USREXC
DEY ; ENTRY IS (((INDEX-1)AND$F)*2)
TYA
AND #$F
ASL A
TAY
LDA (USRJMP),Y
STA IP
INY
LDA (USRJMP),Y
STA IP+1
JMP (IP)
.PAGE 'BLOCK COMMANDS'
;
; OPEN DIRECT ACCESS BUFFER
; FROM OPEN "#"
;
OPNBLK
LDA LSTDRV
STA DRVNUM
LDA SA
PHA
JSR AUTOI
PLA
STA SA
LDX CMDSIZ
DEX
BNE OB10
LDA #1 ; GET ANY BUFFER
JSR GETRCH
JMP OB30
OB05
LDA #NOCHNL
JMP CMDERR
OB10
LDY #1 ; BUFFER # IS REQUESTED
JSR BP05
LDX FILSEC
CPX #BAMJOB ; MUST BE LESS THAN 13
BCS OB05
LDA #0
STA TEMP
STA TEMP+1
SEC
OB15
ROL TEMP
ROL TEMP+1
DEX
BPL OB15
LDA TEMP
AND BUFUSE
BNE OB05 ; BUFFER IS USED
LDA TEMP+1
AND BUFUSE+1
BNE OB05 ; BUFFER IS USED
LDA TEMP
ORA BUFUSE ; SET BUFFER AS USED
STA BUFUSE
LDA TEMP+1
ORA BUFUSE+1
STA BUFUSE+1
LDA #0 ; SET UP CHANNEL
JSR GETRCH
LDX LINDX
LDA FILSEC
STA BUF0,X
TAX
LDA DRVNUM
STA LSTJOB,X
OB30
LDX SA
LDA LINTAB,X ; SET LINDX TABLE
ORA #$40
STA LINTAB,X
LDY LINDX
LDA #$FF
STA LSTCHR,Y
LDA #RNDRDY
STA CHNRDY,Y ; SET CHANNEL READY
LDA BUF0,Y
STA CHNDAT,Y ; BUFFER # AS 1ST CHAR
ASL A
TAX
LDA #1
STA BUFTAB,X
LDA #DIRTYP+DIRTYP
STA FILTYP,Y ; SET DIRECT FILE TYPE
JMP ENDCMD
;
; BLOCK COMMANDS
;
BLOCK
LDY #0
LDX #0
LDA #'- ; '-' SEPARATES CMD FROM SUBCMD
JSR PARSE ; LOCATE SUB-CMD
BNE BLK40
BLK10
LDA #BADCMD
JMP CMDERR
BLK30
LDA #BADSYN
JMP CMDERR
BLK40
TXA
BNE BLK30
LDX #NBCMDS-1 ; FIND COMMAND
LDA CMDBUF,Y
BLK50
CMP BCTAB,X
BEQ BLK60
DEX
BPL BLK50
BMI BLK10
BLK60
TXA
ORA #$80
STA CMDNUM
JSR BLKPAR ; PARSE PARMS
LDA CMDNUM
ASL A
TAX
LDA BCJMP+1,X
STA TEMP+1
LDA BCJMP,X
STA TEMP
JMP (TEMP) ; GOTO COMMAND
BCTAB
.BYTE 'AFRWEP'
NBCMDS = *-BCTAB
BCJMP
.WORD BLKALC ; BLOCK-ALLOCATE
.WORD BLKFRE ; BLOCK-FREE
.WORD BLKRD ; BLOCK-READ
.WORD BLKWT ; BLOCK-WRITE
.WORD BLKEXC ; BLOCK-EXECUTE
.WORD BLKPTR ; BLOCK-POINTER
BLKPAR
LDY #0 ; PARSE BLOCK PARMS
LDX #0
LDA #':
JSR PARSE
BNE BP05 ; FOUND ':'
LDY #3 ; ELSE CHAR #3 IS BEGINNING
BP05
LDA CMDBUF,Y
CMP #'
BEQ BP10
CMP #29 ; SKIP CHARACTER
BEQ BP10
CMP #',
BNE BP20
BP10
INY
CPY CMDSIZ
BCC BP05
RTS ; THAT'S ALL
BP20
JSR ASCHEX
INC F1CNT
LDY F2PTR
CPX #MXFILS-1
BCC BP10
BCS BLK30 ; BAD SYNTAX
;
; CONVERT ASCII TO HEX (BINARY)
; & STORE CONVERSION IN TABLES
; .Y = PTR INTO CMDBUF
;
ASCHEX
LDA #0
STA TEMP
STA TEMP+1
STA TEMP+3
LDX #$FF
AH10
LDA CMDBUF,Y ; TEST FOR DEC #
CMP #$40
BCS AH20 ; NON-NUMERIC TERMINATES
CMP #$30
BCC AH20 ; NON-NUMERIC
AND #$F
PHA
LDA TEMP+1 ; SHIFT DIGITS (*10)
STA TEMP+2
LDA TEMP
STA TEMP+1
PLA
STA TEMP
INY
CPY CMDSIZ
BCC AH10 ; STILL IN STRING
AH20
STY F2PTR ; CONVERT DIGITS TO...
CLC ; ...BINARY BY DEC TABLE
LDA #0
AH30
INX
CPX #3
BCS AH40
LDY TEMP,X
AH35
DEY
BMI AH30
ADC DECTAB,X
BCC AH35
CLC
INC TEMP+3
BNE AH35
AH40
PHA
LDX F1CNT
LDA TEMP+3
STA FILTRK,X ; STORE RESULT IN TABLE
PLA
STA FILSEC,X
RTS
DECTAB
.BYTE 1,10,100 ; DECIMAL TABLE
;
; BLOCK-FREE
;
BLKFRE
JSR BLKTST
JSR FRETS
JMP ENDCMD
;
; BLOCK-ALLOCATE
;
BLKALC
JSR BLKTST
JSR GETHED ; EXTRACT THE HEAD NUMBER
LDA SECTOR
PHA
JSR GETSEC
BEQ BA15 ; NONE GREATER ON THIS TRACK
PLA
CMP SECTOR
BNE BA30 ; REQUESTED SECTOR NOT AVAIL
JSR USEDT0 ; HEAD ALREADY OUT
JMP ENDCMD
BA15
PLA ; POP STACK
BA20
LDA #0
STA SECTOR ; START AT SECTOR 0
INC HEAD ; HEAD+1
LDA HEAD
CMP HEADS
BCC BA25
LDA #0
STA HEAD ; SET HEAD = 0
INC TRACK
LDA TRACK
CMP MAXTRK
BCS BA40 ; GONE ALL THE WAY
BA25
JSR GETSEC
BEQ BA20
BA30
JSR ADDHED ; ADD THE HEAD TO THE SECTOR
LDA #NOBLK
JSR CMDER2
BA40
LDA #NOBLK
JSR CMDERR ; T = 0, S = 0, NONE LEFT
;
; BLOCK READ SUBS
;
BLKRD2
JSR BKOTST ; TEST PARMS
JMP DRTRD
GETSIM
JSR GETPRE ; GET BYTE W/O INC
LDA (BUFTAB,X)
RTS
;
; BLOCK READ
;
BLKRD3
JSR BLKRD2
LDA #0
JSR SETPNT
JSR GETSIM ; .Y = LINDX
STA LSTCHR,Y
LDA #RNDRDY
STA CHNRDY,Y
RTS
BLKRD
JSR BLKRD3
JSR RNGET1
JMP ENDCMD
;
; USER DIRECT READ, LSTCHR = $FF
;
UBLKRD
JSR BLKPAR
JSR BLKRD3
LDA LSTCHR,Y
STA CHNDAT,Y
LDA #$FF
STA LSTCHR,Y
JMP ENDCMD ; (RTS)
;
; BLOCK-WRITE
;
BLKWT
JSR BKOTST
JSR GETPNT
TAY
DEY
CMP #2
BCS BW10
LDY #1
BW10
LDA #0 ; SET RECORD SIZE
JSR SETPNT
TYA
JSR PUTBYT
TXA
PHA
BW20
JSR DRTWRT ; WRITE BLOCK
PLA
TAX
LDY LINDX
JSR RNGET2
JMP ENDCMD
;
; USER DIRCT WRITE, NO LSTCHR
;
UBLKWT
JSR BLKPAR
JSR BKOTST
JSR DRTWRT
JMP ENDCMD
;
; BLOCK-EXECUTE
;
BLKEXC
JSR BLKRD2 ; READ BLOCK & EXECUTE
LDA #0
BE05
STA TEMP
LDX JOBNUM
LDA BUFIND,X
STA TEMP+1
JSR BE10 ; INDIRECT JSR
JMP ENDCMD
BE10
JMP (TEMP)
;
; BUFFER-POINTER, SET BUFFER POINTER
;
BLKPTR
JSR BUFTST
LDA JOBNUM
ASL A
TAX
LDA FILSEC+1
STA BUFTAB,X
JSR GETPRE
JSR RNGET2 ; SET UP GET
JMP ENDCMD
;
; TEST FOR ALLOCATED BUFFER..
; ..RELATED TO SA
;
BUFTST
LDX F1PTR
INC F1PTR
LDA FILSEC,X
TAY
DEY
DEY
CPY #BAMJOB
BCC BT20
BT15
LDA #NOCHNL
JMP CMDERR
BT20
STA SA
JSR FNDRCH
BCS BT15
JSR GETACT
STA JOBNUM
RTS
;
; TEST BLOCK OPERATION PARMS
;
BKOTST
JSR BUFTST
;
; TEST FOR LEGAL BLOCK &..
; ..SET UP DRV, TRK, SEC
;
BLKTST
LDX F1PTR
LDA FILSEC,X
AND #1
STA DRVNUM
LDA FILSEC+2,X
STA SECTOR
LDA FILSEC+1,X
STA TRACK
BT05
JSR TSCHK
JMP SETLDS ; (RTS)
.END

+ 15
- 0
DOS_D9065/changes View File

@@ -0,0 +1,15 @@
.PAGE 'CHANGES'
;
; EXPANDED RELATIVE RECORD CHANGES ARE:
;
; COPY PAGE #
; FNDREL PAGE #
; CLOSE PAGE #
; OPCHNL PAGE #
; SSUTIL PAGE #
; SSTEST PAGE #
; SSEND PAGE #
; ADDREL PAGE #
; NEWSS PAGE #
; SYSTEM PAGE #
.END

+ 45
- 0
DOS_D9065/chksum View File

@@ -0,0 +1,45 @@
.PAGE 'CHECKSUM'
*=$005E
TEMP *=*+2
*=$0500
CLD
SEI
LDA #0
STA $1000
CMP $1000
CHKPRO
BNE CHKPRO
LDA #$10
JSR CHKSUM
STA $1000
BRK
LDA #0
STA $3000
CMP $3000
BNE CHKPRO
LDA #$30
JSR CHKSUM
STA $3000
BRK
CHKSUM
CLC
STA TEMP+1
LDA #0
STA TEMP
LDX #32
LDY #0
CHK1
ADC (TEMP)Y
INY
BNE CHK1
INC TEMP+1
DEX
BNE CHK1
ADC #0
STA TEMP+1
LDA #$C0
SEC
SBC TEMP+1
SBC #0
RTS
.END

+ 209
- 0
DOS_D9065/close View File

@@ -0,0 +1,209 @@
.PAGE 'CLOSE'
;
; CLOSE THE FILE ASSOCIATED WITH SA
;
CLOSE
LDA SA
BNE CLS10 ; DIRECTORY CLOSE
LDA #0
STA DIRLST ; CLEAR DIR LIST
JSR FRECHN
CLS05
JMP FREICH
CLS10
CMP #$F
BEQ CLSALL ; CLOSE CMD CHANL
JSR CLSCHN ; CLOSE CHANNEL
LDA SA
CMP #2
BCC CLS05
JMP ENDCMD
;
; CLOSE ALL SECONDARY CHANNELS
;
CLSALL
LDA #14
STA SA
CLS20
JSR CLSCHN
DEC SA
BPL CLS20
JMP ENDCMD
;
; CLOSE SECONDARY ADDRESS (SA)
;
CLSCHN
LDX SA
LDA LINTAB,X
CMP #$FF
BNE CLSC28
RTS
CLSC28
AND #$F
STA LINDX
JSR TYPFIL
CMP #DIRTYP
BEQ CLSC30 ; DIRECT CHANNEL
CMP #RELTYP
BEQ CLSREL
JSR FNDWCH ; LOOK FOR WRITE CHANNEL
BCS CLSC31
JSR CLSWRT ; CLOSE SEQ WRITE
JSR CLSDIR ; CLOSE DIRECTORY
CLSC30
JSR MAPOUT ; WRITE BAM OUT
CLSC31
JMP FRECHN
CLSREL
JSR SCRUB
JSR DBLBUF
JSR SSEND
LDX SSNUM
STX T4
LDA SSIND
SEC
SBC #SSIOFF-2
STA T3
LDA GRPNUM
STA R3
JSR SSSCAL
LDX #0
LDA #2
JSR ADDLIT
LDX LINDX
LDA RESULT
STA NBKL,X
LDA RESULT+1
STA NBKH,X
LDA #DYFILE
JSR TSTFLG ; TEST IF FILE WRITTEN TO
BEQ CLSR1
JSR CLSDIR
CLSR1
JMP FRECHN
;
; CLOSE A WRITE CHANL
;
CLSWRT
LDX LINDX
LDA NBKL,X
ORA NBKH,X
BNE CLSW10 ; AT LEAST 1 BLOCK WRITTEN
JSR GETPNT
CMP #2
BNE CLSW10 ; AT LEAST 1 BYTE WRITTEN
LDA #CR
JSR PUTBYT
CLSW10
JSR GETPNT
CMP #2
BNE CLSW20 ; NOT MT BUFFER
JSR DBLBUF ; SWITCH BUFS
LDX LINDX
LDA NBKL,X
BNE CLSW15
DEC NBKH,X
CLSW15
DEC NBKL,X
JSR GETLNK
JSR FRETS ; FREE EXTRA SECTOR
LDA #0
CLSW20
SEC
SBC #1 ; BACK UP 1
PHA ; SAVE IT
LDA #0
JSR SETPNT
JSR PUTBYT ; TRACK LINK = 0
PLA ; LSTCHR COUNT
JSR PUTBYT
JSR WRTBUF ; WRITE OUT LAST BUFFER
JSR WATJOB ; FINISH JOB UP
JMP DBLBUF ; MAKE SURE BOTH BUFS OK
;
; DIRECTORY CLOSE ON OPEN WRITE FILE
;
CLSDIR
LDX LINDX ; SAVE LINDX
STX WLINDX ; AND SA
LDA SA
PHA
LDA DSEC,X ; GET DIRECTORY SECTOR
STA SECTOR
LDA DTRK,X
STA TRACK
LDA DIND,X ; GET SECTOR OFFSET
STA INDEX
LDA FILTYP,X ; DRIVE # IN FILTYP
AND #1
STA DRVNUM
JSR GETACT ; ALLOCATE A BUFFER
PHA
STA JOBNUM
JSR DRTRD ; READ DIRECTORY SECTOR
LDY #0
LDA BUFIND,X ; .X IS JOB#
STA R0+1
LDA INDEX
STA R0
LDA (R0),Y
AND #$20
BEQ CLSD5
JSR TYPFIL
CMP #RELTYP
BEQ CLSD6
LDA (R0),Y
AND #$8F ; REPLACE FILE
STA (R0),Y
INY
LDA (R0),Y
STA TRACK
STY TEMP+2
LDY #27 ; EXTRACT REPLACEMENT LINK
LDA (R0),Y ; TO LAST SECTOR
PHA
DEY
LDA (R0),Y
BNE CLSD4
STA TRACK
PLA
STA SECTOR
LDA #$67
JSR CMDER2
CLSD4
PHA
LDA #0
STA (R0)Y
INY
STA (R0)Y
PLA
LDY TEMP+2
STA (R0),Y
INY
LDA (R0),Y
STA SECTOR
PLA
STA (R0),Y
JSR DELFIL ; DELETE OLD FILE
JMP CLSD6 ; SET CLOSE BIT
CLSD5
LDA (R0),Y
AND #$F
ORA #$80
STA (R0),Y
CLSD6 LDX WLINDX
LDY #28 ; SET # OF BLOCKS
LDA NBKL,X
STA (R0),Y
INY
LDA NBKH,X
STA (R0),Y
PLA
TAX
LDA #WRITE ; WRITE DIRECTORY SECTOR
ORA DRVNUM
JSR DOIT
PLA
STA SA
JMP FNDWCH ; RESTORE LINDX
.END

+ 122
- 0
DOS_D9065/comprs View File

@@ -0,0 +1,122 @@
.PAGE 'COMPRESS DIRECTORY'
COMPRS
LDA BUFIND
STA DIRBUF+1 ; USE BUFFER 0
LDY #1
LDA #0
JSR SETBUF ; SET BUFFER 1 TO ZERO'S
LDA #1
STA IP
LDY DRVNUM
LDA DSTRK,Y ; START OF DIRECTORY (TRACK)
STA TRACK
LDA DSSEC,Y ; START OF DIRECTORY (SECTOR)
STA SECTOR
LDA #1 ; BUFFER 1 FOR NEW DIRECTORY
JSR SETH ; SET HEADER FOR NEW DIRECTORY
JMP COMPR1
COMPR0
LDA TRACK
BEQ COMPR5 ; DONE
COMPR1
LDA #0
STA JOBNUM ; DIRECTORY IN BUFFER 0
JSR SETH
JSR DOREAD ; READ THE DIRECTORY
LDA #0
STA DIRBUF
TAY
LDA (DIRBUF),Y ; NEXT SECTOR LINK (TRACK)
STA TRACK
BEQ COMPR2 ; NO LINK
INY
LDA (DIRBUF),Y ; NEXT SECTOR LINK (SECTOR)
STA SECTOR
JSR FRETS ; FREE THESE LINKS
COMPR2
LDA #2
STA DIRBUF
COMPR3
LDY #0
LDA (DIRBUF),Y ; GET FILE STATUS
BPL COMPR4 ; DELETE OR NOT CLOSED
JSR ADDENT ; ADD THIS ENTRY
COMPR4
LDA #32
CLC
ADC DIRBUF
STA DIRBUF ; POINT TO NEXT ENTRY
BCC COMPR3
BCS COMPR0 ; READ THE NEXT SECTOR
COMPR5
LDA #0
STA IP
TAY
STA (IP),Y ; TRACK LINK = 0, LAST SECTOR
INY
LDA #$FF
STA (IP),Y ; SECTOR LINK
LDA #1
STA JOBNUM
JMP DOWRIT ; WRITE LAST SECTOR (RTS)
.PAGE 'ADD ENTRY'
ADDENT
LDY #0
LDX #30 ; MOVE 30 CHARACTERS
ADDEN1
INC IP
LDA IP
CMP #1
BEQ ADDEN2 ; WRITE THIS SECTOR
TYA
PHA
LDA (DIRBUF),Y
LDY #0
STA (IP),Y ; STORE IN NEW DIRECTORY
PLA
TAY
INY
DEX
BNE ADDEN1
INC IP
INC IP
LDA IP
CMP #1
BNE ADDE1
DEC IP
ADDE1
RTS
ADDEN2
LDA TRACK
PHA
LDA SECTOR
PHA
LDY DRVNUM
LDA DSTRK,Y
STA TRACK
LDA #0
STA SECTOR
JSR NXT0 ; GET NEXT TRACK AND SECTOR
LDY #0
LDA SECTOR
STA (IP),Y ; SET NEXT SECTOR LINK
DEC IP
LDA TRACK
STA (IP),Y ; SET NEXT TRACK LINK
LDA #1
STA JOBNUM
JSR DOWRIT
LDA #1
JSR SETH ; SET HEADER FOR NEXT WRITE
PLA
STA SECTOR
PLA
STA TRACK
LDY #1
LDA #0
JSR SETBUF
LDA #1
STA IP
LDX #30
BNE ADDEN1 ; JUMP
.END

+ 108
- 0
DOS_D9065/copyall View File

@@ -0,0 +1,108 @@
.PAGE 'COPY ALL'
;
; COPY DISK TO DISK ROUTINES
;
CPYDTD
LDA FILTBL+1 ; SAVE IN TEMP
STA TEMP
LDY #40 ; 40 CHAR BUFFER
LDX CMDSIZ ; PREP TO MOVE
STY CMDSIZ ; END OF FILENAME2
MOVLP1
DEY
DEX
LDA CMDBUF,X ; MOV FN LIFO
STA CMDBUF,Y
CPX TEMP ; ACTUAL F2 VAL
BNE MOVLP1
STY FILTBL+1 ; POINTER TO F2
MOVLP2
JSR OPTSCH
JSR PUPS1 ; SETUP FIRST PASS
JSR FFST ; FIRST MATCH
BPL FIXIT ; ENTRY FOUND?
BMI ENDIT ; NO
EXLP0
PLA ; PULL NEEDED VARS
STA DIRSEC
PLA
STA FILTBL+1
PLA
STA LSTBUF
PLA
STA FILCNT
PLA
STA INDEX
PLA
STA FOUND
PLA
STA DELIND
PLA
STA DRVFLG
EXLP1
JSR PUPS1 ; SET UP VARS
JSR FFRE ; NEXT MATCH
BPL FIXIT ; FOUND ONE?
ENDIT
JMP ENDCMD ; NO! SO BYE
FIXIT
LDA DRVFLG ; PUSH NEEDED VARS
PHA
LDA DELIND
PHA
LDA FOUND
PHA
LDA INDEX
PHA
LDA FILCNT
PHA
LDA LSTBUF
PHA
LDA FILTBL+1
PHA
LDA DIRSEC
PHA
EXLP2
JSR TRFNME ; TRANSFER NAME
LDA #1 ; FAKE OUT LOOKUP
STA F1CNT
STA F2CNT
JSR LOOKUP
LDA #1
STA F1CNT
LDA #2 ; REAL
STA F2CNT
JSR CY ; COPY IT
JMP EXLP0 ; NEXT ONE FOLKS
;
; TRANSFER NAME (DIRBUF) TO CMDBUF
;
TRFNME
LDY #3 ; BOTH INDEXES
STY FILTBL ; BEGINING OF FILENAME1
TRF0
LDA (DIRBUF)Y ; MOVE IT
STA CMDBUF,Y
INY
CPY #19 ; ALL 16 CHARS PASSED?
BNE TRF0
RTS
;
; SET UP SUBROUTINE
;
PUPS1
LDA #0
STA REC
STA DRVCNT
STA FILTRK
STA FILTRK+1
LDA FILDRV+1 ; GET DRIVE NUMBER
AND #1
STA DRVNUM
ORA #1
STA DELSEC ; NONZERO
STA DELENT
LDA FILTBL+1 ; FN1 = FN2
STA FILTBL
RTS
.END

+ 67
- 0
DOS_D9065/copysetup View File

@@ -0,0 +1,67 @@
.PAGE 'DISK COPY'
;
; DSKCPY CHECK FOR TYPE
; AND PARSES SPECIAL CASE
;
DSKCPY
JSR PRSCLN ;FIND ":"
BNE DX0000
;
JSR PRSEQ
;
LDA #'* ;CPY ALL
LDX #39 ;PUT AT BUFFER END
STX FILTBL+1
STA CMDBUF,X ;PLACE *
INX
STX CMDSIZ
LDX #1 ;SET UP CNT'S
STX F1CNT
INX
STX F2CNT
JMP MOVLP2 ;ENTER ROUTINE
;
DX0000 JSR TC30 ;NORMAL PARSE
DX0005 JSR ALLDRS ;PUT DRV'S IN FILTBL
LDA IMAGE ;GET PARSE IMAGE
AND #%01010101 ;VAL FOR PATT COPY
BNE DX0020 ;MUST BE CONCAT OR NORMAL
LDX FILTBL ;CHK FOR *
LDA CMDBUF,X
CMP #'*
BNE DX0020
LDX #1 ;SET CNT'S
STX F1CNT
LDA FILDRV
CMP FILDRV+1
BEQ DX0010 ; NO 'C:*=:*'
INX
STX F2CNT
JMP CPYDTD ;GO COPY
DX0010 LDA #BADSYN ;SYNTAX ERROR
JMP CMDERR
DX0020 LDA IMAGE ;CHK FOR NORMAL
AND #%11011001
BNE DX0010
JMP COPY
;
PRSEQ
LDA #'= ;SPECIAL CASE
JSR PARSE
BNE X0020
X0015 LDA #BADSYN
JMP CMDERR
X0020 LDA CMDBUF,Y
JSR TST0V1
BMI X0015
STA FILDRV+1 ;SRC DRV
DEY
DEY
LDA CMDBUF,Y
JSR TST0V1
BMI X0015
CMP FILDRV+1 ;CANNOT BE EQUAL
BEQ X0015
STA FILDRV ;DEST DRV
RTS
.END

+ 44
- 0
DOS_D9065/dos View File

@@ -0,0 +1,44 @@
.PAGE 'SUPER DOS 3.0'
.SKIP 6
;******************************************
;* *
;* SSSS UU UU PPPP EEEE RRRR *
;* SSSSSS UU UU PPPPPP EEEEEE RRRRRR *
;* SS UU UU PP PP EE RR RR *
;* SS UU UU PP PP EE RR RR *
;* SSSSS UU UU PPPPPP EEEE RRRRRR *
;* SSSSS UU UU PPPPP EEEE RRRRR *
;* SS UU UU PP EE RR RR *
;* SS UU UU PP EE RR RR *
;* SSSSSS UUUUUU PP EEEEEE RR RR *
;* SSSS UUUU PP EEEE RR RR *
;* *
;* DDDDD OOOO SSSS *
;* DDDDDD OOOOOO SSSSSS *
;* DD DD OO OO SS *
;* DD DD OO OO SS *
;* DD DD OO OO SSSSS *
;* DD DD OO OO SSSSS *
;* DD DD OO OO SS *
;* DD DD OO OO SS *
;* DDDDDD OOOOOO SSSSSS *
;* DDDDD OOOO SSSS *
;* *
;******************************************
.SKIP 6
;******************************************
;* *
;* 9065D HARD DISK *
;* DISK OPERATING SYSTEM *
;* VERSION 3.0 *
;* RELEASED APRIL XX, 1981 *
;* MOS 2364 ROMS #XXXXXX *
;* -01 *
;* #XXXXXX *
;* -01 *
;* *
;* COPYRIGHT 1981 *
;* COMMODORE BUSINESS MACHINES *
;* *
;******************************************
.END

+ 201
- 0
DOS_D9065/dskint View File

@@ -0,0 +1,201 @@
.PAGE 'DSKINT'
;
; ERROR DISPLAY ROUTINE
; BLINKS THE (ERROR #)+1 IN ALL THREE LEDS
;
PEZRO
LDX #0 ; ERROR#1 FOR ZERO PAGE
.BYTE $2C ; SKIP NEXT TWO BYTES
PERR
LDX TEMP ; GET THE ERROR#
TXS ; USE STACK AS STORAGE REG.
PE20
TSX ; RESTORE ERROR#
PE30
LDA #ERRLED+LED0+LED1
STA PBD2 ; TURN ON ALL THREE LEDS
TYA
PD10
CLC
PD20
ADC #1
BNE PD20
DEY ; DONE?
BNE PD10 ; NO
STY PBD2 ; TURN OFF ALL LEDS
PE40
TYA
PD11
CLC
PD21
ADC #1
BNE PD21
DEY ; DONE?
BNE PD11 ; NO
DEX
BPL PE30 ; BLINK AGAIN
CPX #$FC ; WAITED BETWEEN COUNTS?
BNE PE40 ; NO
BEQ PE20 ; ALWAYS - ALL AGAIN
DSKINT
SEI
CLD
LDX #$FF
STX IEEEDO
STX PBDD1
INX ; .X = 0
STX PBD2 ; CLEAR LED'S
LDA #DAVO+EOIO+RFDO
STA PAD2
LDA #$1F
STA PADD2
LDA #ERRLED+LED0+LED1
STA PBDD2
STA PBDD2
;
;*********************************
;
; POWER UP DIAGNOSTIC
;
;*********************************
;
LDY #0
LDX #0
PU10
TXA ; FILL Z-PAGE ACCEND PATTERN
STA $0,X
INX
BNE PU10
PU20
TXA ; CHECK PATTERN BY INC...
CMP $0,X ; ...BACK TO ORIG #
BNE PEZRO ; BAD BITS
PU30
INC $0,X ; BUMP CONTENTS
CLC
ADC #1 ; BUMP COUNT
CMP $0,X ; CHECK IT
BNE PEZRO ; WRONG
CMP $1,X ; CHECK IF DONE
BNE PU30 ; NOT DONE
TXA
ADC #0 ; .A = .A+1, (.C = 1)
CMP $0,X ; DOUBLE CHECK FOR DONE
BNE PEZRO ; SOMETHING'S WRONG
STY $0,X ; LEAVE Z-PAGE ZEROED
LDA $0,X ; CHECK IT
BNE PEZRO ; WRONG
INX ; NEXT!
BNE PU20 ; NOT ALL DONE
;
; SET CONTROLLER TO RESET IF SOFT RESET
;
LDA #$78 ; SEI
STA $1100
LDA #$6C
STA $1101
LDA #$FC
STA $1102
LDA #$FF
STA $1103 ; JMP ($FFFC)
LDA #$D0
STA JOBS
;
; TEST TWO 64K-BIT ROMS
;
; ENTER X = START PAGE
; EXIT IF OK
;
RM10
INC TEMP ; NEXT ERROR#
STX IP+1 ; SAVE PAGE, START X = 0
LDA #0
STA IP ; ZERO LO INDIRECT
TAY
LDX #32 ; 32 PAGES IN 8K ROM
CLC
RT10
DEC IP+1 ; DO IT BACKWARDS
RT20
ADC (IP),Y ; TOTAL CHECKSUM IN A
INY
BNE RT20
DEX
BNE RT10
ADC #0 ; ADD IN LAST CARRY
TAX ; SAVE LOWER PAGE IN X
CMP IP+1 ; CORRECT?
BNE PERR2
CPX #$C0 ; DONE BOTH ROMS?
BNE RM10
;
; TEST ALL COMMON RAM
;
CR20
LDA #$10 ; START OF 1ST BLOCK
CR30
STA IP+1 ; SAVE PAGE#
INC TEMP ; BUMP ERROR#
RAMTST
LDX #4 ; SAVE PAGE COUNT
RA10
TYA ; FILL WITH ADR SENSITIVE PATTERN
CLC
ADC IP+1
STA (IP),Y
INY
BNE RA10
INC IP+1
DEX
BNE RA10
LDX #4 ; RESTORE PAGE COUNT
RA30
DEC IP+1 ; CHECK PATTERN BACKWARDS
RA40
DEY
TYA ; GEN PATTERN AGAIN
CLC
ADC IP+1
CMP (IP),Y ; OK?
BNE PERR2 ; NO, SHOW ERROR#
EOR #$FF ; YES, TEST INVERSE PATTERN
STA (IP),Y
EOR (IP),Y ; OK?
STA (IP),Y ; LEAVE MEMORY ZERO
BNE PERR2 ; NO, SHOW ERROR#
TYA
BNE RA40
DEX
BNE RA30
LDA IP+1 ; GET FIRST PAGE OF BLOCK
CLC
ADC #$10 ; NEXT BLOCK
CMP #$50 ; DONE?
BNE CR30 ; NO
;
;**********************************
;
; CONTROLLER TEST & INITIALIZATION
;
;**********************************
;
LDA #3 ; SET ERROR# TO 3+1
STA TEMP
LDA #1
CMP $1000 ; CHECK WAIT FLAG
BNE PERR2 ; NOT GOOD
LDY #0
STY $1000 ; LET CONTROLLER GO
LDA #ERRLED+LED0+LED1
STA PBD2 ; FLIP LEDS ON DURING TEST
CTEST2
LDA $1000
BEQ CTEST2 ; WAIT FOR CONTROLLER
CMP #1 ; CONTROLLER OK?
BEQ DIAGOK ; YES
STA TEMP ; CONTROLLER ERROR CODE
PERR2
JMP PERR
DIAGOK
JMP BEGIN ; START OF DOS
.END

+ 207
- 0
DOS_D9065/duplct View File

@@ -0,0 +1,207 @@
.PAGE 'DUPLICATE'
;
; DUPLICATE DISK
;
DUPLCT
LDA #BADCMD
JMP CMDERR ; BAD COMMAND FOR SINGLE DISK
;
; FORMAT THE DRIVE
;
JFORMT
LDY #0
STY JOBNUM ; USE JOB NUMBER 0
JSR JOB2X ; .X = JOBNUM*8
TYA
STA HDRS+2,X
STA HDRS+3,X
INY
STY INTRLV ; INTERLEAVE = 1
LDA #FMTCMD ; FORMAT COMMAND
JSR DOJOB ; FORMAT THE DRIVE
FORMA0
LDA #0 ; USE JOB NUMBER 0
FORMA1
STA JOBNUM
JSR JOB2X ; .X = JOBNUM*8
LDA #0
STA R0 ; R0 = 0, NEW TRACK
STA HDRS+2,X ; TRACK = 0
STA HDRS+3,X ; SECTOR, HEAD = 0
STA SECTOR ; FIRST SECTOR
JSR WORST ; WRITE WORST CASE PATTERN (DB6C)
JSR SETBTS ; SET UP BAD T, S AND H
FORMA2
LDA MAXCYL ; SECTORS/CYLINDER
FORMA3
STA XFRINT ; CHECK 1 CYLINDER AT A TIME
LDA #%11000000
STA ECCRTY ; DISABLE ECC AND RETRY
LDA #1
STA JOBNUM
LDA #$FF
STA JOBRTN ; RETURN ALL ERRORS
LDA #WRITE
JSR DOJOB ; VERIFY ALL SECTORS
CMP #2 ; ANY ERRORS?
BCC FORMA4 ; NO, DONE WITH THIS CYLINDER
JSR ADDBTS ; YES, ADD TO BAD T, S AND H
JSR JOB2X ; .X = JOBNUM*8
INC HDRS+3,X ; NEXT SECTOR, HEAD
LDA MAXCYL
SEC
SBC HDRS+3,X
BNE FORMA3 ; XFRINT = MAXCYL-SECTOR, HEAD
FORMA4
JSR JOB2X ; .X = JOBNUM*8
LDA #0
STA HDRS+3,X ; BACK TO SECTOR, HEAD 0
STA R0 ; R0 = 0, NEW TRACK
INC HDRS+2,X ; TRACK = TRACK+1
LDA HDRS+2,X
CMP MAXTRK ; MORE TRACKS?
BCC FORMA2 ; YES, DO THE NEXT CYLINDER
JMP WRTBTS ; WRITE LAST LIST (RTS)
;
; SET UP BAD T, S AND H
;
; RETURNS WITH:
;
; BUFFER(JOBNUM) = $FF
; INDEX POINTER (IP) = 2
;
SETBTS
LDY JOBNUM
LDA #$FF
JSR SETBUF ; SET BUFFER TO $FF'S
INC IP
INC IP ; IP = 2
RTS
;
; SET BUFFER TO CONTENTS OF .A
;
; ON ENTRY:
;
; .Y = BUFFER NUMBER
; .A = BUFFER CONTENTS
;
SETBUF
LDX BUFIND,Y
STX IP+1
LDY #0
STY IP
SETBU1
STA (IP),Y
INY
BNE SETBU1
RTS
;
; ADD T, S AND H TO LIST
;
ADDBTS
LDY #0
LDA R0 ; NEW TRACK?
BNE ADDBT2 ; NO, JUST ADD SECTOR, HEAD
INC R0 ; R0 <> 0
INC IP ; LEAVE AN $FF
BNE ADDBT1
JSR WRTBTS ; WRITE THIS LIST
ADDBT1
JSR JOB2X ; .X = JOBNUM*8
LDA HDRS+2,X ; TRACK
STA (IP),Y ; MARK THE TRACK
INC IP
BNE ADDBT2
JSR WRTBTS ; WRITE THIS LIST
ADDBT2
JSR JOB2X ; .X = JOBNUM*8
LDA HDRS+3,X ; SECTOR, HEAD
STA (IP),Y ; MARK THE SECTOR, HEAD
INC IP
BNE ADDBT3
JSR WRTBTS ; WRITE THIS LIST
ADDBT3
RTS
;
; WRITE THE BAD T, S AND H LIST
;
WRTBTS
LDA #0
STA JOBNUM ; BTS IN BUFFER 0
JSR JOB2X ; .X = JOBNUM*8
LDA SECTOR
CLC
ADC #1 ; NEXT SECTOR, HEAD
CMP MAXCYL
BCS WRTBT2 ; NO MORE SECTORS
STA HDRS+3,X ; POSSIBLE NEXT SECTOR, HEAD
LDA #0
STA HDRS+2,X ; CYLINDER 0 ONLY
WRTBT1
LDA #$FF
STA JOBRTN ; RETURN ALL ERRORS
JSR DOWRIT ; TRY TO WRITE IT
CMP #2 ; ANY ERRORS?
BCC WRTBT3 ; NO
JSR JOB2X ; YES, .X = JOBNUM*8
INC HDRS+3,X ; NEXT SECTOR, HEAD
LDA HDRS+3,X
CMP MAXCYL
BCC WRTBT1 ; TRY THE NEXT SECTOR, HEAD
WRTBT2
LDA #12
JMP ERROR ; FORMAT ERROR
WRTBT3
LDA SECTOR ; GET THE PREVIOUS SECTOR
BNE WRTBT4 ; HAS A PREVIOUS SECTOR
JSR JOB2X ; .X = JOBNUM*8
LDY DRVNUM
LDA HDRS+3,X
STA BTSSEC,Y ; START OF BAD T, S AND H (SECTOR)
LDA #0
STA BTSTRK,Y ; START OF BAD T, S AND H (TRACK)
BEQ WRTBT5 ; JUMP
WRTBT4
JSR JOB2X ; .X = JOBNUM*8
LDA HDRS+3,X ; CURRENT SECTOR
PHA ; SAVE IT
LDA SECTOR ; PREVIOUS SECTOR
STA HDRS+3,X ; NOW THE CURRENT SECTOR
JSR DOREAD ; READ THE PREVIOUS SECTOR
LDY #0
TYA
STA IP
STA (IP),Y ; SET THE TRACK LINK
INY
PLA ; CURRENT SECTOR
STA (IP),Y ; SET THE SECTOR LINK
PHA ; SAVE THE SECTOR AGAIN
JSR DOWRIT ; WRITE THE PREVIOUS BTS
JSR JOB2X ; .X = JOBNUM*8
PLA ; CURRENT SECTOR
STA HDRS+3,X ; RESTORE THE CURRENT SECTOR
WRTBT5
JSR JOB2X ; .X = JOBNUM*8
LDA HDRS+3,X
STA SECTOR ; NOW THE CURRENT SECTOR
JSR SETBTS ; SET UP FOR NEW BUFFER
LDA #1
STA JOBNUM
RTS
.PAGE
WORST
LDY #1
LDA BUFIND,Y
STA IP+1
DEY ; .Y = 0
STY IP
WORST1
LDA #$DB
STA (IP),Y
INY
LDA #$6C
STA (IP),Y
INY
BNE WORST1
RTS
.END

+ 2
- 0
DOS_D9065/echksm View File

@@ -0,0 +1,2 @@
ECHKSM .BYTE 0
.END

+ 55
- 0
DOS_D9065/equate View File

@@ -0,0 +1,55 @@
.PAGE 'EQUATE'
;
; EQUATES
;
ROM = $C000 ; START OF DOS
LRF = $80
DYFILE = $40
OVRFLO = $20
NSSL = 6
SSIOFF = 4+NSSL+NSSL
NSSP = 120
LOTRK = 4
HITRK = 5
MXCHNS = 8
MAXSA = 18
CR = $0D ; CARRIAGE RETURN
BFCNT = 12
BAMJOB = BFCNT
CBPTR = BAMJOB+BAMJOB+4
ERRCHN = MXCHNS-1
ERRSA = 16
CMDCHN = MXCHNS-2
LXINT = $3F
CMDSA = 15
APMODE = 2
MDMODE = 3
RDMODE = 0
WTMODE = 1
RELTYP = 4 ; RELATIVE TYPE FILE
DIRTYP = 7 ; DIRECT TYPE FILE
SEQTYP = 1 ; SEQUENTIAL TYPE FILE
PRGTYP = 2 ; PROGRAM TYPE FILE
USRTYP = 3 ; USER TYPE FILE
TYPMSK = 7
IRSA = 17 ; INTERNAL READ CHANNEL
IWSA = 18 ; INTERNAL WRITE CHANNEL
DOSVER = 3 ; DOS VERSION
;
;CONTROLLER JOB TYPES
;
READ = $80 ; READ
WRITE = $90 ; WRITE
WVERFY = $A0 ; WRITE VERIFY
SEEK = $B0 ; SEEK
SECSEK = $B8 ; SECTOR SEEK
BUMP = $C0 ; RESTORE
FMTCMD = $C4 ; FORMAT
JUMPC = $D0 ; JUMP
EXEC = $E0 ; EXECUTE
MXFILS = 5 ; MAX # FILENAMES IN STRING
CMDIND = 30 ; CMD BUFFER INDEX (*2)
DIRLEN = 24 ; DIRECTORY LENGTH USED
NBSIZ = 27 ; NAMBUF TEXT SIZE
CMDLEN = 58 ; COMMAND LENGTH
.END

+ 4
- 0
DOS_D9065/erom View File

@@ -0,0 +1,4 @@
*=$E000
ECHKSM
.BYTE 0 ;CHECKSUM FOR $E-$F ROM
.END

+ 451
- 0
DOS_D9065/erproc View File

@@ -0,0 +1,451 @@
.PAGE 'ERPROC'
;
; ERROR PROCESSING
;
; CONTROLLER ERRORS
;
; 0 (1) NO ERROR
; 20 (2) CAN'T FIND BLOCK HEADER
; 21 (3) NO SYNCH CHARACTER
; 22 (4) DATA BLOCK NOT PRESENT
; 23 (5) CHECKSUM ERROR IN DATA
; 24 (16) BYTE DECODING ERROR
; 25 (7) WRITE-VERIFY ERROR
; 27 (9) CHECKSUM ERROR IN HEADER
; 75 (12) FORMAT ERROR
; 76 (127) CONTROLLER ERROR
;
; COMMAND ERRORS
;
; 30 GENERAL SYNTAX
; 31 INVALID COMMAND
; 32 LONG LINE
; 33 INVALID FILNAME
; 34 NO FILE GIVEN
; 39 COMMAND FILE NOT FOUND
;
; 50 RECORD NOT PRESENT
; 51 OVERFLOW IN RECORD
; 52 FILE TOO LARGE
;
; 60 FILE OPEN FOR WRITE
; 61 FILE NOT OPEN
; 62 FILE NOT FOUND
; 63 FILE EXISTS
; 64 FILE TYPE MISMATCH
; 65 NO BLOCK
; 66 ILLEGAL TRACK OR SECTOR
; 67 ILLEGAL SYSTEM T OR S
;
; 70 NO CHANNELS AVAILABLE
; 71 DIRECTORY ERROR
; 72 DISK FULL
; 73 CBM DOS V3.0
; 74 DRIVE NOT READY
;
; 1 FILES SCRATCHED RESPONSE
;
BADSYN = $30
BADCMD = $31
LONGLN = $32
BADFN = $33
NOFILE = $34
NOCFIL = $39
NOREC = $50
RECOVF = $51
BIGFIL = $52
FILOPN = $60
FILNOP = $61
FLNTFD = $62
FLEXST = $63
MISTYP = $64
NOBLK = $65
BADTS = $66
SYSTS = $67
NOCHNL = $70
DIRERR = $71
DSKFUL = $72
CBMVER = $73
NODRIV = $74
FMTERR = $75
CNTERR = $76
.PAGE
;
; ERROR MESSAGE TABLE
; LEADING ERRROR NUMBERS,
; TEXT WITH 1ST & LAST CHARS
; OR'ED WITH $80,
; TOKENS FOR KEY WORDS ARE
; LESS THAN $10 (AND'ED W/ $80)