;******************************* INCLUDE HEADER ******************************;
;*                                                                           *;
;* INCLUDE FILE: Samgen.mdf         VII120A M02  === 022889                *;
;*                                                                           *;
;* MACHINE: B20         LANGUAGE: ASSEMBLER  OS: BTOS                        *;
;*                                                                           *;
;* DESCRIPTION: Decides what byte streams are setup.                         *;
;*                                                                           *;
;*                                                                           *;
;* HISTORY:                                                                  *;
;*                                                                           *;
;* MMDDYY VVVVVVMM PROGRAMMER   DESCRIPTION OF CHANGE (Most recent first)*;
;*                                                                           *;
;* ??????   ????09 ?. ????      Add NTag_TagDbg                          *;
;*            62993 K. Fernandez  I copied his mdf file from PM's {Sui}    *;
;*                                  so our mediated CtosLib.dll would build. *;
;* 012193   123C08 R. Auradkar  Made ReadStatusLp=ReadStatusLpt;         *;
;*									Consistent with other definitions.    *AA*;
;* 111892   123B07 T. Tran      Add bidir parallel support (CTOS III 1.1*;
;*                                  and above only). New call is ReadStatusP *;
;* 102990   121D06 W. Chiu      Add checkdef for tagCDRead               *;
;* 102990   121C05 N. Shaffer   Add CDROM bytestream                     *;
;* 043090   121A04 K. Yajima(NUL) Change bsVid for ENLS.                 *;
;* 012290   120F03 V. Muppidi   Padded vsbid upto 130bytes               *;
;* 022889 II120A02 V. Muppidi   Folded changes from Sanjose's 12.0       *;
;* 083188 II021B01 R. Tratner   Updated Header for 2.1.B                 *;
;* 082588 II020H00 R. Tratner   Updated to CT's 12.0 baseline, no uva.   *;
;*                                  Addes ability to decide what is linked   *;
;*                                  into run files to reduce their sizes.    *;
;*                                                                           *;
;* TITLE:  BTOS 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 CONVERGENT TECHNOLOGIES, INC. ALL RIGHTS RESERVED      *;
;* COPYRIGHT (C) 1989 UNISYS CORPORATION                                     *;
;* ************************************************************************* *;
;*                                                                           *;
;* 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 ****************************;
;
;  11.1 SamGen.mdf uses new fixed tag logic
;  Compatible with 11.1 Ctos.lib and CTOSVM 2.1
;
;Modified:  JJKDMO   71284  Add Gpam.  Make semireadable.
;           PKDDMO  121884  Add PUBLIC pProcRoutine.
;           DC       030685  Make SetImageMode generic.
;	        DR       030685  Add fSameLooks to BsVid
;	        AM       012287  Introduce new tags management
;	        AM       040687  A new variable is used, LinkWithSam, if set 
;                              to 0FFh SAM Comm and printer not linked with 
;                              application.
;			101787 JM  use tagProcs for sysin,sysout instead of tagProc.
;  12.0 	
;			072288 TAB added x.25 tags
;			080288 TAB added SamHat branching, 8251 StubOuts
;			080988 TAB added SamgenVersion support
;			010489 TAB added SamCInit and SamCFinal so users can
;				     have just devicedependent programs.


NTag_tagDiskRead     equ 0
NTag_tagDiskWrite    equ 1
NTag_tagDiskModify   equ 2
NTag_tagKbdRead      equ 3
NTag_tagVideoWrite   equ 4
NTag_tagLptWrite     equ 5
NTag_tagPtrWrite     equ 6
NTag_tagNul          equ 7
NTag_tagCommRead     equ 8
NTag_tagCommWrite    equ 9
NTag_tagCommModify   equ 10
NTag_tagSplWrite     equ 11
NTag_tagSysIn        equ 12
NTag_tagSysOut       equ 13
NTag_tagGpamWrite    equ 14
NTag_tagCardC        equ 15
NTag_tagCardI        equ 16

NTag_tag8251Read     equ 17
NTag_tag8251Write    equ 18
NTag_tag8251Modify   equ 19
NTag_tagPtr8251Write equ 20
NTag_tagQicRead      equ 21
NTag_tagQicWrite     equ 22
NTag_tagTapeRead     equ 23
NTag_tagTapeWrite    equ 24
NTag_tagLptRead      equ 25
NTag_tagLptModify    equ 26

