diff options
Diffstat (limited to 'docs/os12/mdfs.net/Docs/Comp/BBC/OS1-20/F9B4')
-rw-r--r-- | docs/os12/mdfs.net/Docs/Comp/BBC/OS1-20/F9B4 | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/docs/os12/mdfs.net/Docs/Comp/BBC/OS1-20/F9B4 b/docs/os12/mdfs.net/Docs/Comp/BBC/OS1-20/F9B4 new file mode 100644 index 0000000..77fe206 --- /dev/null +++ b/docs/os12/mdfs.net/Docs/Comp/BBC/OS1-20/F9B4 @@ -0,0 +1 @@ +OS SERIES 10
LAST PART
GEOFF COX
****************************** LOAD *************************************
F9B4 TYA ;A=Y
F9B5 BEQ &F9C4 ;
F9B7 JSR &FA46 ; print message following call
F9BA DB &0D ;
F9BB DB 'Loading';
F9C2 DB &0D ;
F9C3 BRK ;
F9C5 STA &BA ;current block flag
F9C6 LDX #&FF ;X=&FF
F9C8 LDA &C1 ;Checksum result
F9CA BNE &F9D9 ;if not 0 F9D9
F9CC JSR &FA72 ;else check filename header block matches searched
;filename if this returns NE then no match
F9CF PHP ;save flags on stack
F9D0 LDX #&FF ;X=&FF
F9D2 LDY #&99 ;Y=&99
F9D4 LDA #&FA ;A=&FA this set Y/A to point to 'File?' FA99
F9D6 PLP ;get back flags
F9D7 BNE &F9F5 ;report a query unexpected file name
F9D9 LDY #&8E ;making Y/A point to 'Data' FA8E for CRC error
F9DB LDA &C1 ;Checksum result
F9DD BEQ &F9E3 ;if 0 F9E3
F9DF LDA #&FA ;A=&FA
F9E1 BNE &F9F5 ;jump to F9F5
F9E3 LDA &03C6 ;block number
F9E6 CMP &B4 ;current block no. lo
F9E8 BNE &F9F1 ;if not eual F9F1
F9EA LDA &03C7 ;block number hi
F9ED CMP &B5 ;current block no. hi
F9EF BEQ &FA04 ;if equal FA04
F9F1 LDY #&A4 ;Y=&A4
F9F3 LDA #&FA ;A=&FA point to 'Block?' error unexpected block no.
;at this point an error HAS occurred
F9F5 PHA ;save A on stack
F9F6 TYA ;A=Y
F9F7 PHA ;save Y on stack
F9F8 TXA ;A=X
F9F9 PHA ;save X on stack
F9FA JSR &F8B6 ;print CR if indicated by current block flag
F9FD PLA ;get back A
F9FE TAX ;X=A
F9FF PLA ;get back A
FA00 TAY ;Y=A
FA01 PLA ;get back A
FA02 BNE &FA18 ;jump to FA18
FA04 TXA ;A=X
FA05 PHA ;save A on stack
FA06 JSR &F8A9 ;report
FA09 JSR &FAD6 ;check loading progress, read another byte
FA0C PLA ;get back A
FA0D TAX ;X=A
FA0E LDA &BE ;CRC workspace
FA10 ORA &BF ;CRC workspace
FA12 BEQ &FA8D ;
FA14 LDY #&8E ;Y=&8E
FA16 LDA #&FA ;A=&FA FA8E points to 'Data?'
FA18 DEC &BA ;current block flag
FA1A PHA ;save A on stack
FA1B BIT &EB ;CFS Active flag
FA1D BMI &FA2C ;if active FA2C
FA1F TXA ;A=X
FA20 AND &0247 ;filing system flag 0=CFS 2=RFS
FA23 BNE &FA2C ;
FA25 TXA ;A=X
FA26 AND #&11 ;
FA28 AND &BB ;current OPTions
FA2A BEQ &FA3C ;ignore errors
FA2C PLA ;get back A
FA2D STA &B9 ;store A on &B9
FA2F STY &B8 ;store Y on &B8
FA31 JSR &F68B ;do *EXEC 0 to tidy up
FA34 LSR &EB ;halve CFS Active flag to clear bit 7
FA36 JSR &FAE8 ;bell, reset ACIA & motor
FA39 JMP (&00B8) ;display selected error report
FA3C PLA ;get back A
FA3D INY ;Y=Y+1
FA3E BNE &FA43 ;
FA40 CLC ;clear carry flag
FA41 ADC #&01 ;Add 1
FA43 PHA ;save A on stack
FA44 TYA ;A=Y
FA45 PHA ;save Y on stack
FA46 JSR &E7DC ;check if free to print message
FA49 TAY ;Y=A
FA4A PLA ;get back A
FA4B STA &B8 ;&B8=8
FA4D PLA ;get back A
FA4E STA &B9 ;&B9=A
FA50 TYA ;A=Y
FA51 PHP ;save flags on stack
FA52 INC &B8 ;
FA54 BNE &FA58 ;
FA56 INC &B9 ;
FA58 LDY #&00 ;Y=0
FA5A LDA (&B8),Y ;get byte
FA5C BEQ &FA68 ;if 0 Fa68
FA5E PLP ;get back flags
FA5F PHP ;save flags on stack
FA60 BEQ &FA52 ;if 0 FA52 to get next character
FA62 JSR OSASCI ;else print
FA65 JMP &FA52 ;and do it again
FA68 PLP ;get back flags
FA69 INC &B8 ;increment pointers
FA6B BNE &FA6F ;
FA6D INC &B9 ;
FA6F JMP (&00B8) ;and print error message so no error condition
;occcurs
************ compare filenames ******************************************
FA72 LDX #&FF ;X=&FF inx will mean X=0
FA74 INX ;X=X+1
FA75 LDA &03D2,X ;sought filename byte
FA78 BNE &FA81 ;if not 0 FA81
FA7A TXA ;else A=X
FA7B BEQ &FA80 ;if X=0 A=0 exit
FA7D LDA &03B2,X ;else A=filename byte
FA80 RTS ;return
;
FA81 JSR &E4E3 ;set carry if byte in A is not upper case Alpha
FA84 EOR &03B2,X ;compare with filename
FA87 BCS &FA8B ;if carry set FA8B
FA89 AND #&DF ;else convert to upper case
FA8B BEQ &FA74 ;and if A=0 filename characters match so do it again
FA8D RTS ;return
;
FA8E BRK ;
FA8F DB &D8 ;error number
FA90 DB 'Data' ;
FA96 BRK ;
FA97 BNE &FAAE ;
FA99 BRK ;
FA9A DB &DB ;error number
FA9B DB 'File?' ;
FAA1 BRK ;
FAA2 BNE &FAAE ;
FAA4 BRK ;
FAA5 DB &DA ;error number
FAA6 DB 'Block?'
FAAD BRK ;
FAAE LDA &BA ;current block flag
FAB0 BEQ &FAD3 ;if 0 FAD3 else
FAB2 TXA ;A=X
FAB3 BEQ &FAD3 ;If X=0 FAD3
FAB5 LDA #&22 ;A=&22
FAB7 BIT &BB ;current OPTions checking bits 1 and 5
FAB9 BEQ &FAD3 ;if neither set no retry so FAD3 else
FABB JSR &FB46 ;reset ACIA
FABE TAY ;Y=A
FABF JSR &FA4A ;print following message
FAC2 DB &0D ;Carriage RETURN
FAC3 DB &07 ;BEEP
FAC4 DB 'Rewind Tape' ;
FACF DW &0D0D ;two more newlines
FAD1 BRK ;
FAD2 RTS ;return
;
FAD3 JSR &F24D ;print CR if CFS not operational
FAD6 LDA &C2 ;filename length/progress flag
FAD8 BEQ &FAD2 ;if 0 return else
FADA JSR &F995 ;confirm ESC not set and CFS not executing
FADD LDA &0247 ;filing system flag 0=CFS 2=RFS
FAE0 BEQ &FAD6 ;if CFS FAD6
FAE2 JSR &F588 ;else set up ACIA etc
FAE5 JMP &FAD6 ;and loop back again
********** sound bell, reset ACIA, motor off ****************************
FAE8 JSR &E7DC ;check if free to print message
FAEB BEQ &FAF2 ;enable second processor and reset serial system
FAED LDA #&07 ;beep
FAEF JSR OSWRCH ;
FAF2 LDA #&80 ;
FAF4 JSR &FBBD ;enable 2nd proc. if present and set up osfile block
FAF7 LDX #&00 ;
FAF9 JSR &FB95 ;switch on motor
FAFC PHP ;save flags on stack
FAFD SEI ;prevent IRQ interrupts
FAFE LDA &0282 ;get serial ULA control register setting
FB01 STA &FE10 ;write to serial ULA control register setting
FB04 LDA #&00 ;A=0
FB06 STA &EA ;store A RS423 timeout counter
FB08 BEQ &FB0B ;jump FB0B
FB0A PHP ;save flags on stacksave flags
FB0B JSR &FB46 ;release ACIA (by &FE08=3)
FB0E LDA &0250 ;get last setting of ACIA
FB11 JMP &E189 ;set ACIA and &250 from A before exit
FB14 PLP ;get back flags
FB15 BIT &FF ;if bit 7of ESCAPE flag not set
FB17 BPL &FB31 ;then FB31
FB19 RTS ;else return as unserviced ESCAPE is pending
*************************************************************************
* *
* Claim serial system for sequential Access *
* *
*************************************************************************
FB1A LDA &E3 ;get cassette filing system options byte
;high nybble used for LOAD & SAVE operations
;low nybble used for sequential access
;0000 Ignore errors, no messages
;0001 Abort if error, no messages
;0010 Retry after error, no messages
;1000 Ignore error short messages
;1001 Abort if error short messages
;1010 Retry after error short messages
;1100 Ignore error long messages
;1101 Abort if error long messages
;1110 Retry after error long messages
FB1C ASL ;move low nybble into high nybble
FB1D ASL ;
FB1E ASL ;
FB1F ASL ;
FB20 STA &BB ;current OPTions save into &BB
FB22 LDA &03D1 ;get sequential block gap
FB25 BNE &FB2F ;goto to &FB2F
*************************************************************************
* *
* claim serial system for cassette etc. *
* *
*************************************************************************
FB27 LDA &E3 ;get cassette filing system options byte
;high nybble used for LOAD & SAVE operations
;low nybble used for sequential access
;0000 Ignore errors, no messages
;0001 Abort if error, no messages
;0010 Retry after error, no messages
;1000 Ignore error short messages
;1001 Abort if error short messages
;1010 Retry after error short messages
;1100 Ignore error long messages
;1101 Abort if error long messages
;1110 Retry after error long messages
FB29 AND #&F0 ;clear low nybble
FB2B STA &BB ;as current OPTions
FB2D LDA #&06 ;set current interblock gap
FB2F STA &C7 ;to 6
FB31 CLI ;allow interrupts
FB32 PHP ;save flags on stack
FB33 SEI ;prevent interrupts
FB34 BIT &024F ;check if RS423 is busy
FB37 BPL &FB14 ;if not FB14
FB39 LDA &EA ;see if RS423 has timed out
FB3B BMI &FB14 ;if not FB14
FB3D LDA #&01 ;else load RS423 timeout counter with
FB3F STA &EA ;1 to indicate that cassette has 6850
FB41 JSR &FB46 ;reset ACIA with &FE80=3
FB44 PLP ;get back flags
FB45 RTS ;return
;
FB46 LDA #&03 ;A=3
FB48 BNE &FB65 ;and exit after resetting ACIA
********************** set ACIA control register **********************
FB4A LDA #&30 ;set current ACIA control register
FB4C STA &CA ;to &30
FB4E BNE &FB63 ;and goto FB63
;if bit 7=0 motor off 1=motor on
***************** control cassette system *******************************
FB50 LDA #&05 ;set &FE10 to 5
FB52 STA &FE10 ;setting a transmit baud rate of 300,motor off
FB55 LDX #&FF ;
FB57 DEX ;delay loop
FB58 BNE &FB57 ;
FB5A STX &CA ;&CA=0
FB5C LDA #&85 ;Turn motor on and keep baud rate at 300 recieve
FB5E STA &FE10 ;19200 transmit
FB61 LDA #&D0 ;A=&D0
FB63 ORA &C6 ;
FB65 STA &FE08 ;set up ACIA control register
FB68 RTS ;returnand return
;
FB69 LDX &03C6 ;block number
FB6C LDY &03C7 ;block number hi
FB6F INX ;X=X+1
FB70 STX &B4 ;current block no. lo
FB72 BNE &FB75 ;
FB74 INY ;Y=Y+1
FB75 STY &B5 ;current block no. hi
FB77 RTS ;return
;
FB78 LDY #&00 ;
FB7A STY &C0 ;filing system buffer flag
*****************set (zero) checksum bytes ******************************
FB7C STY &BE ;CRC workspace
FB7E STY &BF ;CRC workspace
FB80 RTS ;return
;
*********** copy sought filename routine ********************************
FB81 LDY #&FF ;Y=&FF
FB83 INY ;Y=Y+1
FB84 INX ;X=X+1
FB85 LDA &0300,X ;
FB88 STA &03D2,Y ;sought filename
FB8B BNE &FB83 ;until end of filename (0)
FB8D RTS ;return
;
FB8E LDY #&00 ;Y=0
********************** switch Motor on **********************************
FB90 CLI ;allow IRQ interrupts
FB91 LDX #&01 ;X=1
FB93 STY &C3 ;store Y as current file handle
********************: control motor ************************************
FB95 LDA #&89 ;do osbyte 137
FB97 LDY &C3 ;get back file handle (preserved thru osbyte)
FB99 JMP OSBYTE ;turn on motor
****************** confirm file is open ********************************
FB9C STA &BC ;file status or temporary store
FB9E TYA ;A=Y
FB9F EOR &0247 ;filing system flag 0=CFS 2=RFS
FBA2 TAY ;Y=A
FBA3 LDA &E2 ;CFS status byte
FBA5 AND &BC ;file status or temporary store
FBA7 LSR ;A=A/2
FBA8 DEY ;Y=Y-1
FBA9 BEQ &FBAF ;
FBAB LSR ;A=A/2
FBAC DEY ;Y=Y-1
FBAD BNE &FBB1 ;
FBAF BCS &FBFE ;
FBB1 BRK ;
FBB2 DB &DE ;error number
FBB3 DB 'Channel' ;
FBBA BRK ;
************* read from second processor ********************************
FBBB LDA #&01 ;A=1
FBBD JSR &FBD3 ;check if second processor file test tube prescence
FBC0 BEQ &FBFE ;if not exit
FBC2 TXA ;A=X
FBC3 LDX #&B0 ;current load address
FBC5 LDY #&00 ;Y=00
FBC7 PHA ;save A on stack
FBC8 LDA #&C0 ;filing system buffer flag
FBCA JSR &0406 ;and out to TUBE
FBCD BCC &FBCA ;
FBCF PLA ;get back A
FBD0 JMP &0406 ;
*************** check if second processor file test tube prescence ******
FBD3 TAX ;X=A
FBD4 LDA &B2 ;current load address high word
FBD6 AND &B3 ;current load address high word
FBD8 CMP #&FF ;
FBDA BEQ &FBE1 ;if &FF then its for base processor
FBDC LDA &027A ;&FF if tube present
FBDF AND #&80 ;to set bit 7 alone
FBE1 RTS ;return
;
******** control ACIA and Motor *****************************************
FBE2 LDA #&85 ;A=&85
FBE4 STA &FE10 ;write to serial ULA control register setting
FBE7 JSR &FB46 ;reset ACIA
FBEA LDA #&10 ;A=16
FBEC JSR &FB63 ;set ACIA to CFS baud rate
FBEF JSR &F995 ;confirm ESC not set and CFS not executing
FBF2 LDA &FE08 ;read ACIA status register
FBF5 AND #&02 ;clear all but bit 1
FBF7 BEQ &FBEF ;if clear FBEF
FBF9 LDA #&AA ;else A=&AA
FBFB STA &FE09 ;transmit data register
FBFE RTS ;return
;
FBFF BRK ;
\ No newline at end of file |