Browse Source

reindented DOS_8250 to approximate the LST output of the assembler

master
Michael Steil 2 years ago
parent
commit
b2402c45ac
64 changed files with 7431 additions and 7431 deletions
  1. +102
    -102
      DOS_8250/addfil
  2. +183
    -183
      DOS_8250/addrel
  3. +58
    -58
      DOS_8250/allromcheck
  4. +33
    -33
      DOS_8250/autoit
  5. +170
    -170
      DOS_8250/begin
  6. +311
    -311
      DOS_8250/block
  7. +43
    -43
      DOS_8250/chksum
  8. +193
    -193
      DOS_8250/close
  9. +85
    -85
      DOS_8250/copyall
  10. +56
    -56
      DOS_8250/copysetup
  11. +158
    -158
      DOS_8250/dskint
  12. +122
    -122
      DOS_8250/duplct
  13. +2
    -2
      DOS_8250/echksm
  14. +48
    -48
      DOS_8250/equate
  15. +3
    -3
      DOS_8250/erom
  16. +288
    -288
      DOS_8250/erproc
  17. +3
    -3
      DOS_8250/fmt40
  18. +108
    -108
      DOS_8250/fndrel
  19. +185
    -185
      DOS_8250/frets
  20. +21
    -21
      DOS_8250/getact
  21. +38
    -38
      DOS_8250/i_odef
  22. +66
    -66
      DOS_8250/idle
  23. +190
    -190
      DOS_8250/ieee
  24. +194
    -194
      DOS_8250/init
  25. +235
    -235
      DOS_8250/jobs
  26. +339
    -339
      DOS_8250/lookup
  27. +104
    -104
      DOS_8250/lstdir
  28. +127
    -127
      DOS_8250/map
  29. +59
    -59
      DOS_8250/master
  30. +46
    -46
      DOS_8250/memrw
  31. +57
    -57
      DOS_8250/mver
  32. +107
    -107
      DOS_8250/new
  33. +133
    -133
      DOS_8250/newss
  34. +35
    -35
      DOS_8250/nulbuf
  35. +193
    -193
      DOS_8250/opchnl
  36. +364
    -364
      DOS_8250/open
  37. +200
    -200
      DOS_8250/parsex
  38. +172
    -172
      DOS_8250/ramvar.sd
  39. +104
    -104
      DOS_8250/record
  40. +82
    -82
      DOS_8250/rel1
  41. +77
    -77
      DOS_8250/rel2
  42. +36
    -36
      DOS_8250/rel3
  43. +45
    -45
      DOS_8250/rel4
  44. +181
    -181
      DOS_8250/rename
  45. +7
    -7
      DOS_8250/rom
  46. +106
    -106
      DOS_8250/romtbl
  47. +67
    -67
      DOS_8250/scrtch
  48. +98
    -98
      DOS_8250/setdrv
  49. +35
    -35
      DOS_8250/ssend
  50. +30
    -30
      DOS_8250/sstest
  51. +130
    -130
      DOS_8250/ssutil
  52. +97
    -97
      DOS_8250/system.sd
  53. +97
    -97
      DOS_8250/temp
  54. +228
    -228
      DOS_8250/trnsfr
  55. +285
    -285
      DOS_8250/tst2
  56. +166
    -166
      DOS_8250/tst3
  57. +170
    -170
      DOS_8250/tst4
  58. +49
    -49
      DOS_8250/tstflg
  59. +159
    -159
      DOS_8250/tstfnd
  60. +88
    -88
      DOS_8250/tsutil
  61. +106
    -106
      DOS_8250/utlodr
  62. +15
    -15
      DOS_8250/vector
  63. +141
    -141
      DOS_8250/verdir
  64. +1
    -1
      README.md

+ 102
- 102
DOS_8250/addfil View File

