Browse Source

reindented DOS_8070 to approximate the LST output of the assembler

master
Michael Steil 2 years ago
parent
commit
30a5a62154
74 changed files with 7409 additions and 7409 deletions
  1. +75
    -75
      DOS_8070/compress-dir
  2. +28
    -28
      DOS_8070/copy-overlay
  3. +59
    -59
      DOS_8070/copysetup
  4. +25
    -25
      DOS_8070/cu-links
  5. +34
    -34
      DOS_8070/dlinks
  6. +129
    -129
      DOS_8070/dos
  7. +24
    -24
      DOS_8070/equates
  8. +3
    -3
      DOS_8070/fmt-equates
  9. +99
    -99
      DOS_8070/fndrel
  10. +20
    -20
      DOS_8070/getact
  11. +114
    -114
      DOS_8070/hdaddfil
  12. +166
    -166
      DOS_8070/hdaddrel
  13. +204
    -204
      DOS_8070/hdalloc
  14. +29
    -29
      DOS_8070/hdautoit
  15. +13
    -13
      DOS_8070/hdchanges
  16. +174
    -174
      DOS_8070/hdclose
  17. +7
    -7
      DOS_8070/hdcom
  18. +134
    -134
      DOS_8070/hdcopy
  19. +89
    -89
      DOS_8070/hdcopyall
  20. +36
    -36
      DOS_8070/hdcuint
  21. +55
    -55
      DOS_8070/hddsect
  22. +235
    -235
      DOS_8070/hddskint
  23. +3
    -3
      DOS_8070/hddummy
  24. +41
    -41
      DOS_8070/hdequate
  25. +304
    -304
      DOS_8070/hderproc
  26. +176
    -176
      DOS_8070/hdfreused
  27. +39
    -39
      DOS_8070/hdidle
  28. +299
    -299
      DOS_8070/hdieee
  29. +99
    -99
      DOS_8070/hdinitdr
  30. +160
    -160
      DOS_8070/hdjobs
  31. +355
    -355
      DOS_8070/hdlookup
  32. +19
    -19
      DOS_8070/hdmapout
  33. +41
    -41
      DOS_8070/hdnewdir
  34. +125
    -125
      DOS_8070/hdnewss
  35. +188
    -188
      DOS_8070/hdopchnl
  36. +375
    -375
      DOS_8070/hdopen
  37. +81
    -81
      DOS_8070/hdpage0
  38. +119
    -119
      DOS_8070/hdpage2
  39. +219
    -219
      DOS_8070/hdparsex
  40. +14
    -14
      DOS_8070/hdram
  41. +115
    -115
      DOS_8070/hdrecord
  42. +84
    -84
      DOS_8070/hdrel1
  43. +57
    -57
      DOS_8070/hdrename
  44. +46
    -46
      DOS_8070/hdromtbl
  45. +71
    -71
      DOS_8070/hdscrtch
  46. +4
    -4
      DOS_8070/hdsetled
  47. +36
    -36
      DOS_8070/hdssend
  48. +36
    -36
      DOS_8070/hdsstest
  49. +122
    -122
      DOS_8070/hdssutil
  50. +244
    -244
      DOS_8070/hdsub1
  51. +203
    -203
      DOS_8070/hdtrnsfr
  52. +375
    -375
      DOS_8070/hdtst2
  53. +169
    -169
      DOS_8070/hdtst4
  54. +52
    -52
      DOS_8070/hdtstflg
  55. +86
    -86
      DOS_8070/hdtsutil
  56. +6
    -6
      DOS_8070/hdvector
  57. +196
    -196
      DOS_8070/hdverdir
  58. +9
    -9
      DOS_8070/i_odef
  59. +68
    -68
      DOS_8070/iodefs
  60. +47
    -47
      DOS_8070/irq
  61. +52
    -52
      DOS_8070/ldcopy
  62. +104
    -104
      DOS_8070/lstdir
  63. +1
    -1
      DOS_8070/memmap
  64. +54
    -54
      DOS_8070/memrw
  65. +34
    -34
      DOS_8070/nulbuf
  66. +177
    -177
      DOS_8070/rebuild-bams
  67. +76
    -76
      DOS_8070/rel2
  68. +37
    -37
      DOS_8070/rel3
  69. +45
    -45
      DOS_8070/rel4
  70. +97
    -97
      DOS_8070/setdrv
  71. +202
    -202
      DOS_8070/tst3
  72. +86
    -86
      DOS_8070/tsutil
  73. +8
    -8
      DOS_8070/work-equates
  74. +1
    -1
      README.md

+ 75
- 75
DOS_8070/compress-dir View File

