Browse Source

reindented DOS_D9065 to approximate the LST output of the assembler

master
Michael Steil 2 years ago
parent
commit
bbac8207d7
69 changed files with 7701 additions and 7701 deletions
  1. 111
    111
      DOS_D9065/addfil
  2. 158
    158
      DOS_D9065/addrel
  3. 58
    58
      DOS_D9065/allromcheck
  4. 33
    33
      DOS_D9065/autoit
  5. 133
    133
      DOS_D9065/begin
  6. 318
    318
      DOS_D9065/block
  7. 42
    42
      DOS_D9065/chksum
  8. 176
    176
      DOS_D9065/close
  9. 108
    108
      DOS_D9065/comprs
  10. 86
    86
      DOS_D9065/copyall
  11. 56
    56
      DOS_D9065/copysetup
  12. 145
    145
      DOS_D9065/dskint
  13. 155
    155
      DOS_D9065/duplct
  14. 2
    2
      DOS_D9065/echksm
  15. 48
    48
      DOS_D9065/equate
  16. 3
    3
      DOS_D9065/erom
  17. 292
    292
      DOS_D9065/erproc
  18. 3
    3
      DOS_D9065/fmt40
  19. 98
    98
      DOS_D9065/fndrel
  20. 212
    212
      DOS_D9065/frets
  21. 20
    20
      DOS_D9065/getact
  22. 38
    38
      DOS_D9065/i_odef
  23. 66
    66
      DOS_D9065/idle
  24. 184
    184
      DOS_D9065/ieee
  25. 194
    194
      DOS_D9065/init
  26. 103
    103
      DOS_D9065/jobs
  27. 313
    313
      DOS_D9065/lookup
  28. 104
    104
      DOS_D9065/lstdir
  29. 200
    200
      DOS_D9065/map
  30. 60
    60
      DOS_D9065/master
  31. 59
    59
      DOS_D9065/master.old
  32. 45
    45
      DOS_D9065/memrw
  33. 57
    57
      DOS_D9065/mver
  34. 231
    231
      DOS_D9065/new
  35. 127
    127
      DOS_D9065/newss
  36. 35
    35
      DOS_D9065/nulbuf
  37. 177
    177
      DOS_D9065/opchnl
  38. 345
    345
      DOS_D9065/open
  39. 177
    177
      DOS_D9065/opx
  40. 202
    202
      DOS_D9065/parsex
  41. 2
    2
      DOS_D9065/patc
  42. 61
    61
      DOS_D9065/patchlst
  43. 176
    176
      DOS_D9065/ramvar
  44. 104
    104
      DOS_D9065/record
  45. 82
    82
      DOS_D9065/rel1
  46. 77
    77
      DOS_D9065/rel2
  47. 36
    36
      DOS_D9065/rel3
  48. 45
    45
      DOS_D9065/rel4
  49. 182
    182
      DOS_D9065/rename
  50. 3
    3
      DOS_D9065/rom
  51. 75
    75
      DOS_D9065/romtbl
  52. 67
    67
      DOS_D9065/scrtch
  53. 98
    98
      DOS_D9065/setdrv
  54. 33
    33
      DOS_D9065/ssend
  55. 28
    28
      DOS_D9065/sstest
  56. 116
    116
      DOS_D9065/ssutil
  57. 91
    91
      DOS_D9065/system
  58. 97
    97
      DOS_D9065/temp
  59. 220
    220
      DOS_D9065/trnsfr
  60. 321
    321
      DOS_D9065/tst2
  61. 166
    166
      DOS_D9065/tst3
  62. 172
    172
      DOS_D9065/tst4
  63. 51
    51
      DOS_D9065/tstflg
  64. 142
    142
      DOS_D9065/tstfnd
  65. 88
    88
      DOS_D9065/tsutil
  66. 105
    105
      DOS_D9065/utlodr
  67. 15
    15
      DOS_D9065/vector
  68. 73
    73
      DOS_D9065/verdir
  69. 1
    1
      README.md

+ 111
- 111
DOS_D9065/addfil View File

@@ -1,124 +1,124 @@
.PAGE 'ADDFIL'
.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
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
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
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
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
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
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 &...
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
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
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