@@ -1,105 +1,105 @@
.PAGE 'ADDFIL'
.PAGE 'ADDFIL'
; 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
BEQ AF10 ;DELETED ENTRY NOT LOCATED
CMP SECTOR
BEQ AF20 ;SECTOR IS RESIDENT
STA SECTOR
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 #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
BEQ AF10 ;DELETED ENTRY NOT LOCATED
CMP SECTOR
BEQ AF20 ;SECTOR IS RESIDENT
STA SECTOR
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 #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 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 DELIND
STA ENTIND
STA DIND,X
LDA TYPE
STA PATTYP
LDA DRVNUM
STA FILDRV
RTS
;
.END
.END

+ 183
- 183
DOS_8250/addrel View File

@@ -1,208 +1,208 @@
.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
JSR BIGREL ; BIG RELATIVE FILE?
BNE AR20 ; NO
STA SSNUM ; .A = 0
INC GRPNUM
BNE AR25 ; JUMP
LDA R1
CLC
ADC #2
JSR SETSSP
LDA SSNUM
CMP #NSSL
BCC AR25 ; VALID RANGE
JSR BIGREL ; BIG RELATIVE FILE?
BNE AR20 ; NO
STA SSNUM ; .A = 0
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
PHA ; SAVE .A
JSR BIGREL ; BIG RELATIVE FILE?
BEQ ADDBIG ; YES
PLA ; NO, RESTORE .A
STA T3 ; # SS INDICES
LDA SSNUM
SBC R0
STA T4 ; # SS NEEDED
LDX #0 ; CLEAR ACCUM.
STX T1
STX T2
TAX ; .X = #SS
JSR SSCALC ; CALC # OF BLOCKS NEEDED
LDA T2
BNE AR35
LDX T1
DEX
BNE AR35
BEQ AR34 ; JUMP
PHA ; SAVE .A
JSR BIGREL ; BIG RELATIVE FILE?
BEQ ADDBIG ; YES
PLA ; NO, RESTORE .A
STA T3 ; # SS INDICES
LDA SSNUM
SBC R0
STA T4 ; # SS NEEDED
LDX #0 ; CLEAR ACCUM.
STX T1
STX T2
TAX ; .X = #SS
JSR SSCALC ; CALC # OF BLOCKS NEEDED
LDA T2
BNE AR35
LDX T1
DEX
BNE AR35
BEQ AR34 ; JUMP
;
; ADD FOR BIG REL (8250)
;
ADDBIG
PLA ; GET .A
STA T3
LDA SSNUM
SBC R0
BCS ADDBI1
INC R3
ADC #6
PLA ; GET .A
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!!
JSR BIGREL ; BIG RELATIVE FILE?
BNE AR61 ; NO
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!!
JSR BIGREL ; BIG RELATIVE FILE?
BNE AR61 ; NO
LDA R5
CMP GRPNUM
BCC AR45
AR61
LDA R0
CMP SSNUM
BNE AR45 ; NOT DONE YET
JSR GSSPNT
CMP SSIND
BCC AR45 ; ALMOST DONE
BEQ AR50 ; ONE MORE BLOCK LEFT
LDA R0
CMP SSNUM
BNE AR45 ; NOT DONE YET
JSR GSSPNT
CMP SSIND
BCC AR45 ; ALMOST DONE
BEQ 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
JSR BIGREL ; BIG RELATIVE FILE?
BNE ADREL1 ; NO
LDA GRPNUM
STA R5
STA R3
JSR SETDRN
JSR SSEND ; SET UP END OF FILE
JSR POSBUF
JSR BIGREL ; BIG RELATIVE FILE?
BNE ADREL1 ; NO
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_8250/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_8250/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

+ 170
- 170
DOS_8250/begin View File