@@ -6,98 +6,98 @@
;
;***************************************
COMPRS
LDX DRVNUM ;GET THE DRIVE #
LDA #0 ;CLEAR FLAG
STA HDDFLG,X ;*
JSR HDLDTS ;GET T&S OF DIR
JSR OPNIRD ;OPEN INTERNAL RD CHNL
LDA LINDX ;SAVE LINDX
STA TEMP+4 ;*
JSR OPNIWR ;OPEN INTERNAL WRITE CHNL
LDA LINDX ;SAVE WRITE CHNL
STA TEMP+5 ;*
LDA SECTOR ;SAVE NEW DIR SEC & TRK
STA NDSEC ;*
LDA TRACK ;*
STA NDTRK ;*
LDX DRVNUM ;GET THE DRIVE #
LDA #0 ;CLEAR FLAG
STA HDDFLG,X ;*
JSR HDLDTS ;GET T&S OF DIR
JSR OPNIRD ;OPEN INTERNAL RD CHNL
LDA LINDX ;SAVE LINDX
STA TEMP+4 ;*
JSR OPNIWR ;OPEN INTERNAL WRITE CHNL
LDA LINDX ;SAVE WRITE CHNL
STA TEMP+5 ;*
LDA SECTOR ;SAVE NEW DIR SEC & TRK
STA NDSEC ;*
LDA TRACK ;*
STA NDTRK ;*
;
; GET DIRECTORY FLAG
;
CMPRA
LDA TEMP+4 ;INPUT LINDX
STA LINDX
LDA #LRF ;EOF
JSR TSTFLG ;CHK IF EOF
BNE CMPR5 ;BR IF EOF
JSR GETPRE ;SET UP
LDA BUFTAB,X ;CHK IF AT BEG OF SECTOR
CMP #2 ;*
BEQ CMPR1 ;BR IF SO
INC BUFTAB,X ;SKIP FIRST TWO BYTES
INC BUFTAB,X ;SKIP FIRST TWO BYTES
LDA TEMP+4 ;INPUT LINDX
STA LINDX
LDA #LRF ;EOF
JSR TSTFLG ;CHK IF EOF
BNE CMPR5 ;BR IF EOF
JSR GETPRE ;SET UP
LDA BUFTAB,X ;CHK IF AT BEG OF SECTOR
CMP #2 ;*
BEQ CMPR1 ;BR IF SO
INC BUFTAB,X ;SKIP FIRST TWO BYTES
INC BUFTAB,X ;SKIP FIRST TWO BYTES
CMPR1
JSR GIBYTE ;GET NEXT BYTE
LDA DATA ;LOOK AT IT
BEQ CMPR2 ;BR IF DELETED ENTRY
JSR GIBYTE ;GET NEXT BYTE
LDA DATA ;LOOK AT IT
BEQ CMPR2 ;BR IF DELETED ENTRY
;
; COPY THIS DIRECTORY ENTRY TO NEW DIR
;
LDA TEMP+5 ;OUTPUT LINDX
STA LINDX ;*
JSR GETPRE ;SETUP
LDA BUFTAB,X ;CHK IF AT BEG OF SECTOR
CMP #2 ;*
BEQ CMPR3A ;BR IF AT BEG OF SECT
INC BUFTAB,X ;SKIP T&S
INC BUFTAB,X ;*
LDA TEMP+5 ;OUTPUT LINDX
STA LINDX ;*
JSR GETPRE ;SETUP
LDA BUFTAB,X ;CHK IF AT BEG OF SECTOR
CMP #2 ;*
BEQ CMPR3A ;BR IF AT BEG OF SECT
INC BUFTAB,X ;SKIP T&S
INC BUFTAB,X ;*
CMPR3A
LDA #30 ;COPY 30 BYTES
PHA ;*
LDA #30 ;COPY 30 BYTES
PHA ;*
CMPR3
LDA TEMP+5 ;OUTPUT LINDX
STA LINDX
LDA DATA ;DATA BYTE
JSR WRTBYT ;PUT IT
PLA ;DECR # BYTES TO COPY
SEC ;*
SBC #1 ;*
BEQ CMPRA ;BR IF DONE
PHA ;SAVE COUNT TO GO
JSR GIBYTE ;GET NEXT BYTE
JMP CMPR3 ;LOOP
LDA TEMP+5 ;OUTPUT LINDX
STA LINDX
LDA DATA ;DATA BYTE
JSR WRTBYT ;PUT IT
PLA ;DECR # BYTES TO COPY
SEC ;*
SBC #1 ;*
BEQ CMPRA ;BR IF DONE
PHA ;SAVE COUNT TO GO
JSR GIBYTE ;GET NEXT BYTE
JMP CMPR3 ;LOOP
;
; DELETED DIRECTORY ENTRY SO SKIP IT
;
CMPR2
LDA #29 ;SKIP THIRTY BYTES
LDA #29 ;SKIP THIRTY BYTES
CMPR4
PHA ;SAVE # TO SKIP
JSR GIBYTE ;GET & TOSS BYTE
PLA ;RESTORE # TO SKIP
SEC ;DEC BY 1
SBC #1
BNE CMPR4 ;LOOP TILL DONE
BEQ CMPRA ;BRA
PHA ;SAVE # TO SKIP
JSR GIBYTE ;GET & TOSS BYTE
PLA ;RESTORE # TO SKIP
SEC ;DEC BY 1
SBC #1
BNE CMPR4 ;LOOP TILL DONE
BEQ CMPRA ;BRA
;
; EOR ON INPUT SO WRAP UP
;
CMPR5
LDA TEMP+5 ;OUTPUT LINDX
STA LINDX
LDA #0 ;NULL REST OF DIR BUF
LDA TEMP+5 ;OUTPUT LINDX
STA LINDX
LDA #0 ;NULL REST OF DIR BUF
CMPR6
JSR PUTBYT ;PUT IN BUFR
BNE CMPR6 ;LOOP TILL BUFR FULL
LDA #255 ;SET LINK = FFFF
STA (BUFTAB,X) ;*
INC BUFTAB,X
STA (BUFTAB,X)
JSR WRTBUF ;WRITE LAST BUFR
JSR DBLBUF ;SWAP & WAIT
JSR DBLBUF ;SWAP & WAIT
JSR HDLDTS ;GET DIR T&S ADDR
JSR DELFIL ;DELETE OLD DIR SECTORS
LDX DRVNUM
JSR MAPOU1 ;WRITE OUT THE BAM
JMP FREICH ;FREE INTERNAL CHNLS
.END
JSR PUTBYT ;PUT IN BUFR
BNE CMPR6 ;LOOP TILL BUFR FULL
LDA #255 ;SET LINK = FFFF
STA (BUFTAB,X) ;*
INC BUFTAB,X
STA (BUFTAB,X)
JSR WRTBUF ;WRITE LAST BUFR
JSR DBLBUF ;SWAP & WAIT
JSR DBLBUF ;SWAP & WAIT
JSR HDLDTS ;GET DIR T&S ADDR
JSR DELFIL ;DELETE OLD DIR SECTORS
LDX DRVNUM
JSR MAPOU1 ;WRITE OUT THE BAM
JMP FREICH ;FREE INTERNAL CHNLS
.END

+ 28
- 28
DOS_8070/copy-overlay View File

@@ -13,31 +13,31 @@
; DATE: 1/20/81
; VERSION X.03
;
.PAG 'DSECTS'
.LIB HDDSECT
.PAG 'I/O DEFINITIONS'
.LIB I/ODEF
.PAG 'EQUATES'
.LIB EQUATES
.PAG 'EQUATES'
.LIB HDEQUATE
.PAG 'EQUATES'
.LIB FMT-EQUATES
.PAG 'DOS LINKS'
.LIB DLINKS
.PAG 'PAGE 0 RAM'
* = DOSPG0 ;ORIGIN ADDR
.LIB HDPAGE0
.PAG 'NON-PAGE 0'
* = DOSRAM
.LIB HDPAGE2
.PAG 'WORK EQUATES'
.LIB WORK-EQUATES
.PAG 'COPY OVERLAY'
*=CPYRAM
.LIB COPYSETUP
.PAG 'COPY OVERLAY'
.LIB HDCOPYALL
.PAG 'COPY OVERLAY
.LIB HDCOPY
.END
.PAG 'DSECTS'
.LIB HDDSECT
.PAG 'I/O DEFINITIONS'
.LIB I/ODEF
.PAG 'EQUATES'
.LIB EQUATES
.PAG 'EQUATES'
.LIB HDEQUATE
.PAG 'EQUATES'
.LIB FMT-EQUATES
.PAG 'DOS LINKS'
.LIB DLINKS
.PAG 'PAGE 0 RAM'
* = DOSPG0 ;ORIGIN ADDR
.LIB HDPAGE0
.PAG 'NON-PAGE 0'
* = DOSRAM
.LIB HDPAGE2
.PAG 'WORK EQUATES'
.LIB WORK-EQUATES
.PAG 'COPY OVERLAY'
*=CPYRAM
.LIB COPYSETUP
.PAG 'COPY OVERLAY'
.LIB HDCOPYALL
.PAG 'COPY OVERLAY
.LIB HDCOPY
.END

+ 59
- 59
DOS_8070/copysetup View File

@@ -3,68 +3,68 @@
; AND PARSES SPECIAL CASE
;
DSKCPY
.BYTE $AA,$55,$AA
LDA FMTVER ;GET CURRENT ROM VERSION NUMBER
CMP #VERN ;CHECK AGAINST OVERLAY VERSION NUMBER
BEQ DSKCP1
LDA #$29 ;DISK ID MISMATCH ERROR
JMP CMDERR ;POST ERROR
.BYTE $AA,$55,$AA
LDA FMTVER ;GET CURRENT ROM VERSION NUMBER
CMP #VERN ;CHECK AGAINST OVERLAY VERSION NUMBER
BEQ DSKCP1
LDA #$29 ;DISK ID MISMATCH ERROR
JMP CMDERR ;POST ERROR
DSKCP1
JSR PRSCLN ;FIND ":"
BNE DX0000
JSR PRSCLN ;FIND ":"
BNE DX0000
;
JSR PRSEQ
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
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
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
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
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
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

+ 25
- 25
DOS_8070/cu-links View File

@@ -10,28 +10,28 @@
;
; ADDRESSES LOCATED IN THE CONTROLLER
;
BMPJB = $C30F
CHECK = $C000 ;CHECK ENTRANCE
DMARST = $CBEB
DOOPSW = NMIRAM ;DOOR OPEN SWITCH
DORCK = $C70E ;DOOR OPEN CHECK
DOSSET = $C3BD
GENHD1 = $CAFC ;GEN HDR
GENHDR = $CB02 ;GENERATE HEADER
ID1WR = $C32A ;WRITE JOB
ID1WR1 = $C32D
IRQ4 = $C050
IRQPOL = $C019 ;IRQ ENTRANCE
NMI = NMIRAM+4 ;NMI ENTRANCE
POR = $C013 ;INITIALIZATION ENTRANCE
PORBMP = $C016 ;POWER UP RESTORE
POST1 = $C38F
PSTBAD = $CB86 ;POST BAD CMD
SCNX = $C2EB
SHSKP = $CBF1 ;SEEK HSKPG
START = $C000 ;START A JOB
STC2 = $C66B
STC3 = $C66B ;COMMON START
SUPDP = $CBCA
WPMSK = $C127 ;WRITE PROTECT MASK TABLE
.END
BMPJB = $C30F
CHECK = $C000 ;CHECK ENTRANCE
DMARST = $CBEB
DOOPSW = NMIRAM ;DOOR OPEN SWITCH
DORCK = $C70E ;DOOR OPEN CHECK
DOSSET = $C3BD
GENHD1 = $CAFC ;GEN HDR
GENHDR = $CB02 ;GENERATE HEADER
ID1WR = $C32A ;WRITE JOB
ID1WR1 = $C32D
IRQ4 = $C050
IRQPOL = $C019 ;IRQ ENTRANCE
NMI = NMIRAM+4 ;NMI ENTRANCE
POR = $C013 ;INITIALIZATION ENTRANCE
PORBMP = $C016 ;POWER UP RESTORE
POST1 = $C38F
PSTBAD = $CB86 ;POST BAD CMD
SCNX = $C2EB
SHSKP = $CBF1 ;SEEK HSKPG
START = $C000 ;START A JOB
STC2 = $C66B
STC3 = $C66B ;COMMON START
SUPDP = $CBCA
WPMSK = $C127 ;WRITE PROTECT MASK TABLE
.END

