;******************************* MODULE HEADER *******************************;
;*                                                                           *;
;* FILE: samgenall.asm                                                       *;
;*                                                                           *;
;* MACHINE: NGenSGen   LANGUAGE: ASSEMBLER  OS: CTOS                        *;
;*                                                                           *;
;* DESCRIPTION:                                                              *;
;*                                                                           *;
;*   The file SamGen.Mdf contains all of the macro definitions for the     *;
;*   macros which are contained in this file, SamGenAll.Asm.               *;
;*   The Sequential Access Method (SAM) implementation contained in          *;
;*   CTOS.Lib may be reconfigured by creating a tailored SAMGEN module.      *;
;*   First, the SAMGEN.ASM source file must be edited to reflect the new     *;
;*   configuration. After editing, the SAMGEN.ASM file must be assembled     *;
;*   and then the resulting object file, SAMGEN.OBJ, mustbe included in      *;
;*   the list of object modules at link time. Alternately, if the new SAM    *;
;*   configuration is to be the default SAM configuration, the Librarian     *;
;*   utility may be used to overwrite the SAMGEN module contained in         *;
;*   CTOS.Lib.  The default SAM configuration contained in CTOS.Lib includes *;
;*   disk, keyboard, video, parallel printer, null, and spooler byte streams.*;
;*   In addition, the user may wish to include other byte streams,           *;
;*   e.g. communication or serial printer byte streams.                      *;
;*                                                                           *;
;*                                                                           *;
;* HISTORY:                                                                  *;
;*                                                                           *;
;* MMDDYY VVVVMM PROGRAMMER    DESCRIPTION OF CHANGE (Most recent first) *;
;*                                                                           *;
;* TITLE:  CTOS SYSTEM SOFTWARE                                              *;
;*                                                                           *;
;*            PROPRIETARY PROGRAM MATERIAL                                   *;
;*                                                                           *;
;* THIS MATERIAL IS PROPRIETARY TO UNISYS CORPORATION AND IS NOT TO BE       *;
;* REPRODUCED, USED OR DISCLOSED EXCEPT IN ACCORDANCE WITH PROGRAM LICENSE   *;
;* OR UPON WRITTEN AUTHORIZATION OF THE PATENT DIVISION OF UNISYS            *;
;* CORPORATION, DETROIT, MICHIGAN 48232, USA.                                *;
;*                                                                           *;
;* COPYRIGHT (C) 1980, 1993 CONVERGENT INCORPORATED. ALL RIGHTS RESERVED     *;
;* COPYRIGHT (C) 1980, 1993 UNISYS CORPORATION. ALL RIGHTS RESERVED          *;
;* ************************************************************************* *;
;*                                                                           *;
;* UNISYS BELIEVES THAT THE SOFTWARE FURNISHED HEREWITH IS ACCURATE AND      *;
;* RELIABLE, AND MUCH CARE HAS BEEN TAKEN IN ITS PREPARATION.  HOWEVER,      *;
;* NO RESPONSIBILITY, FINANCIAL OR OTHERWISE, CAN BE ACCEPTED FOR ANY        *;
;* CONSEQUENCES ARISING OUT OF THE USE OF THIS MATERIAL, INCLUDING LOSS OF   *;
;* PROFIT, INDIRECT, SPECIAL, OR CONSEQUENTIAL DAMAGES, THERE ARE NO         *;
;* WARRANTIES WHICH EXTEND BEYOND THE PROGRAM SPECIFICATION.                 *;
;*                                                                           *;
;* THE CUSTOMER SHOULD EXERCISE CARE TO ASSURE THAT USE OF THE SOFTWARE      *;
;* WILL BE IN FULL COMPLIANCE WITH LAWS, RULES AND REGULATIONS OF THE        *;
;* JURISDICTIONS WITH RESPECT TO WHICH IT IS USED.                           *;
;*                                                                           *;
;*                                                                           *;
;*************************** END OF MODULE HEADER ****************************;
;
$INCLUDE ([sys]<sys>samgen.mdf)
Init
$EJECT
;*****************************************************************************
; The DeviceOpen(deviceName,OpenProc) macro defines an OpenProc routine to *
; be called when OpenByteStream is called  with the deviceName specified. To *
; add an additional byte stream to the SAM configuration specified in this   *
; file, add a DeviceOpen macro to this section, defining the new deviceName  *
; and the corresponding OpenProc. To omit a byte stream, delete from this    *
; section the DeviceOpen macro associated with the byte stream to be omitted.*
; To substitute a new byte stream for an existing byte stream, replace the   *
; OpenProc parameter in the appropriate DeviceOpen macro with the new        *
; OpenProc. To add, omit, or substitute byte streams also requires editing   *
; the following sections of macros. Note that the deviceName [Disk] is a   *
; psuedo name for disk byte streams. DO NOT call OpenByteStream with the     *
; device spec [Disk].                                                      *
;                                                                            *
; To add a user written byte stream for device Foo add the following line to *
; this section                                                               *
;                                                                            *
'      DeviceOpen([Foo],OpenByteStreamFoo)                                 *
;                                                                            *
; To omit disk and spooler byte streams delete the following lines from this *
; section                                                                    *
;                                                                            *
'      DeviceOpen([Spl],OpenByteStreamSpl)                                 *
'      DeviceOpen([Disk],OpenByteStreamAD)                                 *
;                                                                            *
; To substitute synchronous byte streams for asynchronous byte streams       *
; replace                                                                    *
;                                                                            *
'      DeviceOpen([Disk],OpenByteStreamAD)                                 *
;                                                                            *
;       with                                                                 *
;                                                                            *
'      DeviceOpen([Disk],OpenByteStreamSD)                                 *
;                                                                            *
;  If you know that you are going to use the 8251 chips on the MegaFrame,    *
;  then replace                                                              *
;                                                                            *
'      DeviceOpen([Comm],OpenByteStreamC)                                  *
'      DeviceOpen([Ptr],OpenByteStreamPtr)                                 *
;                                                                            *
;       with                                                                 *
;                                                                            *
'      DeviceOpen([Comm],OpenByteStream_8251)                              *
'      DeviceOpen([Ptr],OpenByteStreamPtr_8251)                            *
;                                                                            *
;  And delete the DeviceOpen for [8251]                                      *
;                                                                            *
;*****************************************************************************
;
DeviceOpen([Kbd],OpenByteStreamK)
DeviceOpen([Vid],OpenByteStreamVid)
DeviceOpen([Lpt],OpenByteStreamLpt)
DeviceOpen([Ptr],OpenByteStreamPtr)
DeviceOpen([Nul],OpenByteStreamN)
DeviceOpen([Comm],OpenByteStreamC)
DeviceOpen([8251],OpenByteStream_8251)
DeviceOpen([Spl],OpenByteStreamSpl)
DeviceOpen([Disk],OpenByteStreamAD)
DeviceOpen([Gpam],OpenByteStreamGp)
DeviceOpen([Debug],OpenByteStreamDbg)

