OpenCores
URL https://opencores.org/ocsvn/System09/System09/trunk

Subversion Repositories System09

[/] [System09/] [rev_86/] [src/] [Flex9/] [f9-fms.asm] - Rev 120

Go to most recent revision | Compare with Previous | Blame | View Log

*
** FILE MANAGEMENT SYSTEM
*
ZD400 JMP >ZD436
FMSCLS JMP >ZD459
FMS JMP >FMS1
CPYMSG FCC / DISK OPERATING SYSTEM/
 FCC / COPYRIGHT (C) 1980 BY/
 FCC / TECHNICAL SYSTEMS CONSULTANTS/
 ORG CPYMSG
FCBPTR RMB 2
CURFCB RMB 4
ZD40F RMB 2
ZD411 RMB 1
ZD412 RMB 1
ZD413 RMB 1
ZD414 RMB 1
ZD415 RMB 2
ZD417 RMB 1
ZD418 RMB 2
ZD41A RMB 1
ZD41B RMB 2
ZD41D RMB 24
VERFLG FCB $FF
*
**
*
ZD436 JSR >COLDDR
 LDX #FCBPTR
 LDB #$0A
 BSR ZD451
 LDX #Z0005
 STX >ZD413
 STX >ZD415
 CLR >ZD41A
ZD44C LDX #ZD41B
 LDB #$1A
ZD451 CLR ,X+
 DECB 
 BNE ZD451
 JMP >PRSPL5

ZD459 JSR >PRSPL4
ZD45C LDX >FCBPTR
 BEQ ZD44C
 LEAX -$1C,X
 STX >CURFCB
 PSHS Y
 JSR >CLOSE
 PULS Y
 BCC ZD45C
 LDX >CURFCB
 CLR $02,X
 JSR >PRSPL5
 LDB #$FF
 RTS 

*
** FMS CALL, PROCESSING
*
FMS1 TST >ZCCFC
 BEQ ZD483
 JSR >PRSPL4
ZD483 PSHS Y,B
 STX >CURFCB
 CLR $01,X
 LDB ,X
 BNE DOFUNC
*
** READ/WRITE CHAR/BYTE
*
 LDB $02,X
 BEQ ZD4AC
 CMPB #$02
 BEQ ZD4A7
 JSR >ZD5B4
ZD499 LDX >CURFCB
 BCS ZD4C4
 TST >ZCCFC
 BNE ZD4C6
 CLRB 
 PULS Y,B
 RTS 

ZD4A7 JSR >ZD6CF
 BRA ZD499
ZD4AC LDB #$12
 BRA ZD4C4

DOFUNC CMPB #$16
 BLS DOFUN1
 LDB #$01
 BRA ZD4C4
DOFUN1 DECB
 ASLB 
 LDX #FMSTBL
 JSR [B,X]
 LDX >CURFCB
 BCC ZD4C6
ZD4C4 STB $01,X
ZD4C6 JSR >PRSPL5
 TST $01,X
 PULS Y,B
 RTS 
*
** FMS COMMAND VECTOR TABLE
*
FMSTBL FDB OPENRD FC 1
 FDB OPENWR FC 2
 FDB OPENUD FC 3
 FDB CLOSE FC 4
 FDB REWIND FC 5
 FDB OPNDIR FC 6
 FDB GETREC FC 7
 FDB PUTREC FC 8
 FDB RDSECT FC 9
 FDB WRSECT FC 10
 FDB RESV1 FC 11
 FDB DELETE FC 12
 FDB RENAME FC 13
 FDB RESV2 FC 14
 FDB NXTSEC FC 15
 FDB OPNREC FC 16
 FDB GETBYT FC 17
 FDB PUTBYT FC 18
 FDB RESV3 FC 19
 FDB NXTDRV FC 20
 FDB POSREC FC 21
 FDB BAKREC FC 22
*
**
*
ZD4FA BSR ZD51C
 BNE ZD503
 LDB #$02
 ORCC #$01
 RTS 

ZD503 STD ,X
 LDX ,X
 CLR ,X
 CLR $01,X
 RTS 

ZD50C BSR ZD51C
 BEQ ZD515
 LDB #$0D
 ORCC #$01
 RTS 

ZD515 LDD [,X]
 STD ,X
 ANDCC #$FE
 RTS 

ZD51C LDD >CURFCB
 ADDD #$001C
 LDX #FCBPTR