+ 34
- 34
DOS_8070/dlinks View File

@@ -1,34 +1,34 @@
ADDFIL = $EAB5
ADDR1 = $F7CE
ADRELS = $F904
ALLDRS = $D8F8
APPEND = $EE1C
BADSYN = $30
CHKIN = $DEE9
CHKIO = $DF04
CLSCHN = $EEFC
CMDERR = $D7B4
ENDCMD = $D78B
FFRE = $DAC2
FFST = $DAD1
FNDRCH = $E615
FNDWCH = $E630
GBYTE = $E913
LOOKUP = $DA86
MISTYP = $64
OPNIRD = $E9E5
OPNIWR = $E9F5
OPREAD = $ED88
OPTSCH = $D9D3
PARSE = $D843
PIBYTE = $E48D
PRSCLN = $D7D1
SETDRN = $E6FF
SETFLG = $F1F4
SETPNT = $EA2D
SSEND = $F659
TC30 = $D7E4
TST0V1 = $D98C
TSTFLG = $F206
TYPFIL = $E64D
.END
ADDFIL = $EAB5
ADDR1 = $F7CE
ADRELS = $F904
ALLDRS = $D8F8
APPEND = $EE1C
BADSYN = $30
CHKIN = $DEE9
CHKIO = $DF04
CLSCHN = $EEFC
CMDERR = $D7B4
ENDCMD = $D78B
FFRE = $DAC2
FFST = $DAD1
FNDRCH = $E615
FNDWCH = $E630
GBYTE = $E913
LOOKUP = $DA86
MISTYP = $64
OPNIRD = $E9E5
OPNIWR = $E9F5
OPREAD = $ED88
OPTSCH = $D9D3
PARSE = $D843
PIBYTE = $E48D
PRSCLN = $D7D1
SETDRN = $E6FF
SETFLG = $F1F4
SETPNT = $EA2D
SSEND = $F659
TC30 = $D7E4
TST0V1 = $D98C
TSTFLG = $F206
TYPFIL = $E64D
.END

+ 129
- 129
DOS_8070/dos View File

@@ -24,133 +24,133 @@
;
;
;*************************************
.PAG 'DSECTS'
.LIB HDDSECT
.PAG 'MEMORY MAP'
.LIB MEMMAP
.PAG 'I/O DEFINITIONS'
.LIB I/ODEF
.PAG 'I/O DEFINITIONS'
.LIB IODEFS
.PAG 'EQUATES'
.LIB EQUATES
.PAG 'EQUATES'
.LIB HDEQUATE
.PAG 'CU-LINKS'
.LIB CU-LINKS
.PAG 'PAGE 0 RAM'
* = DOSPG0 ;ORIGIN ADDRESS
.LIB HDPAGE0
.PAG 'NON-PAGE 0'
* = DOSRAM ;ORIGIN ADDRESS
.LIB HDPAGE2
.PAG 'WORK EQUATES'
.LIB WORK-EQUATES
.PAG 'ROM TABLES'
* = DOSCOD ;ORIGIN ADDRESS
.LIB HDROMTBL
.PAG 'POR ERRORS'
.LIB HDDSKINT
.PAG 'BG - IDLE'
.LIB HDIDLE
.PAG 'IRQ'
.LIB IRQ
.PAG 'IEEE'
.LIB HDIEEE
.PAG 'LED CONTROL'
.LIB HDSETLED
.PAG 'MAPOUT'
.LIB HDMAPOUT
.PAG 'ERROR PROC'
.LIB HDERPROC
.PAG 'LIST DIRECTORY'
.LIB LSTDIR
.PAG 'PARSE & EXECUTE'
.LIB HDPARSEX
.PAG 'SET DRIVE'
.LIB SETDRV
.PAG 'AUTO INIT'
.LIB HDAUTOIT
.PAG 'LOOKUP-OPTSCH'
.LIB HDLOOKUP
.PAG 'TRANSFER'
.LIB HDTRNSFR
.PAG 'SCRATCH'
.LIB HDSCRTCH
.PAG 'RENAME'
.LIB HDRENAME
.PAG 'MEM-RD,WRT,EX'
.LIB MEMRW
.PAG 'LOAD COPY OVER-LAY'
.LIB LDCOPY
.PAG 'VALIDATE'
.LIB HDVERDIR
.PAG 'VALIDATE'
.LIB COMPRESS-DIR
.PAG 'VALIDATE'
.LIB REBUILD-BAMS
.PAG 'FIND REL FILE'
.LIB FNDREL
.PAG 'TST2'
.LIB HDTST2
.PAG 'CU INTERFACE'
.LIB HDCUINT
.PAG 'TST3'
.LIB TST3
.PAG 'TST4'
.LIB HDTST4
.PAG 'JOBS'
.LIB HDJOBS
.PAG 'ADD FILE'
.LIB HDADDFIL
.PAG 'OPEN'
.LIB HDOPEN
.PAG 'CLOSE'
.LIB HDCLOSE
.PAG 'OPEN CHANNEL'
.LIB HDOPCHNL
.PAG 'TSTFLG'
.LIB HDTSTFLG
.PAG 'TSUTIL'
.LIB HDTSUTIL
.PAG 'SSUTIL'
.LIB HDSSUTIL
.PAG 'SSTEST'
.LIB HDSSTEST
.PAG 'GET ACT'
.LIB GETACT
.PAG 'REL1'
.LIB HDREL1
.PAG 'REL2'
.LIB REL2
.PAG 'REL3'
.LIB REL3
.PAG 'REL4'
.LIB REL4
.PAG 'SSEND'
.LIB HDSSEND
.PAG 'RECORD'
.LIB HDRECORD
.PAG 'NULL BUFR'
.LIB NULBUF
.PAG 'ADD REL'
.LIB HDADDREL
.PAG 'NEWSS'
.LIB HDNEWSS
.PAG 'INIT DRIVE'
.LIB HDINITDR
.PAG 'NEW DIRECTORY'
.LIB HDNEWDIR
.PAG 'GET & FREE SECTOR'
.LIB HDALLOC
.PAG 'FREE & USED '
.LIB HDFREUSED
.PAG 'SUBROUTINES'
.LIB HDSUB1
.PAG 'HARDWARE VECTORS'
.PAG 'ROM LRC'
.PAG 'DSECTS'
.LIB HDDSECT
.PAG 'MEMORY MAP'
.LIB MEMMAP
.PAG 'I/O DEFINITIONS'
.LIB I/ODEF
.PAG 'I/O DEFINITIONS'
.LIB IODEFS
.PAG 'EQUATES'
.LIB EQUATES
.PAG 'EQUATES'
.LIB HDEQUATE
.PAG 'CU-LINKS'
.LIB CU-LINKS
.PAG 'PAGE 0 RAM'
* = DOSPG0 ;ORIGIN ADDRESS
.LIB HDPAGE0
.PAG 'NON-PAGE 0'
* = DOSRAM ;ORIGIN ADDRESS
.LIB HDPAGE2
.PAG 'WORK EQUATES'
.LIB WORK-EQUATES
.PAG 'ROM TABLES'
* = DOSCOD ;ORIGIN ADDRESS
.LIB HDROMTBL
.PAG 'POR ERRORS'
.LIB HDDSKINT
.PAG 'BG - IDLE'
.LIB HDIDLE
.PAG 'IRQ'
.LIB IRQ
.PAG 'IEEE'
.LIB HDIEEE
.PAG 'LED CONTROL'
.LIB HDSETLED
.PAG 'MAPOUT'
.LIB HDMAPOUT
.PAG 'ERROR PROC'
.LIB HDERPROC
.PAG 'LIST DIRECTORY'
.LIB LSTDIR
.PAG 'PARSE & EXECUTE'
.LIB HDPARSEX
.PAG 'SET DRIVE'
.LIB SETDRV
.PAG 'AUTO INIT'
.LIB HDAUTOIT
.PAG 'LOOKUP-OPTSCH'
.LIB HDLOOKUP
.PAG 'TRANSFER'
.LIB HDTRNSFR
.PAG 'SCRATCH'
.LIB HDSCRTCH
.PAG 'RENAME'
.LIB HDRENAME
.PAG 'MEM-RD,WRT,EX'
.LIB MEMRW
.PAG 'LOAD COPY OVER-LAY'
.LIB LDCOPY
.PAG 'VALIDATE'
.LIB HDVERDIR
.PAG 'VALIDATE'
.LIB COMPRESS-DIR
.PAG 'VALIDATE'
.LIB REBUILD-BAMS
.PAG 'FIND REL FILE'
.LIB FNDREL
.PAG 'TST2'
.LIB HDTST2
.PAG 'CU INTERFACE'
.LIB HDCUINT
.PAG 'TST3'
.LIB TST3
.PAG 'TST4'
.LIB HDTST4
.PAG 'JOBS'
.LIB HDJOBS
.PAG 'ADD FILE'
.LIB HDADDFIL
.PAG 'OPEN'
.LIB HDOPEN
.PAG 'CLOSE'
.LIB HDCLOSE
.PAG 'OPEN CHANNEL'
.LIB HDOPCHNL
.PAG 'TSTFLG'
.LIB HDTSTFLG
.PAG 'TSUTIL'
.LIB HDTSUTIL
.PAG 'SSUTIL'
.LIB HDSSUTIL
.PAG 'SSTEST'
.LIB HDSSTEST
.PAG 'GET ACT'
.LIB GETACT
.PAG 'REL1'
.LIB HDREL1
.PAG 'REL2'
.LIB REL2
.PAG 'REL3'
.LIB REL3
.PAG 'REL4'
.LIB REL4
.PAG 'SSEND'
.LIB HDSSEND
.PAG 'RECORD'
.LIB HDRECORD
.PAG 'NULL BUFR'
.LIB NULBUF
.PAG 'ADD REL'
.LIB HDADDREL
.PAG 'NEWSS'
.LIB HDNEWSS
.PAG 'INIT DRIVE'
.LIB HDINITDR
.PAG 'NEW DIRECTORY'
.LIB HDNEWDIR
.PAG 'GET & FREE SECTOR'
.LIB HDALLOC
.PAG 'FREE & USED '
.LIB HDFREUSED
.PAG 'SUBROUTINES'
.LIB HDSUB1
.PAG 'HARDWARE VECTORS'
.PAG 'ROM LRC'
ECHKSM
.BYTE 0 ;CHK SUM FOR 2ND ROM
.LIB HDVECTOR
.PAGE ''
.END
.BYTE 0 ;CHK SUM FOR 2ND ROM
.LIB HDVECTOR
.PAGE ''
.END

