|
DataMuseum.dkPresents historical artifacts from the history of: CP/M |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about CP/M Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - download
Length: 7680 (0x1e00) Types: TextFile Names: »BOOT.Z80«
└─⟦21f5a1bd4⟧ Bits:30003500 CP/M Plus (tm) Version 3.0 BIOS Revision F └─ ⟦this⟧ »BOOT.Z80«
Title Boot.Z80 ;------------------------------------------------------------; ; This module patches the I/O-parameters from the loader to ; ; the Scb.Rel/ExtScb.Rel and Chario.Z80 . ; ; It also loads Ccp.Com/NetCcp.Ccp on coldboot to a reserved ; ; area in Bank0 0000h - 0DFFh/0FFFh, from where it will be ; ; reloaded to Bank1 address 0100h on warmboot. ; ;------------------------------------------------------------; ; Latest update: 1985-11-15. PSW ; Biosrevision: F ; .Z80 False Equ 0 True Equ Not False NetWork Equ False WrkStn Equ False Cr Equ 13 Lf Equ 10 Bdos Equ 5 ; Entry to CP/M Base1 Equ 0100h ; Ccp in Bank1 Base0 Equ 0000h ; Ccp in Bank0 Page 66 If Not WrkStn Switch Equ 1CH ; BIT5: TERMINAL TYPE Endif CiVc Equ 20H ; IN LOADER, BUT Switch DEPENDING CoVc Equ 22H ; -"- , -"- AiVc Equ 24H ; -"- AoVc Equ 26H ; -"- LoVc Equ 28H ; IN LOADER NoDev Equ 2Ah ; Number of character devices FFlagAdr Equ 2Bh ; First flag byte address AttachI Equ 7Eh ; Attachment to global disk I: AttachJ Equ 7Fh ; Attachment to global disk J: Extrn IntVect,Sio1Iv,CtcIrv ; In Bioskrnl.Z80 Extrn ?PMsg,?BnkSl,?Mov,?XMov ; In Bioskrnl.Z80 Extrn IniStm,@CTbl,RestTbl ; In Chario.Z80 Extrn SIOVec,CTC0Vec,CTC1Vec ; In Chario.Z80 If Not WrkStn Extrn PioIrv,PiaVec,PibVec Endif If NetWork Extrn Init ; In Bdos Endif Extrn @CoVec,@CiVec,@LoVec,@AoVec,@AiVec ; In Scb/ExtScb Entry ?Init,?Patch,?LdCcp,?RlCcp Extrn ?Titel ; In Drives.Asm Page Dseg ;; Bank0. ;------------------------------------------------------------; ; ?Patch -- This routine patches the I/O-parameters from the ; ; loader. ; ;------------------------------------------------------------; ?Patch: Ld Hl,(CiVc) ;; Console input bit vector Ld (@CiVec),Hl Ld Hl,(CoVc) ;; Console output bit vector Ld (@CoVec),Hl ;; If Not WrkStn In A,(Switch) ;; And 00100000b ;; Graphic terminal ? Jr Z,Patch1 ;; No... Ld Hl,1000h ;; Set device GRAPH: Ld (@CiVec),Hl ;; for console input Ld (@CoVec),Hl ;; and console output Endif Patch1: Ld Hl,(LoVc) ;; List output bit vector Ld (@LoVec),Hl Ld Hl,(AiVc) ;; Aux input bit vector Ld (@AiVec),Hl Ld Hl,(AoVc) ;; Aux output bit vector Ld (@AoVec),Hl ;; Ld Hl,Sio1Iv ;; Ld A,L ;; Ld (SIOVec),A ;; Ld Hl,CtcIrv ;; Ld A,L ;; Ld (CTC0Vec),A ;; Ld (CTC1Vec),A ;; If Not WrkStn Ld Hl,PioIrv ;; Pointer to interrupt vector Ld A,L ;; Ld (PiaVec),A ;; Inc A ;; Inc A ;; PioGBInt Ld (PibVec),A ;; Endif Ld Hl,@CTbl-1 ;; Address NoDev in Chario.Z80 Ld A,(NoDev) ;; Cp (Hl) ;; No match Loader/Chario Ret Nz ;; Return and use default in Chario Ld De,-4 ;; Ld B,A ;; Counter Patch2: Add Hl,De ;; Calculate Falg0 address for Dev #0 Djnz Patch2 ;; in Chario Ld B,A ;; Restore counter Ld De,FFlagAdr ;; Point Flag0 Dev #0 in loader Ld Ix,@CTbl+6 ;; Point Mode byte Dev #0 in Chario Patch3: Ld A,(De) ;; Move Flag0 Ld (Hl),A ;; Inc Hl ;; Inc De ;; And 00011111b ;; Mask baudrate Ld C,A ;; Save in C Ld A,(De) ;; Move Flag1 Ld (Hl),A ;; Inc Hl ;; Inc Hl ;; Inc Hl ;; Next Flag0 in Chario Push Bc ;; Save counter Ex De,Hl ;; Ld Bc,7 ;; Add Hl,Bc ;; Point out Mode byte in Loader Ld A,(Hl) ;; Move mode byte Ld (Ix),A ;; Inc Ix ;; Pop Bc ;; Restore counter $ baudrate Ld (Ix),C ;; Move baudrate Inc Hl ;; Next Flag0 in Loader Ex De,Hl ;; Push Bc ;; Ld Bc,7 ;; 8 bytes/device in Chario Add Ix,Bc ;; Next mode byte in Chario Pop Bc ;; Restore counter Djnz Patch3 Ret ;------------------------------------------------------------; ; ?Init -- Set up ineterrupt vector. Enable interrupt and ; ; print a part of signon message on console. ; ;------------------------------------------------------------; ?Init: Ld Hl,RestTbl ;; Init none device depending ports Call IniStm ;; Ld Hl,IntVect ;; Load interrupt register Ld A,H ;; Ld I,A ;; into Z80 register I. Ei ;; Must go if graphic term. Ld Hl,SignOn ;; Print 1/2 row in SignOn. Call ?Pmsg ;; Ld Hl,?Titel ;; Print 1/2 row in SignOn. Call ?Pmsg ;; Is in Drives.Asm If NetWork Ld A,(AttachI) ;; Pass over local disk attachments Ld C,9 ;; to Bdos. Inc A ;; Local A: attached to I: Ld B,A ;; in formula: 1*256+9 in Ix Jr Nz,Init1 ;; Ld Bc,-1 ;; Init1: Push Bc ;; Pop Ix ;; Ld A,(AttachJ) ;; Ld C,10 ;; Inc A ;; Ld B,A ;; Jr Nz,Init2 ;; Ld Bc,-1 ;; Init2: Push Bc ;; Pop Iy ;; Call Init ;; NetWork init Endif Ret ;; Cseg ; Bank1 ;------------------------------------------------------------; ; ?LdCcp -- Is called from Bioskrn.Z80 to load Ccp/NetCcp ; ; from the file Ccp.Com/NetCcp.Ccp. It will be ; ; stored in a buffer area in Bank0 and when ?RlCcp ; ; is called it will be reloaded to Bank1 for ; ; execution. ; ; Note: When ?RlCcp is called Bank1 is active. ; ;------------------------------------------------------------; ?LdCcp: Xor A ; Ld (CcpFcb+15),A ; Ld Hl,0 ; Ld (FcbNr),Hl ; Ld De,CcpFcb ; Open file Ld C,15 ; Call Bdos ; Inc A ; File open ? Jr Nz,CcpOpen ; Yes... CcpErr: Ld Hl,ErrCcp ; Xor A ; Set Bank0 Call ?BnkSl ; Call ?Pmsg ; Print error message Ld A,1 ; Set Bank1 Call ?BnkSl ; Ld C,1 ; Get console input Call Bdos ; Ld Hl,CrLf ; New line Call ?Pmsg ; If NetWork And Not WrkStn Ld A,9 ; Try load from local Ld (CcpFcb),A Endif Jr ?LdCcp ; Try again. ; Load Ccp/NetCcp from 'CCP.COM'/'NETCCP.CCP' CcpOpen: Ld De,128 ; Up to 16K read. Ld C,44 ; Multi sector count Call Bdos ; Ld De,Base1 ; Addess in Bank1. Ld C,26 ; Call Bdos ; Set DMA address Ld De,CcpFcb ; Ld C,20 ; Call Bdos ; Read records Cp 1 ; Any errors ? Jr Nz,CcpErr ; Yes... Ld Bc,0*256+1 ; B=DestBank, C=SourceBank. Ld De,Base1 ; Source address Ld Hl,Base0 ; Destination address. Jr RLoop1 ; ;------------------------------------------------------------; ; ?RlCcp -- Reloads Ccp/NetCcp from Bank0 to Bank1. ; ; ?LdCcp uses the main part of this routine to ; ; move Ccp/NetCcp from Bank1 to Bank0 on coldboot. ; ;------------------------------------------------------------; ?RlCcp: Ld Bc,1*256+0 ; B=DestBank, C=SourceBank. Ld De,Base0 ; Source address Ld Hl,Base1 ; Destination address RLoop1: Call ?XMov ; If NetWork Ld Bc,16*256 ; Count 32 128 byte sectors Else Ld Bc,13*256 ; Count 26 128 byte sectors Endif Call ?Mov ; Ld A,1 ; Set Bank1 Jp ?BnkSl ; CcpFcb: Db 1 ; Drive A: If NetWork Db 'NETCCP CCP' ; Filename Else Db 'CCP COM' ; Filename Endif Db 0 ; Ex (current extent) Db 0 ; S1 Db 0 ; S2 Db 0 ; RC (record count) Dw 0,0,0,0 ; D0 -- Dw 0,0,0,0 ; --D7 FcbNr: Db 0 ; Current record Db 0,0,0 ; R0,R1,R2 CrLf: Db Cr,Lf,0 Dseg ; Messages in Bank0. Only used during coldboot. ErrCcp: If NetWork Db 'NETCCP.CCP' Else Db 'CCP.COM' Endif Db '-error. Press <RET> to retry',0 SignOn: Db Cr,Cr,Lf Db 'CP/M Plus Version 3.0 - Jet-',0 End «eof»