ZD525 LDY ,X
 BNE ZD52D
 ANDCC #$FB
 RTS 

ZD52D CMPD ,X
 BNE ZD533
 RTS 
ZD533 LDX ,X
 BRA ZD525

ZD537 LDX >CURFCB
 CLRA 
 CLRB 
 BSR ZD540
 LDB #$2F
ZD540 STA $11,X
 LEAX $01,X
 DECB 
 BNE ZD540
 RTS 

ZD549 LDX >CURFCB
 LDB #$0B
ZD54E LDA $04,X
 STA $24,X
 LEAX $01,X
 DECB 
 BNE ZD54E
 RTS 

ZD559 LDX >CURFCB
 LDB #$0B
ZD55E LDA $04,X
 PSHS A
 LDA $24,X
 CMPA ,S+
 BNE ZD56E
 LEAX $01,X
 DECB 
 BNE ZD55E
ZD56E RTS 
*
** GET RANDOM BYTE FROM SECTOR
*
GETBYT LDX >CURFCB
 LDB $02,X
 LSRB 
 BCC ZD5F0
 LDB $23,X
 JMP >ZD600

ZD57D LDX >CURFCB
 LDB $22,X
 INC $22,X
 ABX 
 STA $40,X
 INCB 
 BNE ZD5AC
 ORCC #$01
 RTS 
*
** PUT RANDOM BYTE IN SECTOR
*
PUTBYT LDX >CURFCB
 LDB $02,X
 ANDB #$03
 CMPB #$03
 BNE ZD5F0
 ORB #$80
 STB $02,X
 LDB $0F,X
 BITB #$80
 BNE ZD5AF
 LDB $23,X
 ABX 
 STA $40,X
ZD5AC ANDCC #$FE
 RTS 

ZD5AF LDB #$0B
 ORCC #$01
 RTS 

ZD5B4 LDA $3B,X
 BMI ZD5F5
 BEQ ZD5C2
 DEC $3B,X
 LDA #$20
 BRA ZD5DF

ZD5C2 BSR ZD5F5
 BCS ZD5E1
 CMPA #$18
 BHI ZD5DF
 BEQ ZD5C2
 CMPA #$09
 BNE ZD5DC
 BSR ZD5F5
 BCS ZD5E1
 LDX >CURFCB
 STA $3B,X
 BRA ZD5B4

ZD5DC TSTA 
 BEQ ZD5C2
ZD5DF ANDCC #$FE
ZD5E1 RTS 
*
** REWIND FILE
*
REWIND JSR >ZDAB1
 BCS ZD5F0
 BITA #$01
 BEQ ZD5F0
 STA ,X
 JMP >ZD9A0

ZD5F0 LDB #$12
 ORCC #$01
 RTS 

ZD5F5 LDX >CURFCB
 LDB $22,X
 BEQ ZD607
 INC $22,X
ZD600 ABX 
 LDA $40,X
 ANDCC #$FE
 RTS 

ZD607 BSR ZD60C
 BCC ZD5F5
 RTS 

ZD60C LDX >CURFCB
 LDD $40,X
 INC $21,X
 BNE ZD61A
 INC $20,X
ZD61A CMPD #$0000
 BEQ ZD63C
ZD620 STD $1E,X
 PSHS A
 LDA #$04
 STA $22,X
 PULS A
 BSR RDSECT
 BCC ZD640
 BITB #$80
 BEQ ZD638
 LDB #$10
 BRA ZD63E

ZD638 LDB #$09
 BRA ZD63E

ZD63C LDB #$08
ZD63E ORCC #$01
ZD640 RTS 
*
** READ SINGLE SECTOR
*
RDSECT BSR ZD668
 LDX >CURFCB
 JSR >DRIVE
 BCS ZD65D
ZD64B BSR ZD65E
 JSR >READ
 BNE ZD655
 ANDCC #$FE
 RTS 

ZD655 PSHS B
 BSR ZD670
 PULS B
 BCC ZD64B
ZD65D RTS 

ZD65E LDX >CURFCB
 LDD $1E,X
 LEAX $40,X
 RTS 

ZD668 CLRA 
 STA >ZD411
 STA >ZD412
 RTS 

ZD670 BITB #$10
 BNE ZD685
 BITB #$80
 BNE ZD69C
 LDB >ZD411
 INCB 
 CMPB #$07
 BEQ ZD685
 STB >ZD411
 BRA RESV2