+ 24
- 24
DOS_8070/equates View File

@@ -5,29 +5,29 @@
; SUB-SYTEMS OF THE DISK SOFTWARE
;
;***************************************
;DEFINE PAGE 0 USAGE
DOSPG0 = $00 ;DOS PAGE 0 BEGINNING
CUPAG0 = $E8 ;BEG ADDR OF PAGE 0 RAM
;DEFINE NON-PAGE 0 RAM USEAGE
NMIRAM = $880 ;FOR NMI
DOSRAM = $500 ;DOS WORK AREA START
CURAM = $200 ;BEG ADDR OF CU WORK AREA
CKSM = $200 ;BEG ADDR OF CHK SUM CODE
;DEFINE CODE LOCATIONS
; CU CODE FOLLOWS BEHIND NMI CODE
CUCODE = $C000 ;BEG ADDR OF CU CODE
DOSCOD = $CE50 ;DOS CODE
FMTCOD = $900 ;ORIGIN ADDR OF FMT CODE
FMTBUF = 16 ;FIRST BUFR FOR FMT
READ = $80 ;READ CMD
WRITE = $90 ;WRITE CMD
FMTCMD = $F0 ;FORMAT A TRACK CMD
BUMP = $C0 ;RESTORE CMD
SNSCMD = $B0 ;REQUEST SENSE CMD
WVERFY = $A0 ;VERIFY CMD
VOLTRK = 0 ;VOLUME LABEL TRACK
VOLSEC = 1 ;VOLUME LABEL SECTOR
FMTDRV = 04 ;FORMAT HARD DISK CMD
;DEFINE PAGE 0 USAGE
DOSPG0 = $00 ;DOS PAGE 0 BEGINNING
CUPAG0 = $E8 ;BEG ADDR OF PAGE 0 RAM
;DEFINE NON-PAGE 0 RAM USEAGE
NMIRAM = $880 ;FOR NMI
DOSRAM = $500 ;DOS WORK AREA START
CURAM = $200 ;BEG ADDR OF CU WORK AREA
CKSM = $200 ;BEG ADDR OF CHK SUM CODE
;DEFINE CODE LOCATIONS
; CU CODE FOLLOWS BEHIND NMI CODE
CUCODE = $C000 ;BEG ADDR OF CU CODE
DOSCOD = $CE50 ;DOS CODE
FMTCOD = $900 ;ORIGIN ADDR OF FMT CODE
FMTBUF = 16 ;FIRST BUFR FOR FMT
READ = $80 ;READ CMD
WRITE = $90 ;WRITE CMD
FMTCMD = $F0 ;FORMAT A TRACK CMD
BUMP = $C0 ;RESTORE CMD
SNSCMD = $B0 ;REQUEST SENSE CMD
WVERFY = $A0 ;VERIFY CMD
VOLTRK = 0 ;VOLUME LABEL TRACK
VOLSEC = 1 ;VOLUME LABEL SECTOR
FMTDRV = 04 ;FORMAT HARD DISK CMD
;
;
.END
.END

+ 3
- 3
DOS_8070/fmt-equates View File

@@ -5,6 +5,6 @@
; FORMATTER SOFTWARE
;
;***************************************
FMTVER = $FFF9 ;ROM VERSION #
VERN = $03 ;INTENDED VERSION #
.END
FMTVER = $FFF9 ;ROM VERSION #
VERN = $03 ;INTENDED VERSION #
.END

+ 99
- 99
DOS_8070/fndrel View File