+ 158
- 158
DOS_D9065/addrel View File

@@ -1,179 +1,179 @@
.PAGE 'ADDREL'
.PAGE 'ADDREL'
ADDREL
JSR ADRELS
JSR FNDREL ; CALC SS PTRS
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
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
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
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
STA T3
LDA SSNUM
SBC R0
BCS ADDBI1
INC R3
ADC #6
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
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
DEX
BNE AR35
AR34
INC R2
INC R2
AR35
CMP NBTEMP+1
BCC AR40 ; OK!!
BNE AR20
LDA NBTEMP
CMP T1
BCC AR20 ; NOT ENOUGH BLOCKS
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
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
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
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
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
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
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
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
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
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
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

+ 58
- 58
DOS_D9065/allromcheck View File

@@ -1,65 +1,65 @@
IP=0 ;ZPAGE POINTER
*=$F800
START SEI
LDY #0
LDA #$20
*=$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
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
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
LDY #0
W2
LDX #0
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
DEX
BNE W3
DEY
BNE W2
RTS
HEX .BYTE '0123456789'
.BYTE 1,2,3,4,5,6 ;SCREEN ALPHA
*=$FFFC
.WORD START
.END

+ 33
- 33
DOS_D9065/autoit View File

@@ -1,4 +1,4 @@
.PAGE 'AUTOIT'
.PAGE 'AUTOIT'
;RSR TEST SUBROUTINES
;
; THIS AUTO INIT SUBROUTINE WILL
@@ -11,38 +11,38 @@
; 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
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
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

+ 133
- 133
DOS_D9065/begin View File

@@ -1,161 +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
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
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
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
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
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
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
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
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
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
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
LDA #CBMVER ; DOS VERSION NUMBER
JSR ERRTS0 ; TRANSFER MESSAGE
;
; ALLOW 'ATN' TO INTERRUPT
;
STA ATNPE
JMP BOOT ; CHECK POWER UP BOOT
STA ATNPE
JMP BOOT ; CHECK POWER UP BOOT
;
; MUST BE CONTIGUOUS TO IDLE ROUTINE
;
.END
.END

+ 318
- 318
DOS_D9065/block View File