NTag_tagX25Write     equ 27
NTag_tagX25Read      equ 28
NTag_tagX25Modify    equ 29
NTag_tagCDRead       equ 30

NTag_tagDbg          equ 31

NTag_taglast         equ 0ffh

EXTRN  CheckInsSam:FAR

; SamgenVersion_x is changed whenever the tables Samgen creates are 
; incompatible with previous versions.  The SamgenVersion.asm module in
; Ctos.lib resolves this extrn.  Whenever an incompatibility is created,
; increment the version number in the label here and in SamgenVersion.asm.
; If an application's samgen and the Ctos.lib used are incompatible, this
; name will be an unresolved external in the link map.

EXTRN SamgenVersion_1:BYTE


*DEFINE (Init) (
	PUBLIC OpenTable,sTagProcs,tagTable,tagLast,deviceLast
	PUBLIC fDiskBsDef,DiskBsOpen,fSplBsDef,SplBsOpen,fGpamBsDef,GpamBsOpen
	DGROUP GROUP DATA
	SET(DevNum,0)
	SET(tag,0)
	SET(segFlag,0)
	SET(DiskFlag,0)
	SET(SplFlag,0)
	SET(GpamFlag,0)
	SET(Flag8251,0)
	SET(LptFlag,0)
	SET(CommFlag,0)
	SET(DevDepFlag,0)
	SET(tagVideoWriteVal,0FFH)
	SET(tagKbdReadVal,0FFH)
	DEFINE (OpenProcDisk) (0)
	DEFINE (OpenProcSpl) (0)
	DEFINE (OpenProcGpam) (0)
	DATA	SEGMENT PUBLIC 'DATA'
	xDisk	LABEL	BYTE
	ySpl	LABEL	BYTE
	zGpam LABEL BYTE
	)
;*M02 BEGIN *DEFINE (SamCInit) (
	SET(tag,0)
	DGROUP GROUP DATA
	)
;*M02 END 

*DEFINE (DeviceOpen(DeviceName,OpenProc)) (

	IF (NOT(ISDEF(OpenProc)) AND NOT(EQS(OpenProc,OpenByteStreamLpt))) THEN (
		??SEG	SEGMENT
		EXTRN	OpenProc:FAR
		??SEG	ENDS
		) FI

	DEFINE(DevName_Gpam)(zSUBSTR(DeviceName,2,LEN(DeviceName)2))
	DEFINE(DevName_Disk)(xSUBSTR(DeviceName,2,LEN(DeviceName)2))
	DEFINE(DevName_Spl) (ySUBSTR(DeviceName,2,LEN(DeviceName)2))

	IF (NOT(ISDEF(DevName_Disk))) THEN (

		IF (NOT(ISDEF(DevName_Spl))) THEN (

			IF (NOT(ISDEF(DevName_Gpam))) THEN (
				IF (DevNum EQ 0) THEN (OpenTable LABEL BYTE) FI

				IF (EQS(DeviceName,[Lpt])) THEN (SET(LptFlag,0FFh)) FI
				IF (EQS(DeviceName,[Ptr])) THEN (SET(CommFlag,0FFh)) FI
				IF (EQS(DeviceName,[Comm])) THEN (SET(CommFlag,0FFh)) FI
				IF (EQS(DeviceName,[8251])) THEN (
					SET(CommFlag,0FFh)
					SET(Flag8251,0FFh)
					) FI

				SET(DevNum, DevNum+1)
				DB	LEN(DeviceName)
				DB	'DeviceName'
				DD	OpenProc
				)
			ELSE (
				DEFINE (OpenProcGpam) (OpenProc)
				SET(GpamFlag,0FFh)
				) FI
			)

		ELSE (	
			DEFINE (OpenProcSpl) (OpenProc)
			SET(SplFlag,0FFH)
			) FI

		)
	ELSE (	
		DEFINE (OpenProcDisk) (OpenProc)
		SET(DiskFlag,0FFH)
		) FI
	)