@@ -26,27 +26,27 @@
;
;
;
FNDREL JSR MULPLY ;RESULT=RN*RS+RP
JSR DIV254 ;DIVIDE BY 254
LDA ACCUM+1 ;SAVE REMAINDER
STA RELPTR
JSR DIV120 ;DIVIDE BY 120
INC RELPTR
INC RELPTR
FNDREL JSR MULPLY ;RESULT=RN*RS+RP
JSR DIV254 ;DIVIDE BY 254
LDA ACCUM+1 ;SAVE REMAINDER
STA RELPTR
JSR DIV120 ;DIVIDE BY 120
INC RELPTR
INC RELPTR
;
; <BIG FILES CHANGE>
;
LDA ACCUM+1 ;GET REMAINDER
ASL A ;*2
CLC ;PLUS OFFSET TO FIRST SS PTR
ADC #16 ;*
STA SSIND ;*
JSR DIV006 ;DIVIDE SS # BY 6 TO GET GROUP #
LDA ACCUM+1 ;SAVE REMAINDER AS SSNUM
STA SSNUM ;*
LDA RESULT ;GET RESULT
STA GRPNUM ;SAVE AS THE DESIRED GROUP #
RTS
LDA ACCUM+1 ;GET REMAINDER
ASL A ;*2
CLC ;PLUS OFFSET TO FIRST SS PTR
ADC #16 ;*
STA SSIND ;*
JSR DIV006 ;DIVIDE SS # BY 6 TO GET GROUP #
LDA ACCUM+1 ;SAVE REMAINDER AS SSNUM
STA SSNUM ;*
LDA RESULT ;GET RESULT
STA GRPNUM ;SAVE AS THE DESIRED GROUP #
RTS
;
;
;
@@ -56,40 +56,40 @@ FNDREL JSR MULPLY ;RESULT=RN*RS+RP
;
; DESTROYS A,X
;
MULPLY JSR ZERRES ;RESULT=0
STA ACCUM+3 ;A=0
LDX LINDX ;GET INDEX
LDA RECL,X
STA ACCUM+1
LDA RECH,X
STA ACCUM+2
BNE MUL25 ;ADJUST FOR REC #1 &...
LDA ACCUM+1 ;...#0 = 1ST REC
BEQ MUL50
MUL25 LDA ACCUM+1
SEC
SBC #1
STA ACCUM+1
BCS MUL50
DEC ACCUM+2
MULPLY JSR ZERRES ;RESULT=0
STA ACCUM+3 ;A=0
LDX LINDX ;GET INDEX
LDA RECL,X
STA ACCUM+1
LDA RECH,X
STA ACCUM+2
BNE MUL25 ;ADJUST FOR REC #1 &...
LDA ACCUM+1 ;...#0 = 1ST REC
BEQ MUL50
MUL25 LDA ACCUM+1
SEC
SBC #1
STA ACCUM+1
BCS MUL50
DEC ACCUM+2
MUL50
LDA RS,X ;COPY RECSIZ
STA TEMP
MUL100 LSR TEMP ;DO AN ADD ?
BCC MUL200 ;NO
JSR ADDRES ;RESULT=RESULT+ACCUM+1,2,3
MUL200 JSR ACCX2 ;2*(ACCUM+1,2,3)
LDA TEMP ;DONE ?
BNE MUL100 ;NO
LDA RECPTR ;ADD IN LAST BIT
CLC
ADC RESULT
STA RESULT
BCC MUL400 ;SKIP NO CARRY
INC RESULT+1
BNE MUL400
INC RESULT+2
MUL400 RTS
LDA RS,X ;COPY RECSIZ
STA TEMP
MUL100 LSR TEMP ;DO AN ADD ?
BCC MUL200 ;NO
JSR ADDRES ;RESULT=RESULT+ACCUM+1,2,3
MUL200 JSR ACCX2 ;2*(ACCUM+1,2,3)
LDA TEMP ;DONE ?
BNE MUL100 ;NO
LDA RECPTR ;ADD IN LAST BIT
CLC
ADC RESULT
STA RESULT
BCC MUL400 ;SKIP NO CARRY
INC RESULT+1
BNE MUL400
INC RESULT+2
MUL400 RTS
;
;
;
@@ -97,60 +97,60 @@ MUL400 RTS
;
; RESULT=QUOTIENT ,ACCUM+1=REMAINDER
;
DIV254 LDA #254 ;DIVIDE BY 254
.BYTE $2C ;SKIP NEXT TWO BYTES
DIV120 LDA #120 ;DIVIDE BY 120
.BYTE $2C ;SKIP NEXT TWO BYTES
DIV006 LDA #6 ;DIVIDE BY 6
STA TEMP ;8 BIT DIVISOR
LDA #0 ;CLEAR PARTIAL DIVIDEND
STA ACCUM+1 ;*
STA ACCUM+2 ;*
LDX #24 ;24 BIT DIVIDEND
DIV254 LDA #254 ;DIVIDE BY 254
.BYTE $2C ;SKIP NEXT TWO BYTES
DIV120 LDA #120 ;DIVIDE BY 120
.BYTE $2C ;SKIP NEXT TWO BYTES
DIV006 LDA #6 ;DIVIDE BY 6
STA TEMP ;8 BIT DIVISOR
LDA #0 ;CLEAR PARTIAL DIVIDEND
STA ACCUM+1 ;*
STA ACCUM+2 ;*
LDX #24 ;24 BIT DIVIDEND
NXTBT
ASL RESULT ;SHIFT DIVIDEND/QUOTIENT
ROL RESULT+1 ;*
ROL RESULT+2 ;*
ROL ACCUM+1 ;INTO PARTIAL DIVIDEND
ROL ACCUM+2 ;*
LDA ACCUM+1 ;SUB 8 BIT DIVISOR
SEC ;PREP FOR SUB
SBC TEMP ;*
TAY ;SAVE RESULT
LDA ACCUM+2 ;RIPPLE THE CARRY
SBC #0 ;*
BCC CNTDN ;BR IF TEMP > DIVIDEND
INC RESULT ;SET LOW BIT OF RESULT
STA ACCUM+2 ;STORE UPDATED PARTIAL
STY ACCUM+1 ;*
ASL RESULT ;SHIFT DIVIDEND/QUOTIENT
ROL RESULT+1 ;*
ROL RESULT+2 ;*
ROL ACCUM+1 ;INTO PARTIAL DIVIDEND
ROL ACCUM+2 ;*
LDA ACCUM+1 ;SUB 8 BIT DIVISOR
SEC ;PREP FOR SUB
SBC TEMP ;*
TAY ;SAVE RESULT
LDA ACCUM+2 ;RIPPLE THE CARRY
SBC #0 ;*
BCC CNTDN ;BR IF TEMP > DIVIDEND
INC RESULT ;SET LOW BIT OF RESULT
STA ACCUM+2 ;STORE UPDATED PARTIAL
STY ACCUM+1 ;*
CNTDN
DEX ;CNT DOWN 24 BITS
BNE NXTBT
RTS
DEX ;CNT DOWN 24 BITS
BNE NXTBT
RTS
;
;
;
; ZERO RESULT
;
ZERRES LDA #0
STA RESULT
STA RESULT+1
STA RESULT+2
RTS
ZERRES LDA #0
STA RESULT
STA RESULT+1
STA RESULT+2
RTS
;
;
;
; MULTIPLY ACCUM BY 4
;
ACCX4 JSR ACCX2
ACCX4 JSR ACCX2
;
; MULTIPLY ACCUM BY 2
;
ACCX2 CLC
ACC200 ROL ACCUM+1
ROL ACCUM+2
ROL ACCUM+3
RTS
ACCX2 CLC
ACC200 ROL ACCUM+1
ROL ACCUM+2
ROL ACCUM+3
RTS
;
;
;
@@ -158,16 +158,16 @@ ACC200 ROL ACCUM+1
;
; RESULT=RESULT+ACCUM+1,2,3
;
ADDRES CLC
LDX #$FD
ADD100 LDA RESULT+3,X
ADC ACCUM+4,X
STA RESULT+3,X
INX
BNE ADD100
RTS
ADDRES CLC
LDX #$FD
ADD100 LDA RESULT+3,X
ADC ACCUM+4,X
STA RESULT+3,X
INX
BNE ADD100
RTS
;
;
;
;
.END
.END

+ 20
- 20
DOS_8070/getact View File

@@ -7,13 +7,13 @@
;*********************************
;
GETACT
LDX LINDX
LDA BUF0,X
BPL GA1
LDA BUF1,X
LDX LINDX
LDA BUF0,X
BPL GA1
LDA BUF1,X
GA1
AND #$BF ; STRIP DIRTY BIT
RTS
AND #$BF ; STRIP DIRTY BIT
RTS
;
;*********************************
;* GAFLG: GET ACTIVE BUFFER #; *
@@ -25,20 +25,20 @@ GA1
;*********************************
;
GAFLGS
LDX LINDX
GA2 STX LBUSED ;SAVE BUF #
LDA BUF0,X
BPL GA3
LDX LINDX
GA2 STX LBUSED ;SAVE BUF #
LDA BUF0,X
BPL GA3
;
TXA
CLC
ADC #MXCHNS
STA LBUSED
LDA BUF1,X
TXA
CLC
ADC #MXCHNS
STA LBUSED
LDA BUF1,X
GA3
STA T1
AND #$1F
BIT T1
RTS
STA T1
AND #$1F
BIT T1
RTS
;
.END
.END