@@ -1,426 +1,426 @@
.PAGE 'BLOCK COMMAND'
.PAGE 'BLOCK COMMAND'
;
; USER COMMANDS
;
USER
LDY CMDBUF+1
CPY #'0
BNE US10 ; 0 RESETS PNTR
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
LDA #<UBLOCK ; SET DEFAULT BLOCK ADD
STA USRJMP
LDA #>UBLOCK
STA USRJMP+1
RTS
US10
JSR USREXC ; EXECUTE CODE BY TABLE
JMP ENDCMD
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'
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
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
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
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
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
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
LDY #0
LDX #0
LDA #'- ; '-' SEPARATES CMD FROM SUBCMD
JSR PARSE ; LOCATE SUB-CMD
BNE BLK40
BLK10
LDA #BADCMD
JMP CMDERR
LDA #BADCMD
JMP CMDERR
BLK30
LDA #BADSYN
JMP CMDERR
LDA #BADSYN
JMP CMDERR
BLK40
TXA
BNE BLK30
LDX #NBCMDS-1 ; FIND COMMAND
LDA CMDBUF,Y
TXA
BNE BLK30
LDX #NBCMDS-1 ; FIND COMMAND
LDA CMDBUF,Y
BLK50
CMP BCTAB,X
BEQ BLK60
DEX
BPL BLK50
BMI BLK10
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
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
.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
.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
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
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
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
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
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
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
STY F2PTR ; CONVERT DIGITS TO...
CLC ; ...BINARY BY DEC TABLE
LDA #0
AH30
INX
CPX #3
BCS AH40
LDY TEMP,X
INX
CPX #3
BCS AH40
LDY TEMP,X
AH35
DEY
BMI AH30
ADC DECTAB,X
BCC AH35
CLC
INC TEMP+3
BNE 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
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
.BYTE 1,10,100 ; DECIMAL TABLE
;
; BLOCK-FREE
;
BLKFRE
JSR BLKTST
JSR FRETS
JMP ENDCMD
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
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
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
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
JSR GETSEC
BEQ BA20
BA30
JSR ADDHED ; ADD THE HEAD TO THE SECTOR
LDA #NOBLK
JSR CMDER2
JSR ADDHED ; ADD THE HEAD TO THE SECTOR
LDA #NOBLK
JSR CMDER2
BA40
LDA #NOBLK
JSR CMDERR ; T = 0, S = 0, NONE LEFT
LDA #NOBLK
JSR CMDERR ; T = 0, S = 0, NONE LEFT
;
; BLOCK READ SUBS
;
BLKRD2
JSR BKOTST ; TEST PARMS
JMP DRTRD
JSR BKOTST ; TEST PARMS
JMP DRTRD
GETSIM
JSR GETPRE ; GET BYTE W/O INC
LDA (BUFTAB,X)
RTS
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
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
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)
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
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
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
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
JSR BLKPAR
JSR BKOTST
JSR DRTWRT
JMP ENDCMD
;
; BLOCK-EXECUTE
;
BLKEXC
JSR BLKRD2 ; READ BLOCK & EXECUTE
LDA #0
JSR BLKRD2 ; READ BLOCK & EXECUTE
LDA #0
BE05
STA TEMP
LDX JOBNUM
LDA BUFIND,X
STA TEMP+1
JSR BE10 ; INDIRECT JSR
JMP ENDCMD
STA TEMP
LDX JOBNUM
LDA BUFIND,X
STA TEMP+1
JSR BE10 ; INDIRECT JSR
JMP ENDCMD
BE10
JMP (TEMP)
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
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
LDX F1PTR
INC F1PTR
LDA FILSEC,X
TAY
DEY
DEY
CPY #BAMJOB
BCC BT20
BT15
LDA #NOCHNL
JMP CMDERR
LDA #NOCHNL
JMP CMDERR
BT20
STA SA
JSR FNDRCH
BCS BT15
JSR GETACT
STA JOBNUM
RTS
STA SA
JSR FNDRCH
BCS BT15
JSR GETACT
STA JOBNUM
RTS
;
; TEST BLOCK OPERATION PARMS
;
BKOTST
JSR BUFTST
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
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)
JSR TSCHK
JMP SETLDS ; (RTS)
.END

+ 42
- 42
DOS_D9065/chksum View File

@@ -1,45 +1,45 @@
.PAGE 'CHECKSUM'
*=$005E
TEMP *=*+2
*=$0500
CLD
SEI
LDA #0
STA $1000
CMP $1000
.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
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
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
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

+ 176
- 176
DOS_D9065/close View File

@@ -1,209 +1,209 @@
.PAGE 'CLOSE'
.PAGE 'CLOSE'
;
; CLOSE THE FILE ASSOCIATED WITH SA
;
CLOSE
LDA SA
BNE CLS10 ; DIRECTORY CLOSE
LDA #0
STA DIRLST ; CLEAR DIR LIST
JSR FRECHN
LDA SA
BNE CLS10 ; DIRECTORY CLOSE
LDA #0
STA DIRLST ; CLEAR DIR LIST
JSR FRECHN
CLS05
JMP FREICH
JMP FREICH
CLS10
CMP #$F
BEQ CLSALL ; CLOSE CMD CHANL
JSR CLSCHN ; CLOSE CHANNEL
LDA SA
CMP #2
BCC CLS05
JMP ENDCMD
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
LDA #14
STA SA
CLS20
JSR CLSCHN
DEC SA
BPL CLS20
JMP ENDCMD
JSR CLSCHN
DEC SA
BPL CLS20
JMP ENDCMD
;
; CLOSE SECONDARY ADDRESS (SA)
;
CLSCHN
LDX SA
LDA LINTAB,X
CMP #$FF
BNE CLSC28
RTS
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
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
JSR MAPOUT ; WRITE BAM OUT
CLSC31
JMP FRECHN
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
JSR SCRUB
JSR DBLBUF
JSR SSEND
LDX SSNUM
STX T4
LDA SSIND
SEC