@@ -1,227 +1,227 @@
.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
DSKIN1 STA LINTAB,X
DEX
BPL DSKIN1
LDX #MXCHNS-1
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 #$F0
STA BUFUSE+1
JSR USRINT ; INITIALIZE USER JUMP TABLE
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 #$F0
STA BUFUSE+1
JSR USRINT ; INITIALIZE USER JUMP TABLE
;
; SET INDIRECT VECTORS
;
LDA #<DIAGOK
STA VNMI
LDA #>DIAGOK
STA VNMI+1
LDA #5 ; SET UP SECTOR ALLOCATE
STA SECINC
LDA #5
STA REVCNT ; SET UP RECOVERY COUNT
LDA #<DIAGOK
STA VNMI
LDA #>DIAGOK
STA VNMI+1
LDA #5 ; SET UP SECTOR ALLOCATE
STA SECINC
LDA #5
STA REVCNT ; SET UP RECOVERY COUNT
;
; CONFIGURE THE TABLES ACCORDING TO DOS
;
CONFIG
LDX DOS
LDA BMSIZE,X
STA BAMSIZ ; SET BAM SIZE
LDA MPOFF,X
STA MAPOFF ; SET MAP OFFSET
LDA LOWTRK,X
STA LOTRK ; SET LOW TRACK IN BAM
LDA DISKNM,X
STA DSKNAM ; DISK NAME OFFSET
LDA DOS
BEQ CONFI6 ; 4040 DOS
LDX DOS
LDA BMSIZE,X
STA BAMSIZ ; SET BAM SIZE
LDA MPOFF,X
STA MAPOFF ; SET MAP OFFSET
LDA LOWTRK,X
STA LOTRK ; SET LOW TRACK IN BAM
LDA DISKNM,X
STA DSKNAM ; DISK NAME OFFSET
LDA DOS
BEQ CONFI6 ; 4040 DOS
;
; 8050/8250 DOS
;
LDA #39
STA DIRTRK ; DIRECTORY TRACK
LDA #'C
STA VERNUM ; 8050/8250 VERSION
LDX #4
LDA NSIDES ; # OF SIDES ON DISK
LSR A
BNE CONFI1 ; DOUBLE SIDED 8250
DEX ; SINGLE SIDED 8050
DEX ; .X = 2
BNE CONFI2 ; JUMP AROUND DOUBLE SIDED STUFF
LDA #39
STA DIRTRK ; DIRECTORY TRACK
LDA #'C
STA VERNUM ; 8050/8250 VERSION
LDX #4
LDA NSIDES ; # OF SIDES ON DISK
LSR A
BNE CONFI1 ; DOUBLE SIDED 8250
DEX ; SINGLE SIDED 8050
DEX ; .X = 2
BNE CONFI2 ; JUMP AROUND DOUBLE SIDED STUFF
.PAGE
;
; 8250, DOUBLE SIDED
;
CONFI1
LDA BMT80D,X
STA BAMTRK,X ; BAM TRACK TABLE
LDA BMS80D,X
STA BAMSEC,X ; BAM SECTOR TABLE
DEX
BPL CONFI1
INX ; .X = 0
STX SWITCH ; 8250, BIG RELATIVE FILE
LDA #155
STA MAXTRK ; MAX TRACK+1 ON DISK
LDA #77
STA MTRACK ; # OF TRACKS PER SIDE
BNE CONFI3 ; JUMP AROUND SINGLE SIDED STUFF
LDA BMT80D,X
STA BAMTRK,X ; BAM TRACK TABLE
LDA BMS80D,X
STA BAMSEC,X ; BAM SECTOR TABLE
DEX
BPL CONFI1
INX ; .X = 0
STX SWITCH ; 8250, BIG RELATIVE FILE
LDA #155
STA MAXTRK ; MAX TRACK+1 ON DISK
LDA #77
STA MTRACK ; # OF TRACKS PER SIDE
BNE CONFI3 ; JUMP AROUND SINGLE SIDED STUFF
;
; 8050, SINGLE SIDED
;
CONFI2
LDA BMT80S,X
STA BAMTRK,X ; BAM TRACK TABLE
LDA BMS80S,X
STA BAMSEC,X ; BAM SECTOR TABLE
DEX
BPL CONFI2
STX SWITCH ; 8050, NO BIG RELATIVE FILE
LDA #78
STA MAXTRK ; MAX TRACK+1 ON DISK
LDX #0
STX MTRACK ; 0 FOR SINGLE SIDED
LDA BMT80S,X
STA BAMTRK,X ; BAM TRACK TABLE
LDA BMS80S,X
STA BAMSEC,X ; BAM SECTOR TABLE
DEX
BPL CONFI2
STX SWITCH ; 8050, NO BIG RELATIVE FILE
LDA #78
STA MAXTRK ; MAX TRACK+1 ON DISK
LDX #0
STX MTRACK ; 0 FOR SINGLE SIDED
;
; 8050/8250 COMMON STUFF
;
CONFI3
LDX #6
LDA NSEC80,X
STA TLGAP ; MAX TAIL GAP
DEX
LDX #6
LDA NSEC80,X
STA TLGAP ; MAX TAIL GAP
DEX
CONFI4
LDA NSEC80,X
STA NUMSEC,X ; # OF SECTORS/ZONE AND GAPS
DEX
BPL CONFI4
LDX #7
LDA NSEC80,X
STA NUMSEC,X ; # OF SECTORS/ZONE AND GAPS
DEX
BPL CONFI4
LDX #7
CONFI5
LDA NTRK80,X
STA TRKNUM,X ; TRACK ZONE BOUNDARIES
DEX
BPL CONFI5
BMI CONFI9 ; JUMP AROUND 4040 STUFF
LDA NTRK80,X
STA TRKNUM,X ; TRACK ZONE BOUNDARIES
DEX
BPL CONFI5
BMI CONFI9 ; JUMP AROUND 4040 STUFF
;
; 4040 DOS
;
CONFI6
LDA #1
STA NSIDES ; SINGLE SIDED ONLY FOR 4040
LDA #18
STA DIRTRK ; DIRECTORY TRACK
STA BAMTRK ; BAM TRACK FOR 4040
LDA #'A
STA VERNUM ; 4040 VERSION
LDA #36
STA MAXTRK ; MAX TRACK+1 ON DISK
LDA #0
STA MTRACK ; 0 FOR SINGLE SIDED
STA BAMSEC ; BAM SECTOR FOR 4040
LDX #6
LDA NSEC40,X
STA TLGAP ; MAX TAIL GAP
DEX
LDA #1
STA NSIDES ; SINGLE SIDED ONLY FOR 4040
LDA #18
STA DIRTRK ; DIRECTORY TRACK
STA BAMTRK ; BAM TRACK FOR 4040
LDA #'A
STA VERNUM ; 4040 VERSION
LDA #36
STA MAXTRK ; MAX TRACK+1 ON DISK
LDA #0
STA MTRACK ; 0 FOR SINGLE SIDED
STA BAMSEC ; BAM SECTOR FOR 4040
LDX #6
LDA NSEC40,X
STA TLGAP ; MAX TAIL GAP
DEX
CONFI7
LDA NSEC40,X
STA NUMSEC,X ; # OF SECTORS/ZONE AND GAPS
DEX
BPL CONFI7
LDX #3
LDA NSEC40,X
STA NUMSEC,X ; # OF SECTORS/ZONE AND GAPS
DEX
BPL CONFI7
LDX #3
CONFI8
LDA NTRK40,X
STA TRKNUM,X ; TRACK ZONE BOUNDARIES
DEX
BPL CONFI8
LDA NTRK40,X
STA TRKNUM,X ; TRACK ZONE BOUNDARIES
DEX
BPL CONFI8
;
; COMMON DOS VARIABLES
;
CONFI9
LDX #7
LDX #7
CONF10
LDA MSCCOM,X
STA NZONES,X ; COMMON DOS VARIABLES
DEX
BPL CONF10
LDA MSCCOM,X
STA NZONES,X ; COMMON DOS VARIABLES
DEX
BPL CONF10
;
; SET VECTOR TO IDLE LOOP
;
LDA #<VIDLE
STA VECIDL
LDA #>VIDLE
STA VECIDL+1
LDA #<VIDLE
STA VECIDL
LDA #>VIDLE
STA VECIDL+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