+ 114
- 114
DOS_8070/hdaddfil View File

@@ -1,117 +1,117 @@
; ADD FILE TO DIRECTORY
.SKIP
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
.SKIP
LDX #1
STX DELIND ;LOOK FOR DELETED ENTRY
JSR SRCHST
BEQ AF15 ;ALL FULL, NEW SECTOR
BNE AF20 ;FOUND ONE
.SKIP
AF08 LDA DELSEC
CMP #255 ;<HD>
BEQ AF10 ;DELETED ENTRY NOT LOCATED
CMP SECTOR
BNE AF08A ;SECTOR IS NOT RES <HD>
LDA DELTRK ;CHK ALSO TRACK <HD>
CMP TRACK ;CHK IF RES <HD>
BEQ AF20 ;SECTOR IS RESIDENT <HD>
AF08A ;<HD>
LDA DELSEC ;<HD>
STA SECTOR ;<HD>
LDA DELTRK ;<HD>
STA TRACK ;<HD>
JSR DRTRD ;READ SECTOR IN
JMP AF20
.SKIP
AF10 LDA #1 ;FIND DELETED ENTRY
STA DELIND
JSR SEARCH
BNE AF20
AF15 JSR NXDRBK ;ALL FULL, NEW SECTOR
LDA SECTOR
STA DELSEC
LDA TRACK ;<HD>
STA DELTRK ;<HD>
LDA #2
STA DELIND
AF20 LDA DELIND
JSR SETPNT
PLA
STA TYPE ;SET TYPE
CMP #RELTYP
BNE AF25
ORA #$80
.SKIP
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
.SKIP
LDX #1
STX DELIND ;LOOK FOR DELETED ENTRY
JSR SRCHST
BEQ AF15 ;ALL FULL, NEW SECTOR
BNE AF20 ;FOUND ONE
.SKIP
AF08 LDA DELSEC
CMP #255 ;<HD>
BEQ AF10 ;DELETED ENTRY NOT LOCATED
CMP SECTOR
BNE AF08A ;SECTOR IS NOT RES <HD>
LDA DELTRK ;CHK ALSO TRACK <HD>
CMP TRACK ;CHK IF RES <HD>
BEQ AF20 ;SECTOR IS RESIDENT <HD>
AF08A ;<HD>
LDA DELSEC ;<HD>
STA SECTOR ;<HD>
LDA DELTRK ;<HD>
STA TRACK ;<HD>
JSR DRTRD ;READ SECTOR IN
JMP AF20
.SKIP
AF10 LDA #1 ;FIND DELETED ENTRY
STA DELIND
JSR SEARCH
BNE AF20
AF15 JSR NXDRBK ;ALL FULL, NEW SECTOR
LDA SECTOR
STA DELSEC
LDA TRACK ;<HD>
STA DELTRK ;<HD>
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 ;<HD>
STA ENTTRK ;<HD>
STA DTRK,X ;<HD>
LDA DELIND
STA ENTIND
STA DIND,X
LDA TYPE
STA PATTYP
LDA DRVNUM
STA FILDRV
RTS
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 ;<HD>
STA ENTTRK ;<HD>
STA DTRK,X ;<HD>
LDA DELIND
STA ENTIND
STA DIND,X
LDA TYPE
STA PATTYP
LDA DRVNUM
STA FILDRV
RTS
;
.END
.END

+ 166
- 166
DOS_8070/hdaddrel View File

@@ -7,212 +7,212 @@
;*********************************
;
ADDREL
JSR ADRELS ;DO SET UP
JSR FNDREL ;CALC SS PTRS
ADDR1 ;ENTRANCE FROM COPY
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 ;INC SS PTRS & CHECK
BNE AR10
INC SSNUM
LDA #SSIOFF
STA SSIND
JSR ADRELS ;DO SET UP
JSR FNDREL ;CALC SS PTRS
ADDR1 ;ENTRANCE FROM COPY
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 ;INC SS PTRS & CHECK
BNE AR10
INC SSNUM
LDA #SSIOFF
STA SSIND
AR10
LDA R1
CLC
ADC #2
JSR SETSSP
LDA R1
CLC
ADC #2
JSR SETSSP
;
LDA SSNUM
CMP #NSSL
BCC AR25 ;VALID RANGE
LDA SSNUM
CMP #NSSL
BCC AR25 ;VALID RANGE
;
; <BIG FILES CHANGE>
;
LDA #0 ;SET SS NUM =0
STA SSNUM ;*
INC GRPNUM ;BUMP THE GROUP #
BNE AR25 ;BRA
LDA #0 ;SET SS NUM =0
STA SSNUM ;*
INC GRPNUM ;BUMP THE GROUP #
BNE AR25 ;BRA
; <END>
;
;
AR20
LDA #BIGFIL
JSR CMDERR ;TOO MANY SS'S
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
LDA SSIND ;CALC # BLOCKS NEEDED...
SEC ;...& CHECK AGAINST AVAIL.
SBC R1
BCS AR30
SBC #SSIOFF-1
CLC
AR30
;
; <BIG FILE CHANGE>
;
STA T3 ;# SS INDICES (DATA SECTORS * 2)
LDA SSNUM ;GET DESIRED SSNUM
SBC R0 ;SUB CURRENT LAST SS
BCS AR30A ;BR IF DESIRED IS GREATER
INC R3 ;BUMP CURNT GROUP #
ADC #6 ;CALC # SS NEEDED
STA T3 ;# SS INDICES (DATA SECTORS * 2)
LDA SSNUM ;GET DESIRED SSNUM
SBC R0 ;SUB CURRENT LAST SS
BCS AR30A ;BR IF DESIRED IS GREATER
INC R3 ;BUMP CURNT GROUP #
ADC #6 ;CALC # SS NEEDED
AR30A
STA T4 ;SAVE # WHOLE SS NEEDED
LDA GRPNUM ;DESIRED GROUP #
SEC
SBC R3 ;CALC # WHOLE GROUPS NEEDED
STA R3 ;*
JSR SSCALC ;CALC TOTAL SECTORS NEEDED
LDA RESULT+1 ;CHK IF ENOUGH LEFT
BNE AR35 ;BR IF > 256 NEEDED
LDX RESULT ;CHK IF > 1 NEEDED
BNE AR30B ;BR IF SOME NEEDED
RTS ;EXIT (NONE NEEDED)
STA T4 ;SAVE # WHOLE SS NEEDED
LDA GRPNUM ;DESIRED GROUP #
SEC
SBC R3 ;CALC # WHOLE GROUPS NEEDED
STA R3 ;*
JSR SSCALC ;CALC TOTAL SECTORS NEEDED
LDA RESULT+1 ;CHK IF ENOUGH LEFT
BNE AR35 ;BR IF > 256 NEEDED
LDX RESULT ;CHK IF > 1 NEEDED
BNE AR30B ;BR IF SOME NEEDED
RTS ;EXIT (NONE NEEDED)
AR30B
DEX ;*
BNE AR35 ;BR IF > 1 NEEDED
INC R2 ;SET SINGLE BLOCK SWITCH
DEX ;*
BNE AR35 ;BR IF > 1 NEEDED
INC R2 ;SET SINGLE BLOCK SWITCH
; <END>
;
AR35
CMP NBTEMP+1
BCC AR40 ;OK!!
BNE AR20
LDA NBTEMP
CMP RESULT
BCC AR20 ;NOT ENUF BLOCKS
CMP NBTEMP+1
BCC AR40 ;OK!!
BNE AR20
LDA NBTEMP
CMP RESULT
BCC AR20 ;NOT ENUF BLOCKS
AR40
LDA #1
JSR DRDBYT ;LOOK AT ADDR OF LAST BYTE
CLC
ADC #1 ;+1 IS NR
LDX LINDX
STA NR,X
JSR GETHDR ;SET UP T&S FOR NEAR BY ALLOC
JSR NXTTS ;GET NEXT BLOCK...
JSR SETLNK ;...& SET LINK.
LDA R2
BNE AR50 ;ADD ONE BLOCK
;
JSR WRTOUT ;WRITE CURRENT LAST REC
LDA #1
JSR DRDBYT ;LOOK AT ADDR OF LAST BYTE
CLC
ADC #1 ;+1 IS NR
LDX LINDX
STA NR,X
JSR GETHDR ;SET UP T&S FOR NEAR BY ALLOC
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
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
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 (NEW DATA SECTOR)
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
JSR WRTOUT ;WRITE BUFFER (NEW DATA SECTOR)
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
LDA SECTOR ;CHK END OF CHAIN <HD>
CMP #255 ;<HD>
BEQ AR65 ;S=255: THAT'S ALL!!<HD>
PLA
JSR PUTSS ;RECORD T&S...
PLA
JSR PUTSS ;...IN SS.
PLA ;GET T&S FROM LINK
STA SECTOR
PLA
STA TRACK
LDA SECTOR ;CHK END OF CHAIN <HD>
CMP #255 ;<HD>
BEQ AR65 ;S=255: THAT'S ALL!!<HD>
;
;
; <BIG FILE CHANGE>
;
LDA R5 ;AT RIGHT GROUP YET?
CMP GRPNUM ;*
BCC AR45 ;BR IF NOT
LDA R5 ;AT RIGHT GROUP YET?
CMP GRPNUM ;*
BCC AR45 ;BR IF NOT
; <END>
;
LDA R0
CMP SSNUM
BNE AR45 ;NOT EVEN DONE YET
LDA R0
CMP SSNUM
BNE AR45 ;NOT EVEN DONE YET
;
JSR GSSPNT
CMP SSIND
BCC AR45 ;ALMOST DONE
BEQ AR50 ;ONE MORE BLOCK LEFT
JSR GSSPNT
CMP SSIND
BCC AR45 ;ALMOST DONE
BEQ AR50 ;ONE MORE BLOCK LEFT
AR65
JSR GSSPNT ;GET THE SS BUFR PTR
PHA
LDA #0
JSR SSDIR
LDY #0 ;<HD>
LDA #255 ;<HD>
STA (DIRBUF),Y ;FLAG LAST SS AS EOF
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
JSR GSSPNT ;GET THE SS BUFR PTR
PHA
LDA #0
JSR SSDIR
LDY #0 ;<HD>
LDA #255 ;<HD>
STA (DIRBUF),Y ;FLAG LAST SS AS EOF
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
LDA #LRF
JSR SETFLG
LDA #NOREC
JSR CMDERR
;
; ADD BLOCKS SET UP ROUTINE
;
ADRELS
JSR SETDRN
JSR SSEND ;SET UP END OF FILE
JSR POSBUF
JSR SETDRN
JSR SSEND ;SET UP END OF FILE
JSR POSBUF
;
; <BIG FILE CHANGE>
;
LDA GRPNUM ;SAVE LAST GROUP #
STA R5 ;*
STA R3 ;*
LDA GRPNUM ;SAVE LAST GROUP #
STA R5 ;*
STA R3 ;*
; <END>
;
LDA SSIND
STA R1 ;SAVE SS INDEX
LDA SSNUM
STA R0 ;SAVE SS NUMBER
LDA #0
STA R2 ;CLEAR FLAG FOR ONE BLOCK
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 ;CLEAR FOR 1ST BYTE
RTS ;EXIT
.END
STA RECPTR ;CLEAR FOR 1ST BYTE
RTS ;EXIT
.END