'  tagProcs  used only with 10.0 and later SamGens.
'  Earlier SamGens used tagProc, which does not include SetImageMode.
'
*DEFINE (tagProcs(tagName,FillProc,FlushProc,CheckPointProc,ReleaseProc,SetImageModeProc)) (
	IF (tag EQ 0) THEN (
	    DeviceOpen([SysIn],OpenByteStreamSysIn)
	    DeviceOpen([SysOut],OpenByteStreamSysOut)
		IF (LptFlag EQ 0FFh) THEN (
			SamHatProc (OpenBytestreamLpt,24,541)
			SamHatProc (FlushBufferLpt,14,543)
			SamHatProc (CheckPointBsLpt,6,545)
			SamHatProc (ReleaseByteStreamLpt,4,547)
			SamHatProc (SetImageModeLpt,6,549)
			SamHatProc (ReadByteStreamParameterLpt,10,553)
			SamHatProc (WriteByteStreamParameterLpt,8,554)
			SamHatProc (FillBufferLpt,14,567)
			SamHatProc (ReadStatusLpt,10,568)
		) FI
		IF (CommFlag EQ 0FFh) THEN (
			SamHatProc (OpenBytestreamSpecialC,26,542)
			SamHatProc (AcquireBytestreamC,32,563)
			SamHatProc (FlushBufferC,14,544)
			SamHatProc (CheckpointBsAsyncC,14,546)
			SamHatProc (ReleaseByteStreamC,4,548)
			SamHatProc (SetImageModeC,6,550)
			SamHatProc (FlushBufferAsyncC,24,555)
			SamHatProc (ReadByteStreamParameterC,10,556)
			SamHatProc (WriteByteStreamParameterC,8,557)
			SamHatProc (CheckForOperatorRestartC,8,558)
			SamHatProc (DiscardOutputBsC,4,559)
			SamHatProc (FillBufferAsyncC,24,560)
			SamHatProc (DiscardInputBsc,8,561)
			SamHatProc (ReadStatusC,10,562)
			SamHatProc (WriteStatusC,8,564)
			SamHatProc (SendBreakC,4,565)
			SamHatProc (CheckpointBsc,6,566)
		) FI
	    sTagProcs   DW 21
	    tagTable    LABEL DWORD)
	FI
	PUBLIC  tagName
	tagName DB NTag_tagName        ;NTag;
	IF (EQS(tagName,tagVideoWrite)) THEN(
             SET(tagVideoWriteVal,NTag_tagName))
	FI
	IF (EQS(tagName,tagKbdRead)) THEN(
             SET(tagKbdReadVal,NTag_tagName))
	FI
	SET(tag, tag+1)
	IF (NOT(ISDEF(FillProc))) THEN(
 	     ??SEG	SEGMENT
             EXTRN	FillProc:FAR
	     ??SEG	ENDS)
	FI
	DD	FillProc
	IF (NOT(ISDEF(FlushProc))) THEN(
	     ??SEG	SEGMENT
             EXTRN	FlushProc:FAR
	     ??SEG	ENDS)
	FI
	DD      FlushProc
	IF (NOT(ISDEF(CheckPointProc))) THEN(
	     ??SEG	SEGMENT
             EXTRN	CheckPointProc:FAR
	     ??SEG	ENDS)
	FI
	DD	CheckPointProc
	IF (NOT(ISDEF(ReleaseProc))) THEN(
	     ??SEG	SEGMENT
             EXTRN	ReleaseProc:FAR
	     ??SEG	ENDS)
	FI
	DD	ReleaseProc
	IF (NOT(ISDEF(SetImageModeProc))) THEN(
	     ??SEG	SEGMENT
             EXTRN	SetImageModeProc:FAR
	     ??SEG	ENDS)
	FI
	DD	SetImageModeProc)