ZD685 CLR >ZD411
 LDB >ZD412
 INCB 
 CMPB #$04
 BEQ ZD69C
 STB >ZD412
 LDX >CURFCB
 JSR >RESTOR
*
** RESERVED
*
RESV2 ANDCC #$FE
 RTS 
ZD69C ORCC #$01
 RTS 
*
** WRITE SINGLE SECTOR
*
WRSECT BSR ZD668
 LDX >CURFCB
 JSR >DRIVE
 BCS ZD6C9
ZD6A9 LDX >CURFCB
 BSR ZD65E
 JSR >WRITE
 BNE ZD6BD
 LDA >VERFLG
 BEQ ZD6EF
 JSR >VERIFY
 BEQ ZD6EF
ZD6BD BITB #$40
 BNE ZD6CC
 PSHS B
 BSR ZD670
 PULS B
 BCC ZD6A9
ZD6C9 RTS 

 LDB #$20
ZD6CC ORCC #$01
 RTS 

ZD6CF LDX >CURFCB
 LDB $3B,X
 BMI ZD714
 CMPA #$20
 BNE ZD6EA
 INCB 
 STB $3B,X
 CMPB #$7F
 BNE ZD6EF
 BRA ZD6F2

ZD6E5 BSR ZD6F2
 BCC ZD6CF
 RTS 

ZD6EA TSTB 
 BEQ ZD714
 BRA ZD6E5

ZD6EF ANDCC #$FE
 RTS 

ZD6F2 PSHS A
 CMPB #$01
 BNE ZD6FC
 LDA #$20
 BRA ZD70C

ZD6FC LDA #$09
 BSR ZD714
 PULS A
 BCS ZD713
 PSHS A
 LDX >CURFCB
 LDA $3B,X
ZD70C CLR $3B,X
 BSR ZD714
 PULS A
ZD713 RTS 

ZD714 LDX >CURFCB
 LDB $02,X
 CMPB #$02
 LBNE ZD5F0
 LDB $22,X
 CMPB #$04
 BNE ZD72E
 PSHS A
 BSR ZD74B
 PULS A
 BCS ZD73D
ZD72E JSR >ZD57D
 BCC ZD73D
 LDB #$04
 LDX >CURFCB
 STB $22,X
 ANDCC #$FE
ZD73D RTS 

ZD73E LDX >CURFCB
 CLRA 
 CLRB 
 STD $20,X
 STD $42,X
 BRA ZD772

ZD74B LDB $12,X
 BNE ZD772
 LDB $17,X
 BEQ ZD799
 CLR $17,X
 BSR ZD799
 BCS ZD786
 BSR ZD73E
 BCS ZD786
 BSR ZD73E
 BCS ZD786
 LDX >CURFCB
 LDB #$02
 STB $17,X
 LDD $11,X
 JMP >ZDC82

ZD772 BSR ZD782
 LDX >CURFCB
 STD $40,X
 JSR >WRSECT
 BCC ZD799
 JMP >ZDBC1

ZD782 BSR ZD787
 LDD ,X
ZD786 RTS 

ZD787 LDX >CURFCB
 LDB $03,X
 LDA #$06
 MUL 
 LDX #ZD41D
 ABX 
 STX >ZD41B
 TST ,X
 RTS 

ZD799 BSR ZD782
 BNE ZD7A2
 LDB #$07
ZD79F ORCC #$01
 RTS 

ZD7A2 LDX >CURFCB
 STD $13,X
 TST $12,X
 BNE ZD7B0
 STD $11,X
ZD7B0 INC $16,X
 BNE ZD7B8
 INC $15,X
ZD7B8 TST $17,X
 BEQ ZD7C8
 JSR >ZDC43
 BCS ZD79F
 LDX >CURFCB
 LDD $13,X
ZD7C8 JSR >ZD620
 BCS ZD79F
 LDX >CURFCB
 LDD $40,X
 PSHS B,A
 BSR ZD787
 PULS B,A
 STD ,X
 BNE ZD7E7
 CLR $02,X
 CLR $03,X
 CLR $04,X
 CLR $05,X
 BRA ZD7EF

ZD7E7 LDY $04,X
 LEAY -$01,Y
 STY $04,X
ZD7EF CLRA 
 LDX >CURFCB
 INC $21,X
 BNE ZD7FB
 INC $20,X
ZD7FB CLRB 
ZD7FC STA $40,X
 LEAX $01,X
 DECB 
 BNE ZD7FC
 LDX >CURFCB
 LDD $20,X
 STD $42,X
 ANDCC #$FE
 RTS 