+ 311
- 311
DOS_8250/block View File

@@ -1,419 +1,419 @@
.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 BLKTST
BA10
LDA SECTOR
PHA
JSR GETSEC
BEQ BA15 ; NONE GREATER ON THIS TRACK
PLA
CMP SECTOR
BNE BA30 ; REQUESTED SECTOR NOT AVAIL
JSR USEDTS
JMP ENDCMD
LDA SECTOR
PHA
JSR GETSEC
BEQ BA15 ; NONE GREATER ON THIS TRACK
PLA
CMP SECTOR
BNE BA30 ; REQUESTED SECTOR NOT AVAIL
JSR USEDTS
JMP ENDCMD
BA15
PLA ; POP STACK
PLA ; POP STACK
BA20
LDA #0
STA SECTOR
INC TRACK
LDA TRACK
CMP MAXTRK
BCS BA40 ; GONE ALL THE WAY
JSR GETSEC
BEQ BA20
LDA #0
STA SECTOR
INC TRACK
LDA TRACK
CMP MAXTRK
BCS BA40 ; GONE ALL THE WAY
JSR GETSEC
BEQ BA20
BA30
LDA #NOBLK
JSR CMDER2
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 KILLP ; KILL PROTECT
JSR BLKRD2 ; READ BLOCK & EXECUTE
LDA #0
JSR KILLP ; KILL PROTECT
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