'  tagProc  used only with priorto10.0 format Samgens.
'  (Included so such Samgens can still be compiled and used with 10.0
'   CTOS.)
'  10.0 and later SamGens use tagProcs, a tagProc replacement which
'   includes SetImageMode.
'
*DEFINE (tagProc(tagName,FillProc,FlushProc,CheckPointProc,ReleaseProc)) (
	IF (tag EQ 0) THEN (
	     DeviceOpen([SysIn],OpenByteStreamSysIn)
	     DeviceOpen([SysOut],OpenByteStreamSysOut)
	     sTagProcs   DW 17
	     tagTable    LABEL DWORD)
	FI
	PUBLIC  tagName
	tagName DB NTag_tagName       ;NTag;
	IF (EQS(tagName,tagVideoWrite)) THEN(
             SET(tagVideoWriteVal,NTag_tagName))
	FI
	IF (EQS(tagName,tagKbdRead)) THEN(
             SET(tagKbdReadVal,NTag_tagName))
	FI
	SET(tag, tag+1)
	IF (NOT(ISDEF(FillProc))) THEN(
 	     ??SEG	SEGMENT
             EXTRN	FillProc:FAR
	     ??SEG	ENDS)
	FI
	DD	FillProc
	IF (NOT(ISDEF(FlushProc))) THEN(
	     ??SEG	SEGMENT
             EXTRN	FlushProc:FAR
	     ??SEG	ENDS)
	FI
	DD      FlushProc
	IF (NOT(ISDEF(CheckPointProc))) THEN(
	     ??SEG	SEGMENT
             EXTRN	CheckPointProc:FAR
	     ??SEG	ENDS)
	FI
	DD	CheckPointProc
	IF (NOT(ISDEF(ReleaseProc))) THEN(
	     ??SEG	SEGMENT
             EXTRN	ReleaseProc:FAR
	     ??SEG	ENDS)
	FI
	DD	ReleaseProc)

*DEFINE (DevDepProc(ProcName,ProcRoutine)) (
	IF (DevDepFlag EQ 0) THEN ( tagProcs(tagSysIn,FillBufferSysIn,FlushBufIllegal,ChkptNop,ReleaseEasy,SetImageModeIllegal)
	     tagProcs(tagSysOut,FillBufIllegal,FlushBufferSysOut,CheckPointBsSysOut,ReleaseEasy,SetImageModeIllegal)

	tagLast DB NTag_tagLast    ;NTag;

	     DATA ENDS
	     SAMGEN SEGMENT PUBLIC 'CODE'
	     xQueryVidBs LABEL FAR
	     yQueryBsVid LABEL FAR
	     SAMGEN ENDS
	     SET(DevDepFlag,1))
	FI

	PUBLIC pProcRoutine
	DATA	SEGMENT PUBLIC 'DATA'
	pProcRoutine DD ProcRoutine
	DATA	ENDS

	SAMGEN SEGMENT PUBLIC 'CODE'
	ASSUME CS:SAMGEN
	ASSUME DS:DGROUP
	IF (ISDEF(xProcName)) THEN (
	     QueryBsVid LABEL FAR
	     PUBLIC QueryBsVid)
	FI
	IF (ISDEF(yProcName)) THEN (
	     QueryVidBs LABEL FAR
 	     PUBLIC QueryVidBs)
	FI
        ??SEG 	SEGMENT
	EXTRN	ProcRoutine:FAR
	??SEG	ENDS
	PUBLIC ProcName
	ProcName PROC FAR
		  PUSH BP
		  MOV  BP,SP
		  POP  BP
		  JMP  DWORD PTR pProcRoutine
		  RET
	ProcName ENDP
	SAMGEN ENDS)

*DEFINE (CheckDef(tagCT)) (
	IF (NOT(ISDEF(tagCT))) THEN(
             tagCT	 DB Ntag_tagCT		;NTAG;
             PUBLIC	 tagCT
	IF (EQS(tagCT,tagVideoWrite)) THEN(
             SET(tagVideoWriteVal,tag))
	FI
	IF (EQS(tagCT,tagKbdRead)) THEN(
             SET(tagKbdReadVal,tag))
	FI
             SET(tag,tag+1))
	FI)


*DEFINE (SamHatProc(ProcName,sParms,iOsLab)) (

	PUBLIC	pInProcName, pScProcName
	DATA	SEGMENT PUBLIC 'DATA'
	pInProcName DD In_ProcName
	pScProcName DD Sc_ProcName
	DATA	ENDS

	SAMGEN SEGMENT PUBLIC 'CODE'
	ASSUME CS:SAMGEN
	ASSUME DS:DGROUP

	??SEG  SEGMENT
	EXTRN  In_ProcName:FAR, Sc_ProcName:FAR
	??SEG  ENDS

	PUBLIC ProcName
	ProcName PROC FAR
		  PUSH BP
		  MOV  BP,SP
		  LES  BX,DWORD PTR [BP+EVAL(sParms+2)]
		  PUSH ES
		  PUSH BX
		  MOV  AX,iOsLab
		  PUSH AX
		  CALL CheckInsSam
		  OR   AX,AX
		  JNE  inProcName
		  POP  BP
		  JMP  DWORD PTR pScProcName
	inProcName:
		  MOV  AL,BYTE PTR [FLink]
		  RCR  AL,1
		  JAE  noProcName
		  POP  BP
		  JMP  DWORD PTR pInProcName
	noProcName:
		  MOV  AX,7
		  POP  BP
		  RET  EVAL(sParms)
	ProcName ENDP
	SAMGEN ENDS)