*
** OPEN SYSTEM INFO. RECORD
*
OPNREC CLRB
 PSHS B
 LDB #$03
 BRA ZD825
 LDX >ZD415
 STX >ZD413
OPNDIR LDB >ZD413
 PSHS B
 LDB >ZD414
ZD825 LDX >CURFCB
 STB $41,X
 PULS B
 STB $40,X
 CLR >ZD418
 CLRB 
 STB $22,X
 RTS 
*
** GET INFO RECORD
*
GETREC LDX >CURFCB
 LDB $22,X
 BNE ZD85D
 JSR >ZD60C
 BCS ZD875
 LDX >CURFCB
 TST >ZD418
 BNE ZD852
 LDD <Z0044
 STD >ZD418
ZD852 LDA #$10
 STA $22,X
 LDD $1E,X
 STD $2F,X
ZD85D LDA $22,X
 STA $31,X
 LDB #$18
ZD865 PSHS X,B
 JSR >ZD5F5
 PULS X,B
 STA $04,X
 LEAX $01,X
 DECB 
 BNE ZD865
 ANDCC #$FE
ZD875 RTS 
*
** PUT INFORMATION RECORD
*
PUTREC LDX >CURFCB
 LDA $31,X
 STA $22,X
 LDB #$18
ZD881 PSHS X,B
 LDA $04,X
 JSR >ZD714
 PULS X,B
 LEAX $01,X
 DECB 
 BNE ZD881
 JMP >WRSECT

ZD892 LDX >CURFCB
 LDA $03,X
 STA $23,X
 LDA >ZD417
 TST >ZD41A
 BNE ZD8D3
 STA $03,X
 LDX >ZD415
 STX >ZD413
ZD8AA CMPX #Z0005
 BEQ ZD8BB
 BSR ZD8D3
 BLS ZD8EA
 LDX >ZD418
 STX >ZD413
 BRA ZD8AA

ZD8BB LDX >CURFCB
 LDA $23,X
 STA $03,X
 BPL ZD8D3
ZD8C5 JSR >NXTDRV
 BCS ZD900
 BSR ZD8D3
 BLS ZD8EA
 JSR >ZDDAD
 BRA ZD8C5

ZD8D3 LDX >CURFCB
 CLR >ZD41A
 JSR >ZD549
 JSR >OPNDIR
ZD8DF JSR >GETREC
 BCC ZD8EB
 CMPB #$08
 BEQ ZD900
 ORCC #$01
ZD8EA RTS 

ZD8EB LDX >CURFCB
 LDA $04,X
 BEQ ZD8FE
 BPL ZD8F6
 BSR ZD905
ZD8F6 JSR >ZD559
 BNE ZD8DF
 ANDCC #$FE
 RTS 

ZD8FE BSR ZD905
ZD900 ANDCC #$FB
 ANDCC #$FE
 RTS 

ZD905 LDA $33,X
 BNE ZD916
 LDD $2F,X
 STD $32,X
 LDA $31,X
 STA $34,X
ZD916 RTS 

ZD917 JSR >ZD787
 BNE ZD933
 BSR ZD936
 BCS ZD935
 LDB #$06
 LDY >CURFCB
 LDX >ZD41B
ZD929 LDA $5D,Y
 LEAY $01,Y
 STA ,X+
 DECB 
 BNE ZD929
ZD933 ANDCC #$FE
ZD935 RTS 

ZD936 JSR >OPNREC
 JSR >ZD60C
 BCS ZD946
 LDX >CURFCB
 LDB #$10
 STB $22,X
ZD946 RTS 

ZD947 JSR >ZD787
 BSR ZD936
 BCS ZD946
 LDB #$06
 LDY >CURFCB
 LDX >ZD41B
ZD957 LDA ,X+
 STA $5D,Y
 LEAY $01,Y
 DECB 
 BNE ZD957
 JSR >WRSECT
 BCC ZD946
 JMP >ZDBC1
*
**
*
RESV1 LDX >CURFCB
 LDA #$02
 STA $02,X
 LDD $2F,X
 STD $1E,X
 JSR >RDSECT
 BCS ZD983
 JSR >PUTREC
 BCC ZD985
 JMP >ZDBC1