;***************************************************************
; To add 12 inch Tape or QIC bytestreams, remove the leading
; percentsignquote (') from the following lines:
;***************************************************************
'     DeviceOpen([Qic],OpenByteStreamT)
'     DeviceOpen([Tape],OpenByteStreamT)

$EJECT
;*****************************************************************************
; The tagProcs(tagName,FillBufferProc,FlushBufferProc,CheckPointProc,       *
;               ReleaseProc,SetImageModeProc) macro declares five           *
; device dependent procedures to be called when the various device           *
; independent procedures (ReadByte and ReadBsRecord, Writebyte and           *
; WriteBsRecord, CheckPointBs and ReleaseByteStream, and                     *
; SetImageMode) are called.                                                  *
;                                                                            *
; Note that tagProcs replaces an earlier macro called tagProc,           *
; in 10.0 CTOS and earlier.  tagProc is still defined in SamGen.mdf        *
; to avoid breaking existing usercustomized SamGen files.  Be careful       *
; to use tagProcs exclusively in all new SamGen files, and never           *
; to mix these two macros in a single file                                  *
;                                                                            *
; The tagName parameter is declared as a PUBLIC BYTE and is given a          *
; value. This value is used to route the device independent calls to         *
; the apppropriate device dependent routines.  The appropriate tag           *
; should be declared as an EXTERNAL BYTE within the OpenProc procedure       *
; and the tag byte of the BSWA should be assigned this tag value.            *
;                                                                            *
; To add an additional byte stream to the SAM configuration specified        *
; in this file, add to this section a tagProcs macro for each access         *
; mode associated with the new byte stream, declaring the five device        *
; dependent procedures to be used when a device independent procedure        *
; (ReadByte and ReadBsRecord, Writebyte and WriteBsRecord, CheckPointBs,     *
; ReleaseByteStream, and SetImageMode) is called.  In some cases not         *
; all five entries will apply.  For example, if SetImageMode does            *
; not apply, use the name SetImageModeIllegal.  To omit a byte stream,       *
; delete from this section all the tagProcs macros associated with the       *
; byte stream to be deleted.  To substitute a new byte stream for an         *
; existing byte stream, replace the five device dependent procedures         *
; declared in the tagProcs macros with the new procedure names. To add,      *
; omit, or substitute byte streams also requires editing the previous        *
; section of macros and the following section of macros.                     *
;                                                                            *
; To add a byte stream for device Foo, which can be opened with mode         *
; read or mode write, add the following lines to this section:               *
;                                                                            *
'     tagProcs(tagFooRead,FillBufferFoo,FlushBufIllegal,CheckPointBsFoo,ReleaseByteStreamFoo,SetImageModeFoo)
'     tagProcs(tagFooWrite,FillBufIllegal,FlushBufferFoo,CheckPointBsFoo,ReleaseByteStreamFoo,SetImageModeFoo)
;
; To omit disk, spooler, and CDROM byte streams delete the following lines
; from this section:
;
'     tagProcs(tagDiskRead,FillBufferAD,FlushBufIllegal,CheckPointBsAD,ReleaseByteStreamAD,SetImageModeIllegal)
'     tagProcs(tagDiskWrite,FillBufIllegal,FlushBufferAD,CheckPointBsAD,ReleaseByteStreamAD,SetImageModeIllegal)
'     tagProcs(tagDiskModify,FillBufferAD,FlushBufferAD,CheckPointBsAD,ReleaseByteStreamAD,SetImageModeIllegal)
'     tagProcs(tagSplWrite,FillBufIllegal,FlushBufferAD,CheckpointBsAD,ReleaseByteStreamSpl,SetImageModeSpl)
'     tagProcs(tagCdRead,FillBufferCD,FlushBufIllegal,ChkptNop,ReleaseByteStreamCD,SetImageModeIllegal)
;
; To substitute synchronous disk byte streams for asynchronous disk byte
; streams replace:
;
'     tagProcs(tagDiskRead,FillBufferAD,FlushBufIllegal,CheckPointBsAD,ReleaseByteStreamAD,SetImageModeIllegal)
'     tagProcs(tagDiskWrite,FillBufIllegal,FlushBufferAD,CheckPointBsAD,ReleaseByteStreamAD,SetImageModeIllegal)
'     tagProcs(tagDiskModify,FillBufferAD,FlushBufferAD,CheckPointBsAD,ReleaseByteStreamAD,SetImageModeIllegal)
'     tagProcs(tagSplWrite,FillBufIllegal,FlushBufferAD,CheckpointBsAD,ReleaseByteStreamSpl,SetImageModeSpl)
'     tagProcs(tagGpamWrite,FillBufIllegal,FlushBufferGp,CheckPointBsGp,ReleaseByteStreamGp,SetImageModeGp)
;
;      with
;
'     tagProcs(tagDiskRead,FillBufferSD,FlushBufIllegal,CheckPointBsSD,ReleaseByteStreamSD,SetImageModeIllegal)
'     tagProcs(tagDiskWrite,FillBufIllegal,FlushBufferSD,CheckPointBsSD,ReleaseByteStreamSD,SetImageModeIllegal)
'     tagProcs(tagDiskModify,FillBufferSD,FlushBufferSD,CheckPointBsSD,ReleaseByteStreamSD,SetImageModeIllegal)
'     tagProcs(tagSplWrite,FillBufIllegal,FlushBufferSD,CheckpointBsSD,ReleaseByteStreamSpl,SetImageModeSpl)
;
;*****************************************************************************
;
tagProcs(tagDiskRead,FillBufferAD,FlushBufIllegal,CheckPointBsAD,ReleaseByteStreamAD,SetImageModeIllegal)
tagProcs(tagDiskWrite,FillBufIllegal,FlushBufferAD,CheckPointBsAD,ReleaseByteStreamAD,SetImageModeIllegal)
tagProcs(tagDiskModify,FillBufferAD,FlushBufferAD,CheckPointBsAD,ReleaseByteStreamAD,SetImageModeIllegal)
tagProcs(tagKbdRead,FillBufferK,FlushBufIllegal,ChkptNop,ReleaseEasy,SetImageModeIllegal)
tagProcs(tagVideoWrite,FillBufIllegal,FlushBufferVid,ChkptNop,ReleaseEasy,SetImageModeIllegal)
tagProcs(tagLptWrite,FillBufIllegal,FlushBufferLpt,CheckPointBsLpt,ReleaseByteStreamLpt,SetImageModeLpt)
tagProcs(tagLptRead,FillBufferLpt,FlushBufIllegal,CheckPointBsLpt,ReleaseByteStreamLpt,SetImageModeIllegal)
tagProcs(tagLptModify,FillBufferLpt,FlushBufferLpt,CheckPointBsLpt,ReleaseByteStreamLpt,SetImageModeLpt)
tagProcs(tagPtrWrite,FillBufIllegal,FlushBufferC,CheckPointBsC,ReleaseByteStreamC,SetImageModeC)
tagProcs(tagNul,FillBufferN,FlushBufferN,ChkptNop,ReleaseEasy,SetImageModeIllegal)
tagProcs(tagCommRead,FillBufferC,FlushBufIllegal,CheckPointBsC,ReleaseByteStreamC,SetImageModeC)
tagProcs(tagCommWrite,FillBufIllegal,FlushBufferC,CheckPointBsC,ReleaseByteStreamC,SetImageModeC)
tagProcs(tagCommModify,FillBufferC,FlushBufferC,CheckPointBsC,ReleaseByteStreamC,SetImageModeC)
tagProcs(tag8251Read,FillBuffer_8251,FlushBufIllegal,CheckPointBs_8251,ReleaseByteStream_8251,SetImageModeC)
tagProcs(tag8251Write,FillBufIllegal,FlushBuffer_8251,CheckPointBs_8251,ReleaseByteStream_8251,SetImageModeC)
tagProcs(tag8251Modify,FillBuffer_8251,FlushBuffer_8251,CheckPointBs_8251,ReleaseByteStream_8251,SetImageModeC)
tagProcs(tagPtr8251Write,FillBufIllegal,FlushBuffer_8251,CheckPointBs_8251,ReleaseByteStream_8251,SetImageModeC)
tagProcs(tagSplWrite,FillBufIllegal,FlushBufferAD,CheckPointBsAD,ReleaseByteStreamSpl,SetImageModeSpl)
tagProcs(tagGpamWrite,FillBufIllegal,FlushBufferGp,CheckPointBsGp,ReleaseByteStreamGp,SetImageModeGP)
tagProcs(tagCdRead,FillBufferCD,FlushBufIllegal,ChkptNop,ReleaseByteStreamCD,SetImageModeIllegal)
tagProcs(tagDbg,FillBufIllegal,FlushBufferDbg,ChkptNop,ReleaseEasy,SetImageModeIllegal)

;***************************************************************
; To add 12 inch Tape or QIC bytestreams, remove the leading
; percentsignquote from the following lines:
;***************************************************************
'     tagProcs(tagTapeRead,FillBufferT,FlushBufIllegal,ChkptNop,ReleaseByteStreamT,SetImageModeIllegal)     
'     tagProcs(tagTapeWrite,FillBufIllegal,FlushBufferT,CheckPointBsT,ReleaseBytestreamT,SetImageModeIllegal)
;
$EJECT
;*****************************************************************************
; The DevDepProc(devDepCall,devDepProc) macro declares a routine devDepProc*
; to be called when the device dependent routine devDepCall is called. This  *
; macros allows for substitution of alternate routines to handle any device  *
; dependent byte stream routines defined (such as QueryVidBs, GetBsLfa,      *
; SetBsLfa, or SetImageMode) or the omission of any device dependent routines*
; not needed.                                                                *
;                                                                            *
; To substitue synchronous disk byte stream implementations of the device    *
; dependent routines GetBsLfa and SetBsLfa for the asynchronous              *
; implementations, replace                                                   *
;                                                                            *
'     DevDepProc(GetBsLfa,GetBsLfaAsync)                                   *
'     DevDepProc(SetBsLfa,SetBsLfaAsync)                                   *
;                                                                            *
;      with                                                                  *
;                                                                            *
'     DevDepProc(GetBsLfa,GetBsLfaSync)                                    *
'     DevDepProc(SetBsLfa,SetBsLfaSync)                                    *
;                                                                            *
; To omit the device dependent routine QueryVidBs delete the following       *
; line                                                                       *
;                                                                            *
'     DevDepProc(QueryVidBs,QueryVideoBs)                                  *
;                                                                            *
;*****************************************************************************
;
DevDepProc(QueryVidBs,QueryVideoBs)
DevDepProc(GetBsLfa,GetBsLfaAsync)
DevDepProc(SetBsLfa,SetBsLfaAsync)
DevDepProc(RenameBytestream,RenameBsAsync)
DevDepProc(DeleteBytestream,DeleteBsAsync)
DevDepProc(SetImageMode,SetImageModeBrn)
Final