+ 43
- 43
DOS_8250/chksum View File

@@ -1,48 +1,48 @@
.PAGE 'CHKSUM
*= $BF00
LDX #$FF
TXS
CLD
SEI
LDA #0
STA $1421
CMP $1421
.PAGE 'CHKSUM
*= $BF00
LDX #$FF
TXS
CLD
SEI
LDA #0
STA $1421
CMP $1421
CHKPRO
BNE CHKPRO
LDA #$10
JSR CHKSUM
STA $1421
BRK
LDA #0
STA $3000
CMP $3000
BNE CHKPRO
LDA #$30
JSR CHKSUM
STA $3000
BRK
BNE CHKPRO
LDA #$10
JSR CHKSUM
STA $1421
BRK
LDA #0
STA $3000
CMP $3000
BNE CHKPRO
LDA #$30
JSR CHKSUM
STA $3000
BRK
;
CHKSUM ;.A=ADDRESS
CLC
STA TEMP+1
LDA #0
STA TEMP
LDX #32
LDY #0
CHKSUM ;.A=ADDRESS
CLC
STA TEMP+1
LDA #0
STA TEMP
LDX #32
LDY #0
CHK1
ADC (TEMP)Y
INY
BNE CHK1
ADC (TEMP)Y
INY
BNE CHK1
;
INC TEMP+1
DEX
BNE CHK1
INC TEMP+1
DEX
BNE CHK1
;
ADC #0
STA TEMP+1
LDA #$C0
SEC
SBC TEMP+1
SBC #0 ;.A=CHECKSUM BYTE
RTS
.END
ADC #0
STA TEMP+1
LDA #$C0
SEC
SBC TEMP+1
SBC #0 ;.A=CHECKSUM BYTE
RTS
.END

+ 193
- 193
DOS_8250/close View File

@@ -1,227 +1,227 @@
.PAGE 'CLOSE'
.PAGE 'CLOSE'
;
; CLOSE THE FILE ASSOCIATED WITH SA
;
CLOSE LDA SA
BNE CLS10 ; DIRECTORY CLOSE
LDA #0