ZD983 LDB #$0A
ZD985 RTS 
*
** OPEN FOR READ
*
OPENRD JSR >ZD4FA
 BCS ZD9C8
 JSR >ZD892
 BCS ZD9C8
 BNE ZD9CD
 LDX >CURFCB
 TST >ZD41A
 BEQ ZD9A0
 LDA $0F,X
 BITA #$20
 BNE ZD9C9
ZD9A0 JSR >ZDCC0
 BCS ZD9CF
 LDD $11,X
 STD $40,X
 JSR >ZDA76
 LDB $17,X
 BEQ ZD9C6
ZD9B3 PSHS B
 JSR >ZD60C
 PULS B
 BCS ZD9C8
 DECB 
 BNE ZD9B3
 LDX >CURFCB
 CLRB 
 STB $22,X
ZD9C6 ANDCC #$FE
ZD9C8 RTS 

ZD9C9 LDB #$11
 BRA ZD9CF

ZD9CD LDB #$04
ZD9CF PSHS B
 JSR >ZD50C
 PULS B
 ORCC #$01
 RTS 

OPENWR LDX >CURFCB
 TST $03,X
 BPL ZD9E8
 JSR >NXTDRV
 BCC ZD9E8
 LDB #$10
 RTS 

ZD9E8 JSR >ZD4FA
 BCS ZD9CF
 JSR >ZD537
 JSR >ZD917
 BCS ZD9CF
 JSR >ZD892
 BCS ZD9CF
 BNE ZDA00
 LDB #$03
 BRA ZD9CF

ZDA00 JSR >ZDCC0
 BCS ZD9CF
 LDX >CURFCB
 LDB #$0A
ZDA0A CLR $0F,X
 LEAX $01,X
 DECB 
 BNE ZDA0A
 LDX >CURFCB
 LDD $32,X
 BEQ ZDA40
 STD $2F,X
 LDA $34,X
 STA $31,X
 LDD >DATERG
 STD $19,X
 LDA >YEAR
 STA $1B,X
 JSR >ZDDAD
 JSR >RESV1
 BCS ZD9CF
 BSR ZDA76
 LDA #$04
 STA $22,X
 ANDCC #$FE
 RTS 

ZDA40 LDX >CURFCB
 CLR $17,X
 INC $12,X
 LDD $2F,X
 JSR >ZD620
 BCS ZDA5E
 JSR >ZD772
 BCS ZDA5E
 JSR >WRSECT
 BCC ZDA61
 JSR >ZDBC1
ZDA5E JMP >ZD9CF

ZDA61 LDX >CURFCB
 LDD $1E,X
 STD $32,X
 LDA #$10
 STA $34,X
 JSR >ZD947
 BCS ZDA5E
 BRA ZDA00

ZDA76 LDX >CURFCB
 LDA ,X
 STA $02,X
 CLR ,X
 CLR $3B,X
 CLRA 
 STA $22,X
 RTS 
*
** READ/WRITE NEXT SECTOR
*
NXTSEC BSR ZDAB1
 BCS ZDA99
 CLR ,X
 LSRA 
 LBCS ZD60C
 LDB #$04
 STB $22,X
 ANDCC #$FE
ZDA99 RTS 

ZDA9A LDX >CURFCB
 LDA $02,X
 CMPA #$83
 BNE ZDAAE
 LDA #$03
 STA $02,X
ZDAA7 JSR >WRSECT
 LBCS ZDBC1
ZDAAE ANDCC #$FE
 RTS 

ZDAB1 BSR ZDA9A
 BCS ZDAC2
 LDX >CURFCB
 LDA $02,X
 CMPA #$03
 BLS ZDAAE
 LDB #$12
 ORCC #$01
ZDAC2 RTS 

CLOSE BSR ZDAB1
 BCS ZDAF8
 CMPA #$02
 BEQ ZDAD3
ZDACB LDX >CURFCB
 CLR $02,X
 JMP >ZD50C

ZDAD3 LDA $12,X
 BNE ZDADD
 JSR >ZDBA7
 BRA ZDAF6

ZDADD BSR ZDAA7
 BCS ZDAF8
 LDX >CURFCB
 TST $17,X
 BEQ ZDAEE
 JSR >ZDC98
 BCS ZDAF8
ZDAEE JSR >RESV1
 BCS ZDAF8
 JSR >ZD947
ZDAF6 BCC ZDACB
ZDAF8 RTS 
*
** OPEN FOR UPDATE
*
OPENUD JSR >OPENRD
 BCS ZDB26
 JSR >ZD60C
 BCS ZDB26
 LDA #$03
 BRA ZDB1F