+ 204
- 204
DOS_8070/hdalloc View File

@@ -12,12 +12,12 @@
;
INTTS
NXTDS
LDA #1
LDX #0 ;BEGINNING ZONE
STA NAHEAD ;EVERY OTHER SECTOR
STX TRACK ;LAST ONE AT T&S 00
STX SECTOR ;*
BEQ HDGS1 ;JMP TO COMMON CODE
LDA #1
LDX #0 ;BEGINNING ZONE
STA NAHEAD ;EVERY OTHER SECTOR
STX TRACK ;LAST ONE AT T&S 00
STX SECTOR ;*
BEQ HDGS1 ;JMP TO COMMON CODE
;
; SECONDARY ALLOCATION
; THIS ROUTINE IS CALLED TO ALLOCATE N SECTORS
@@ -27,65 +27,65 @@ NXTDS
; A SECTOR FROM THIS THE NON-PRIME ZONES
;
NXTTS
LDX #10 ;N AHEAD = 10
STX NAHEAD ;*
LDX #1 ;BEGINNING ZONE NUMBER
LDX #10 ;N AHEAD = 10
STX NAHEAD ;*
LDX #1 ;BEGINNING ZONE NUMBER
;
; THE FOLLOWING CODE IS COMMON TO BOTH
;
HDGS1
STX HDTYP ;SAVE BEG ZONE = REQ TYPE
STX HDCZN ;SAVE AS CURRENT ZONE ALSO
LDX DRVNUM ;CHK IF VER FLAG SET
LDA HDDFLG,X ;*
AND #HDVIP ;*
BEQ HDGS6 ;BR IF
LDA #VERLK ;GIVE THE VALIDATE LOCK ERROR
JSR CMDERR ;*
STX HDTYP ;SAVE BEG ZONE = REQ TYPE
STX HDCZN ;SAVE AS CURRENT ZONE ALSO
LDX DRVNUM ;CHK IF VER FLAG SET
LDA HDDFLG,X ;*
AND #HDVIP ;*
BEQ HDGS6 ;BR IF
LDA #VERLK ;GIVE THE VALIDATE LOCK ERROR
JSR CMDERR ;*
HDGS6
;****************************************
;
; DO OPTIMUM ALLOCATION OF THE SECTOR
;
;****************************************
LDA TRACK ;CURRENT TRACK #
JSR HDGNSB ;GET # SECTORS THIS TRACK
STA HDTMPA ;SAVE
STA HDTMPB ;*
LDA SECTOR ;CURRENT SECTOR
AND #$3F ;TURN OFF HEAD BITS
CLC ;ADD THE NUMBER AHEAD
ADC NAHEAD ;*
CMP HDTMPA ;CHK FOR WRAP
BCC GS1 ;BR IF NO WRAP AROUND
SEC ;CALC # WRAPPED
SBC HDTMPA ;*
LDA TRACK ;CURRENT TRACK #
JSR HDGNSB ;GET # SECTORS THIS TRACK
STA HDTMPA ;SAVE
STA HDTMPB ;*
LDA SECTOR ;CURRENT SECTOR
AND #$3F ;TURN OFF HEAD BITS
CLC ;ADD THE NUMBER AHEAD
ADC NAHEAD ;*
CMP HDTMPA ;CHK FOR WRAP
BCC GS1 ;BR IF NO WRAP AROUND
SEC ;CALC # WRAPPED
SBC HDTMPA ;*
GS1
STA HDTMPA ;SAVE DESIRED SECTOR #
LDA SECTOR ;COPY PROPER HEAD BITS
AND #$C0 ;*
ORA HDTMPA ;*
STA SECTOR ;*
;CALC # SECTORS TO SEARCH
;BETWEEN HERE AND END OF TRACK
AND #$3F ;SECTOR # ONLY
STA HDTMPA ;*
SEC ;SUBTRACT FROM TOTAL ON TRK
LDA HDTMPB
SBC HDTMPA
STA HDTMPA ;# TO END OF TRACK
JSR SRCHET ;SEARCH TO END OF TRACK
BEQ GS2 ;BR IF NOT FOUND
STA HDTMPA ;SAVE DESIRED SECTOR #
LDA SECTOR ;COPY PROPER HEAD BITS
AND #$C0 ;*
ORA HDTMPA ;*
STA SECTOR ;*
;CALC # SECTORS TO SEARCH
;BETWEEN HERE AND END OF TRACK
AND #$3F ;SECTOR # ONLY
STA HDTMPA ;*
SEC ;SUBTRACT FROM TOTAL ON TRK
LDA HDTMPB
SBC HDTMPA
STA HDTMPA ;# TO END OF TRACK
JSR SRCHET ;SEARCH TO END OF TRACK
BEQ GS2 ;BR IF NOT FOUND
GSGOT
RTS ;EXIT (NZ=GOT ONE)
RTS ;EXIT (NZ=GOT ONE)
GS2
LDA HDTMPB ;SEARCH WHOLE TRK
STA HDTMPA ;*
LDA SECTOR ;*
AND #$C0 ;BEG AT SECTOR 00
STA SECTOR ;*
JSR SRCHET ;LOOK FOR ONE
BNE GSGOT ;BR IF FOUND ONE
LDA HDTMPB ;SEARCH WHOLE TRK
STA HDTMPA ;*
LDA SECTOR ;*
AND #$C0 ;BEG AT SECTOR 00
STA SECTOR ;*
JSR SRCHET ;LOOK FOR ONE
BNE GSGOT ;BR IF FOUND ONE
;
; COULD NOT FIND A SECTOR SO
; GO BACK TO BEGINNING OF PROPER
@@ -96,47 +96,47 @@ GS2
; IF DESIRED ZONE HAS AVAILABLE SECTORS
;
HDGS2
LDX HDCZN ;GET DESIRED ZONE #
JSR HDCIND ;CALC INDEX VALUE
LDA HDZFUL,X ;LOOK AT FULL SW.
BEQ HDGS4 ;JMP IF NOT FULL
LDX HDCZN ;GET DESIRED ZONE #
JSR HDCIND ;CALC INDEX VALUE
LDA HDZFUL,X ;LOOK AT FULL SW.
BEQ HDGS4 ;JMP IF NOT FULL
HDGS3
INC HDCZN ;BUMP TO NEXT ZONE
LDX DRVNUM ;GET MAX ON THAT DRIVE
LDA HDCZN ;CHK IF AT END OF MEDIA
CMP HDNZA,X ;*
BCC HDGS2 ;IF NOT GO CHK THAT ZONE
INC HDCZN ;BUMP TO NEXT ZONE
LDX DRVNUM ;GET MAX ON THAT DRIVE
LDA HDCZN ;CHK IF AT END OF MEDIA
CMP HDNZA,X ;*
BCC HDGS2 ;IF NOT GO CHK THAT ZONE
;
; ZONES 1-N ARE FULL
; TRY ZONE 0 UNLESS WE STARTED THERE
;
DEC HDTYP ;CHK REQUEST TYPE
LDA HDTYP ;SET PROPER ZONE
STA HDCZN ;*
BEQ HDGS2 ;GO GET FROM ZONE
DEC HDTYP ;CHK REQUEST TYPE
LDA HDTYP ;SET PROPER ZONE
STA HDCZN ;*
BEQ HDGS2 ;GO GET FROM ZONE
;
; GIVE DISK FULL ERROR
;
LDA #DSKFUL ;ERROR MSG
JMP CMDERR ;EXIT
LDA #DSKFUL ;ERROR MSG
JMP CMDERR ;EXIT
;
; ALLOCATE A SECTOR FROM THE ZONE
; THE TABLE INDEX IS IN REG X
;
HDGS4
JSR HDGTS ;GET A SECTOR
BEQ HDGS5 ;JMP IF NONE ARE AVAIL
STA SECTOR ;SAVE SECTOR #
STY TRACK ;SAVE TRACK #
RTS ;EXIT TO CALLER
JSR HDGTS ;GET A SECTOR
BEQ HDGS5 ;JMP IF NONE ARE AVAIL
STA SECTOR ;SAVE SECTOR #
STY TRACK ;SAVE TRACK #
RTS ;EXIT TO CALLER
;
; ZONE IS FULLY ALLOCATED MARK IT & MOVE TO NEXT
;
HDGS5
LDA #1 ;NZ IS FULL
STA HDZFUL,X ;*
BNE HDGS3 ;JMP
.PAG 'GET A SECTOR'
LDA #1 ;NZ IS FULL
STA HDZFUL,X ;*
BNE HDGS3 ;JMP
.PAG 'GET A SECTOR'
; GET A SECTOR FROM THE CALC ZONE INDEX
;
; ON EXIT:
@@ -150,18 +150,18 @@ HDGS5
; HDCZN=UNCALCULATED ZONE #
;
HDGTS
JSR HDISU ;SET UP INDIRECT WORD
JSR HDLBM ;LOAD THE DESIGNATED BAM
LDY #HDBIT1 ;PT TO FIRST BIT
JSR HDISU ;SET UP INDIRECT WORD
JSR HDLBM ;LOAD THE DESIGNATED BAM
LDY #HDBIT1 ;PT TO FIRST BIT
HDGTS1
LDA (HDBMP),Y ;LOOK AT NEXT GROUP OF SECTS.
BNE HDGTS2 ;JMP IF ANY AVAILABLE
INY ;BUMP TO NEXT GROUP
BNE HDGTS1 ;LOOP TILL WHOLE BAM CHKD
LDA (HDBMP),Y ;LOOK AT NEXT GROUP OF SECTS.
BNE HDGTS2 ;JMP IF ANY AVAILABLE
INY ;BUMP TO NEXT GROUP
BNE HDGTS1 ;LOOP TILL WHOLE BAM CHKD
;
; NONE AVAILABLE IN THIS BAM
;
RTS ;EXIT (Z IS SET)
RTS ;EXIT (Z IS SET)
;
; FOUND SOME AVAILABLE
; SO CALCULATE THE TRACK & SECTOR ADDR OF ONE OF THEM
@@ -170,52 +170,52 @@ HDGTS1
;FIRST CALC THE BIT NUMBER
;
HDGTS2
LDX #0 ;BIT 0 = LEFTMOST BIT
LDX #0 ;BIT 0 = LEFTMOST BIT
HDGTS4
ASL A ;LOOK AT LEFTMOST
BCS HDGTS3 ;BR IF BIT IS SET
INX ;BUMP THE BIT NUMBER
BNE HDGTS4 ;JMP
ASL A ;LOOK AT LEFTMOST
BCS HDGTS3 ;BR IF BIT IS SET
INX ;BUMP THE BIT NUMBER
BNE HDGTS4 ;JMP
HDGTS3
STX HDTMP1 ;SAVE THE BIT NUMBER
STX HDTMP1 ;SAVE THE BIT NUMBER
;
; TURN THE BIT OFF TO INDICATE
; THAT THE SECTOR HAS BEEN ALLOCATED
;
HDGT4
LSR A ;MOVE A ZERO BACK
DEX ;KEEP SHIFTING ZEROES BACK IN
BPL HDGT4 ;LOOP TILL DONE
LSR A ;MOVE A ZERO BACK
DEX ;KEEP SHIFTING ZEROES BACK IN
BPL HDGT4 ;LOOP TILL DONE
;
; PUT BYTE BACK INTO BAM
;
STA (HDBMP),Y ;*
STA (HDBMP),Y ;*
;
; CALCULATE THE BYTE NUMBER
;
TYA ;BAM INDEX
SEC ;PREP FOR SBC
SBC #HDBIT1 ;INDEX TO FIRST BYTE
STA HDTMP2 ;SAVE # BYTES
TYA ;BAM INDEX
SEC ;PREP FOR SBC
SBC #HDBIT1 ;INDEX TO FIRST BYTE
STA HDTMP2 ;SAVE # BYTES
;
; MULTIPLY NUMBER OF BYTES BY 8
;
LDA #0 ;CLEAR HIGH BYTE
STA HDTMP3 ;*
ASL HDTMP2 ;SHIFT LEFT 3
ROL HDTMP3 ;*
ASL HDTMP2 ;*
ROL HDTMP3 ;*