*DEFINE (StubOut(ProcName,sParms)) (

	SAMGEN SEGMENT PUBLIC 'CODE'
	ASSUME CS:SAMGEN
	ASSUME DS:DGROUP

	ProcName PROC FAR
		  PUSH BP
		  MOV  BP,SP
		  MOV  AX,7
		  POP  BP
		  RET  EVAL(sParms)
	ProcName ENDP

	PUBLIC ProcName
	SAMGEN ENDS
)


*DEFINE (Final) (
	IF (DevDepFlag NE 0) THEN (
	     DATA SEGMENT PUBLIC 'DATA')
	ELSE (tagProcs(tagSysIn,FillBufferSysIn,FlushBufIllegal,ChkptNop,ReleaseEasy,SetImageModeIllegal)
	     tagProcs(tagSysOut,FillBufIllegal,FlushBufferSysOut,CheckPointBsSysOut,ReleaseEasy,SetImageModeIllegal) 

	tagLast DB NTag_tagLast    ;NTag;)
        FI
	SET(tag,tag+1)
	deviceLast DB DevNum
	fDiskBsDef DB DiskFlag
	DiskBsOpen DD OpenProcDisk
        fSplBsDef  DB SplFlag
	SplBsOpen  DD OpenProcSpl
	fGpamBsDef DB GpamFlag
	GpamBsOpen DD OpenProcGpam
	CheckDef(tagDiskRead)
	CheckDef(tagDiskWrite)
	CheckDef(tagDiskModify)
	CheckDef(tagKbdRead)
	CheckDef(tagVideoWrite)
	CheckDef(tagLptWrite)
	CheckDef(tagPtrWrite)
	CheckDef(tagNul)
	CheckDef(tagCommRead)
	CheckDef(tagCommWrite)
	CheckDef(tagCommModify)
	CheckDef(tag8251Read)
	CheckDef(tag8251Write)
	CheckDef(tag8251Modify)
	CheckDef(tagPtr8251Write)
	CheckDef(tagSplWrite)
	CheckDef(tagGpamWrite)
	CheckDef(tagLptRead)
	CheckDef(tagLptModify)
	CheckDef(tagX25Write)
	CheckDef(tagX25Read)
	CheckDef(tagX25Modify)	
	CheckDef(tagCDRead)
	CheckDef(tagDbg)
	CheckDef(tagTapeRead)
	CheckDef(tagTapeWrite)
	PUBLIC  bsVid  
	EVEN
	bsVid   LABEL DWORD
                DD    0					;pBuffer
                DW    0					;sBuffer
                DW    0					;ibRead
                DW    0					;ibWrite
                DB    0					;fOkToPutBack
                DB    0					;fPutBack
                DB    0					;bPutBack
                DB    tagVideoWriteVal	;tag
                DB    0					;iframe
                DB    0					;fEscape
                DB    0					;rgbEscape (6)
                DB    0
                DB    0
                DB    0
                DB    0
                DB    0
                DB    0					;ibEscape
                DB    0					;fLiteral
                DB    0					;fLiteralEsc
                DB    0					;looks
                DB    0					;fBsVidOpen
                DB    0					;fSameLooks
                DB    0					;bSrpVideoExists
                DB    0					;rgbChar (4)  (ENLS)  *m04*
                DB    0
                DB    0
                DB    0
                DB    0					;ibChar       (ENLS)  *m04*
                DB    0					;chWidth      (ENLS)  *m04*
                DB    0					;cIgnore      (ENLS)  *m04*
                DB    0					;fLastChar    (ENLS)  *m04*
                DB    0					;bLastAttr    (ENLS)  *m04*
		        DD    0
		        DD    0
		        DD    0
		        DD    0
		        DD    0
		        DD    0
		        DD    0
		        DD    0
		        DD    0
		        DD    0
		        DD    0
		        DD    0
		        DD    0
		        DD    0
		        DD    0
		        DD    0
		        DD    0
		        DD    0
		        DD    0
		        DD    0
		        DD    0
		        DD    0
		        DD    0
	PUBLIC  bsKbd
	EVEN
	bsKbd   LABEL DWORD
	        DD    0
                DW    0
                DW    0
                DW    0
                DB    0FFH
                DB    0
                DB    0
                DB    tagKbdReadVal
                DB    0
                DB    0
                DB    0
PUBLIC pPrepWriteMMD
PUBLIC pPrepReadMMD
pPrepWriteMMD   DD    ?
pPrepReadMMD    DD    ?


*DEFINE (OsSubLab ( n, pName ))
(SSEVAL(N8)   SEGMENT AT (0FFFFh(16*(N8)))
        ORG     (230h+(100h*(N8))+2*N10h*(N8))
PUBLIC  pName
pName  EQU     THIS BYTE
        SSEVAL(N8)   ENDS
)

*DEFINE (Same( original , copy ))(
PUBLIC copy
copy EQU original
)


PUBLIC FLink
IF (*ISDEF(LinkWithSam)) THEN (

Flink	DB	0

OsSubLab(541, IN_OpenByteStreamLpt)	;541
OsSubLab(542, IN_OpenByteStreamSpecialC)	;542
OsSubLab(543, IN_FlushBufferLpt)	;543
OsSubLab(544, IN_FlushBufferC)	;544
OsSubLab(545, IN_CheckPointBsLpt)	;545
OsSubLab(546, IN_CheckpointBsAsyncC)	;546
OsSubLab(547, IN_ReleaseByteStreamLpt)	;547
OsSubLab(548, IN_ReleaseByteStreamC)	;548
OsSubLab(549, IN_SetImageModeLpt)	;549
OsSubLab(550, IN_SetImageModeC)	;550
OsSubLab(551, IN_CheckPointPhy)	;551
OsSubLab(552, IN_QueryPrtStatus)	;552
OsSubLab(553, IN_ReadByteStreamParameterLpt)	;553
OsSubLab(554, IN_WriteByteStreamParameterLpt)	;554
OsSubLab(555, IN_FlushbufferAsyncC)	;555
OsSubLab(556, IN_ReadByteStreamParameterC)	;556
OsSubLab(557, IN_WriteByteStreamParameterC)	;557
OsSubLab(558, IN_CheckForOperatorRestartC)	;558
OsSubLab(559, IN_DiscardOutputBsc)	;559
OsSubLab(560, IN_FillBufferAsyncC)	;560
OsSubLab(561, IN_DiscardinputBsc)	;561
OsSubLab(562, IN_ReadStatusc)	;562
OsSubLab(563, IN_AcquireByteStreamC)	;563
OsSubLab(564, IN_WriteStatusc)	;564
OsSubLab(565, IN_SendBreakC)	;565
OsSubLab(566, IN_CheckPointBsc)	;566
OsSubLab(567, IN_FillBufferLpt)	;567	 

) ELSE (
Flink	DB	0FFh
) FI

DATA	ENDS

IF ((CommFlag EQ 0FFh) AND (Flag8251 EQ 0)) THEN (
	StubOut(CheckPointBs_8251,4)
	StubOut(FillBuffer_8251,14)
	StubOut(FlushBuffer_8251,14)
	StubOut(OpenByteStreamPtr_8251,24)
	StubOut(OpenByteStream_8251,24)
	StubOut(ReadStatusC_8251,10)
	StubOut(ReleaseByteStream_8251,4)
	StubOut(WriteByteStreamParameterC_8251,8)
	StubOut(WriteStatusC_8251,8)
	StubOut(ResetTransmitQueueProc,4)
	StubOut(CheckForAutoRestartProc,8)
) FI

                END)

;M02 BEGIN 

*DEFINE (SamCFinal) (
    DATA SEGMENT PUBLIC 'DATA'

	*DEFINE (MakeTag(tagName)) (
		PUBLIC  tagName
		tagName DB NTag_tagName        ;NTag;
	)

	MakeTag(tagPtrWrite)
	MakeTag(tagCommRead)
	MakeTag(tagCommWrite)
	MakeTag(tagCommModify)
	MakeTag(tag8251Read)
	MakeTag(tag8251Write)
	MakeTag(tag8251Modify)
	MakeTag(tagPtr8251Write)

PUBLIC FLink
Flink	DB	0FFh
DATA	ENDS

END)
;M02 END 