*
**
*
RESV3 JSR >OPENRD
 BCS ZDB26
 LDX >CURFCB
 LDA $0F,X
 BITA #$80
 BNE ZDB27
 LDD $13,X
 JSR >ZD620
 BCS ZDB26
 LDA #$02
ZDB1F LDX >CURFCB
 STA $02,X
 ANDCC #$FE
ZDB26 RTS 

ZDB27 LDB #$0B
 ORCC #$01
 RTS 
*
** RENAME FILE
*
RENAME BSR ZDB63
 JSR >ZD892
 BCS ZDB5D
 BEQ ZDB59
 LDX >CURFCB
 LDB #$0B
ZDB3A LDA $24,X
 STA $04,X
 LEAX $01,X
 DECB 
 BNE ZDB3A
 BSR ZDB93
 BCS ZDB5D
 LDX >CURFCB
 LDA $0F,X
 BITA #$80
 BNE ZDB27
 BITA #$60
 BNE ZDB5E
 BSR ZDB63
 BRA ZDBAE

ZDB59 LDB #$03
 ORCC #$01
ZDB5D RTS 
ZDB5E LDB #$0C
 ORCC #$01
 RTS 

ZDB63 LDX >CURFCB
 LDA #$0B
 STA >ZD411
ZDB6B LDA $04,X
 LDB $35,X
 STA $35,X
 STB $04,X
 LEAX $01,X
 DEC >ZD411
 BNE ZDB6B
 LDX >CURFCB
 LDA $0C,X
 BNE ZDB8F
 LDB #$03
ZDB85 LDA $3D,X
 STA $0C,X
 LEAX $01,X
 DECB 
 BNE ZDB85
ZDB8F LDX >CURFCB
 RTS 

ZDB93 BSR ZDB63
ZDB95 JSR >ZD892
 BCS ZDBA1
 BNE ZDBA2
 LDX >CURFCB
 ANDCC #$FE
ZDBA1 RTS 

ZDBA2 LDB #$04
 ORCC #$01
 RTS 

ZDBA7 LDX >CURFCB
 LDA #$FF
 STA $04,X
ZDBAE JSR >RESV1
 LDX >CURFCB
 LDA #$00
 STA $02,X
 RTS 

ZDBB9 STD $40,X
 JSR >WRSECT
 BCC ZDBD5
ZDBC1 BITB #$40
 BNE ZDBCD
 BITB #$80
 BEQ ZDBD3
 LDB #$10
 BRA ZDBD3
ZDBCD LDB #$0B
 BRA ZDBD3

 LDB #$0A
ZDBD3 ORCC #$01
ZDBD5 RTS 
*
** DELETE FILE
*
DELETE JSR >ZD917
 BCS ZDC39
 BSR ZDB95
 BCS ZDC39
 LDX >CURFCB
 LDA $0F,X
 BITA #$80
 BNE ZDC3A
 BITA #$60
 BNE ZDC3E
 JSR >ZD787
 LDX >ZD41B
 LDD $02,X
 BNE ZDC05
 LDX >CURFCB
 LDD $11,X
 BEQ ZDC31
 LDX >ZD41B
 STD ,X
 BRA ZDC19

ZDC05 LDX >CURFCB
 JSR >ZD620
 BCS ZDC39
 LDX >CURFCB
 LDD $11,X
 BEQ ZDC31
 BSR ZDBB9
 BCS ZDC39
ZDC19 LDX >CURFCB
 LDD $13,X
 LDX >ZD41B
 STD $02,X
 LDX >CURFCB
 LDD $15,X
 LDX >ZD41B
 ADDD $04,X
 STD $04,X
ZDC31 JSR >ZDBA7
 BCS ZDC39
 JSR >ZD947
ZDC39 RTS 

ZDC3A LDB #$0B
 BRA ZDC40
ZDC3E LDB #$0C
ZDC40 ORCC #$01
 RTS 

ZDC43 LDD $1E,X
 INCB 
 CMPB $3C,X
 BLS ZDC4F
 LDB #$01
 INCA 
ZDC4F CMPD $13,X
 BNE ZDC63
 LDA $37,X
 CMPA #$FF
 BEQ ZDC63
 INCA 
 STA $37,X
 ANDCC #$FE
 RTS 

ZDC63 BSR ZDC98
 BCS ZDC97
 LDX >CURFCB
 LDA $3A,X
 ADDA #$03
 BNE ZDC87
 LDD $1E,X
 CMPD $11,X
 BEQ ZDC7F
 LDB #$17
 ORCC #$01
 RTS 

ZDC7F LDD $40,X
ZDC82 STD $38,X
 LDA #$04
ZDC87 STA $3A,X
 LDD $13,X
 STD $35,X
 LDA #$01
 STA $37,X
 ANDCC #$FE
ZDC97 RTS 

ZDC98 LDD $38,X
 JSR >ZD620
 BCS ZDC97
 LDX >CURFCB
 TFR X,Y
 LDB $3A,X
 ABX 
 LDB #$03
ZDCAB LDA $35,Y
 LEAY $01,Y
 STA $40,X
 LEAX $01,X
 DECB 
 BNE ZDCAB
 JSR >WRSECT
 BCC ZDC97
 JMP >ZDBC1

ZDCC0 JSR >OPNREC
 JSR >ZD60C
 BCS ZDD0E
 LDX >CURFCB
 CLRA 
 CLRB 
 STD $20,X
 LDA $67,X
 STA $3C,X
 CLRB 
ZDCD7 CLR $40,X
 LEAX $01,X
 DECB 
 BNE ZDCD7
 LDX >CURFCB
 ANDCC #$FE
 RTS 
*
** BACKUP ONE RECORD
*
BAKREC LDX >CURFCB
 LDA $17,X
 BEQ ZDD0A
 LDD $20,X
 SUBD #$0001
 BPL ZDCF8
 JMP >ZDD9A
*
** POSITION TO RECORD N
*
ZDCF8 STD $20,X
POSREC JSR >ZDAB1
 BCS ZDD0E
 RORA 
 BCC ZDD0A
 CLR ,X
 LDA $17,X
 BNE ZDD0F
ZDD0A LDB #$12
 ORCC #$01
ZDD0E RTS 

ZDD0F CLR >ZD411
 LDD $11,X
 LDY $20,X
 BEQ ZDD85
 JSR >ZDD9F
 BCS ZDD0E
 CLRA 
 CLRB 
ZDD22 TST $02,X
 BEQ ZDD9A
 ADDB $02,X
 ADCA #$00
 STX >ZD40F
 LDX >CURFCB
 CMPD $20,X
 BCC ZDD62
 LDX >ZD40F
 LEAX $03,X
 PSHS A
 LDA >ZD411
 INCA 
 STA >ZD411
 CMPA #$54
 BEQ ZDD50
 CMPA #$A8
 PULS A
 BEQ ZDD9A
 BRA ZDD22

ZDD50 PSHS B
 LDX >CURFCB
 LDD $40,X
 BSR ZDD9F
 BCS ZDD9A
 PULS B
 PULS A
 BRA ZDD22

ZDD62 SUBD $20,X
 LDX >ZD40F
 LDA $02,X
 PSHS B
 SUBA ,S+
 DECA 
 TFR A,B
 LDA ,X
 ADDB $01,X
 LDX >CURFCB
 BCS ZDD7F
ZDD7A CMPB $3C,X
 BLS ZDD85
ZDD7F SUBB $3C,X
 INCA 
 BRA ZDD7A

ZDD85 JSR >ZD620
 BCS ZDD9E
 LDX >CURFCB
 LDD $42,X
 CMPD $20,X
 BEQ ZDDAA
 LDB #$19
 BRA ZDD9C

ZDD9A LDB #$18
ZDD9C ORCC #$01
ZDD9E RTS 

ZDD9F JSR >ZD620
 BCS ZDDAC
 LDX >CURFCB
 LDB #$44
 ABX 
ZDDAA ANDCC #$FE
ZDDAC RTS 

ZDDAD LDX >CURFCB
 LDB #$0B
ZDDB2 LDA $24,X
 STA $04,X
 LEAX $01,X
 DECB 
 BNE ZDDB2
 RTS 
*
** FIND NEXT DRIVE
*
NXTDRV LDX >CURFCB
 LDA $03,X
 INCA 
 CMPA #$04
 BCC ZDDD6
 STA $03,X
 BNE ZDDD0
 JSR >DRVRDY
 BRA ZDDD3

ZDDD0 JSR >QUICK
ZDDD3 BCS NXTDRV
 RTS 

ZDDD6 LDB #$10
 ORCC #$01
 RTS 
 END

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.