$TITLE('BasGen V061BM02 === 050189')

NAME BasGen

DATA            SEGMENT WORD PUBLIC 'DATA'
VERSION_MODULE  DB      '061B02'
DATA            ENDS

;******************************* MODULE HEADER ******************************;
;*                                                                          *;
;*                                                                          *;
;* MACHINE: B25 Series    LANGUAGE: ASSEMBLER           OS: BTOS            *;
;*                                                                          *;
;* DESCRIPTION:                                                             *;
;*                                                                          *;
;*                                                                          *;
;*                                                                          *;
;* HISTORY:                                                                 *;
;* 050189 061B02 S Hines West  Changed version to 6.1 from 6.0          *;
;* 030989 061A01 S Hines West  Included additional ISAM intefaces       *;
;* 012688 060I01 L Vaughn      Replaced CT 10.0 version                 *;
;* 010788 060H01 L Vaughn      Changed Basic Generation Message         *;
;*                                                                          *;
;* 121887 060G01 T Mole        Changed CTMAIL references to BMAIL     *;
;*                                                                          *;
;* 120787 060F01 T Mole        Deleted references to CT                *;
;*                                included changes for the Graphics people *;
;*                                                                          *;
;* 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) 1987 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 ***************************;

$save nogen

'
' File:    BasGen.asm                                                       
' Version: 6.1        for BTOS II1.0 or higher and Distrix 1.0             
' Revised: 072386                                                         
'                                                                           
'Copyright(c) 1980,1981,1982,1983,1984,1985,1986 by Convergent Technologies 
'                                                                           
'     This version of BasGen.asm can be used for both the BASIC Compiler    
'     and the BASIC Interpreter.                                            
'                                                                           
'     Also, this version of BasGen.asm can be used for operation under      
'     either a BTOSBTOS II environment OR under a DISTRIX environment.     
'                                                                           
'     Note that BasGen serves a different function depending on whether     
'     it is being used with the Interpreter or Compiler as follows:         
'                                                                           
' Function                                                                  
'                                                                           
'  Compiled BASIC                                                           
'                                                                           
'    In compiled BASIC, BasGen.asm only defines the procedural interface    
'    for nonBASIC procedures.  The configuration parameters                
'    (e.g. wMaxfiles and sSamBuffer) have no effect. To change these    
'    parameters you must edit BrCnfg.asm, (see the BASIC Compiler Manual    
'    for details).    To access a nonBASIC procedure, first                
'    assemble BasGen.asm to produce BasGen.obj.  Next, compile the          
'    BASIC program and enter BasGen.obj in the  [BasGen file] field of      
'    the Basic Compile command form.  See Section 6 of the BASIC           
'    Compiler Manual for more details.                                      
'                                                                           
'  Interpreted BASIC                                                        
'                                                                           
'    In interpreted BASIC, BasGen.asm defines the procedural interface      
'    of nonBASIC procedures and the required segment ordering of           
'    Basic.run.  BasGen.asm also defines the following configuration        
'    parameters:                                                            
'                                                                           
'      wMaxFiles   Declared in the CONST segment.  Use this variable to    
'      configure the default value for the number of files that a BASIC     
'      program can open concurrently.                                       
'                                                                           
'      wMaxRecLen   Declared in the CONST segment.  Use this variable to   
'      configure the default value for the maximum record size of a random  
'      file.                                                                
'                                                                           
'      sSamBuffer   Declared in the CONST segment.  Use this variable to   
'      configure the buffer size for SAM byte streams.                      
'                                                                           
'    See Section 6 of the Basic Manual for more details on using            
'    BasGen.asm to configure a new Basic.run.                               
'                                                                           
' Summary of Changes from version 5.2                                       
'                                                                           
'   The following procedural interfaces were added or expanded:             
'                                                                           
' 1. Procedural interfaces for BTOS Parameter Management are added.         
' 2.                                                                        
' 3. BTOS IPC Management is added.                                          
' 4. BTOS Exchange Management is added.                                     
' 5. BTOS Queue Management is added.                                        
' 6. BTOS Partition Management is added.                                    
' 7. BTOS Cluster Management is added.                                      
' 8. BTOS System Service Management is added.                               
' 9. BTOS Spooler Management is added.                                      
' 10. BTOS Configuration Management is added.                               
' 11. BTOS Interrupt Handlers Management is added.                          
' 12. BTOS Contingency Management is added.                                 
' 13. BTOS Process Management is added.                                     
' 14. BTOS Disk Management is added.                                        
' 15. Distrix System calls added.                                           
' 16. BTOS Calls described in Standard Software Engineering Update added.   
' 17. BTOS II Calls added.                                                  
' 18. BTOS Graphics, Mouse, VoiceData and Tape calls added.                
' 19. The grouping of calls has been changed and arranged alphabetically.   
' 20. Intelligence (skipping categories based on previous answers) added. 
'                                                                           
'                                                                           
' Assembling BasGen.asm:                                                    
'                                                                           
' Answering questions                                                       
'                                                                           
'  NonBASIC procedural interfaces are defined below.  When you assemble    
'  this module, the assemble asks questions such as:                        
'                                                                           
'                Are you using Forms (y or n)?                              
'                                                                           
'  If you type y (for yes) followed by RETURN, an entry is defined          
'  for each procedure in the corresponding software package (in             
'  this case, an entry is made for each procedure in the FORMS package).    
'                                                                           
'  The first questions asked pertain to the Operating System to be used:    
'                                                                           
'      Are you running on BTOS operating system     (y or n)?               
'      Are you using BTOS System Calls              (y or n)?               
'      Are you using BTOS II System Calls           (y or n)?               
'  Or:                                                                      
'      Are you running on DISTRIX operating system  (y or n)?               
'      Are you using DISTRIX System Calls           (y or n)?               
'                                                                           
'  When using BTOS, only the flag fBTOS will be set with a y answer.      
'  If using BTOS II, also, both the fBTOS and fBTOSII flags will be set     
'  and additional calls will be automatically added.                        
'                                                                           
'  When using DISTRIX, only the flag fDISTRIX will be set and questions     
'  pertaining to BTOS functions will be skipped.  Questions that pertain    
'  to both Operating Systems will be asked in either case.                  
'                                                                           
'                                                                           
'                                                                           
' Results from answering y to assemble questions:                         
'                                                                           
'  General                                                                  
'                                                                           
'    The end effect to answering y to one or more questions is to extend  
'    BASIC by creating a new set of Reserved Words within the BASIC         
'    language.  For example, normally a programmer could use a variable     
'    named OpenFile.  However, if you answered y to the question        
'                                                                           
'	 Are you using OpenFile or CloseFile (y or n)?                           
'                                                                           
'    then the words OpenFile and CloseFile are recognized by BASIC as   
'    external functions that require a list of parameters and return        
'    a value.                                                               
'                                                                           
'  Interpreter BASIC                                                        
'                                                                           
'    Answering y to a question will affect the size of the BASIC.run      
'    file and reduce the amount of program memory available to the user.    
'    This is a normal and expected result to creating a BASIC that has      
'    more functionality and power available to the programmer.  It should   
'    be noted, however, that answering y to many questions may result     
'    in a BASIC Interpreter with very little free memory left for programs. 
'    If this becomes a factor, you can comment out unneeded calls from     
'    any catagory, simply by putting a singlequote after the percent sign  
'    as follows:                                                            
                   'TableEntry(0,2,SETSTYLERAM)                             
'                                                                           
'  Compiler BASIC                                                           
'                                                                           
'    The size of a compiled BASIC program is not adversely affected by y  
'    answers during BasGen.  During compilation and linking only the BTOS   
'    calls used in the program will bring in external code.  For this       
'    reason it is advisable to assemble BasGen by answering y to a wide   
'    selection of questions.                                                
'                                                                           
'                                                                           
'  NOTE:                                                                    
'                                                                           
'    There are now approximately 550 BTOS Table Entries in BasGen.          
'    The Assembler can handle a MAXIMUM of ONLY 510 external symbols.       
'                                                                           
'    If YOU ANSWER YES TO EVERY QUESTION, THE ASSEMBLE WILL RESULT IN A   
'    LARGE NUMBER OF ERRORS CLAIMING:                                       
'                                                                           
'    *** Error 23 Limit of 255 EXTRN symbols per object module exceeded    
'                                                                           
'    FOR THIS REASON, BE SURE TO ANSWER NO TO ONE OR MORE CATEGORIES      
'    THAT YOU ARE UNLIKELY TO USE, OR COMMENT OUT UNNEEDED CALLS FROM      
'    ANY CATAGORY SIMPLY BY PUTTING A SINGLEQUOTE AFTER THE PERCENT SIGN   
'    AS FOLLOWS:                                                            
                   'TableEntry(0,2,SETSTYLERAM)                             
'                                                                           
'    (Note: although the error message says 255 extrn symbols,            
'    recent Assemblers, through Version 10.2, actually handle 510           
'    external symbols.)                                                     
'                                                                           
'                                                                           
' Adding New Entries                                                        
'                                                                           
'  If you are calling nonBASIC procedures that are not already defined in  
'  this module, (i.e., written by you in Assembler or Pascal) you must      
'  invoke the Editor or Word Processor and add a table entry for each       
'  new procedure.                                                           
'                                                                           
'  Use the macros                                                           
'                                                                           
'                TableEntry(procType,cbParams,procName) or                 
'                TableEntryRename(procType,cbParams,procName,procRename)   
'                                                                           
'  to define a table entry for each new procedure.                          
'                                                                           
'  TableEntry and TableEntryRename require these three parameters:        
'                                                                           
'             1. The procedure type, whose value is                         
'                                                                           
'                0 if the procedure does not return a value,                
'                1 if the procedure returns a word,                         
'                2 if the procedure returns a pointer (double word),        
'                3 if the procedure returns a byte.                         
'                                                                           
'             2. The number of bytes of parameters that are pushed on the   
'                stack when the procedure is invoked. CAUTION: Byte         
'                parameters are always pushed as words. For example, if a   
'                procedure takes a single byte parameter, the number of     
'                bytes pushed is 2.                                         
'                                                                           
'             3. The procedure name in UPPERCASE.                           
'                                                                           
'  TableEntryRename requires this additional parameter:                    
'                                                                           
'             4. A name in UPPERCASE.  This name renames the procedure.     
'                In a BASIC program, refer to the procedure with this name. 
'                                                                           
'  For example, the following macro invocation defines a procedure          
'  INITIALIZE which takes a pointer (4 bytes) as a parameter and returns    
'  a word.                                                                  
'                                                                           
'             TableEntry(1,4,INITIALIZE)                                   
'                                                                           
'  In the next example, the macro defines a procedure CHAIN that is renamed 
'  OSCHAIN.  CHAIN requires 18 bytes of parameters and returns a word.      
'                                                                           
'             TableEntryRename(1,18,CHAIN,OSCHAIN)                         
'                                                                           
'  Add all new entries immediately following the comment:                   
'                                                                           
'                     ADD NEW ENTRIES HERE                                  
'                                                                           
'  Note that some Unisys software products may contain                      
'  Macro Definition Files (xxxx.mdf) which are prewritten lists of the     
'  procedures used in that product arranged for each language.  An mdf can  
'  be added to the BasGen simply by adding a line similar to                
'                                                                           
'       $INCLUDE(BasGenDBMSEntries.Mdf)                                     
'                                                                           
'  to this BasGen.asm file, in the ADD NEW ENTRIES HERE area.             
'  Note: The character $ must be the first character on the line.         
'                                                                           
'                                                                           
'

$restore


;
;   Segment Ordering and Constant Declarations for the BASIC Interpreter     
;


public	rgForeignProc, sSamBuffer, wMaxFiles, wMaxRecLen
extrn	InitBasic:far

data	segment word public 'data'		; beginning of Dgroup
	rgForeignProc	LABEL	BYTE
data	ends

stack	segment stack 'stack'
stack	ends

const	segment word public 'const'

	sSamBuffer dw 1024	; size of a Sam buffer 
				;  use 512 for synchronous byte streams
				;  use 1024 for asynchronous byte streams

	wMaxFiles  dw 6		; default number of files that can be opened
				; at the same time

	wMaxRecLen dw 128	; default maximum record size of a random file

const	ends

heap	segment public 'heap'
heap	ends

memory	segment public 'memory'
memory	ends					; end of Dgroup

Basic	segment common 'Basic'
;		extrn @baslog:near
Basic	ends

code	segment word public 'code'
code	ends

BasicData segment public 'BasicData'            ; BASIC data segment
BasicData ends 

coed	segment word public 'coed'
coed	ends

MemArray  segment word public 'MemArray'
MemArray  ends					; Must come last

;
;                       End Segment Ordering Declarations                    
;

*define (TableEntry(type,cbParams,procName))(
extrn	procName:far
data	segment	word public 'data'
	DB	type
	DW	cbParams
	DD	procName
	DB	len(procName)
	DB	'procName'
data	ends)

*define (TableEntryRename(type,cbParams,procName,procRename))(
extrn	procName:far
data	segment	word public 'data'
	DB	type
	DW	cbParams
	DD	procName
	DB	len(procRename)
	DB	'procRename'
data	ends)

;
;                          ADD NEW ENTRIES HERE                              
;

'  some sample entries 

'	TableEntry(1,4,INITIALIZE)
'      TableEntryRename(1,18,CHAIN,OSCHAIN)
'      $INCLUDE(BasGenDBMSEntries.Mdf)  

;   add your entries below


;
;                           END OF NEW ENTRIES                               
;

; The flag fBTOS should be set for BTOS enviroment.
; The flag fDISTRIX should be set for DISTRIX enviroment.



IF(pass1 eq 1) then (
	out(
Basic Generation 6.1
	    )

	out(pf) ;This disables video's Pause between Pages


	set(fBTOS,0)
	set(fBTOSII,0)
	set(fDISTRIX,0)
	set(fDISTRIXsc,0)

;
;            Check which OS this BasGen is for, BTOS or DISTRIX              
;

WHILE ((fBTOS eq 0) AND (fDISTRIX eq 0))
     (
	out(
	Are you running on BTOS operating system    (y or n)? )
	define(bBTOS)(in)
	IF (eqs(substr(bBTOS,1,1),Y)) then (set(fBTOS,1)) FI
	IF (eqs(substr(bBTOS,1,1),y)) then (set(fBTOS,1)) FI

IF (fBTOS eq 0) then (
	out(
	Are you running on DISTRIX operating system (y or n)? )
	define(bDISTRIX)(in)
	IF (eqs(substr(bDISTRIX,1,1),Y)) then (set(fDISTRIX,1)) FI
	IF (eqs(substr(bDISTRIX,1,1),y)) then (set(fDISTRIX,1)) FI
)FI ;end of fBTOS flag NOT set        

IF ((fBTOS eq 0) AND (fDISTRIX eq 0)) THEN (
	out(
    YOU MUST ANSWER YES TO EITHER BTOS OR DISTRIX OPERATING SYSTEM.
	    )
)FI ;end of NO flag set

     ) ;end of WHILE loop


;
;      Inquire if System Calls will be used and set appropriate flag(s).     
;      (This permits the building of an expanded version of BASIC or the     
;      rebuilding of a plain vanilla version of BASIC.)                    
;

IF (fBTOS eq 1) then 
       (
	set(fBTOS,0)
	out(
	Are you using BTOS System Calls		(y or n)? )
	define(bBTOS)(in)
	IF (eqs(substr(bBTOS,1,1),Y)) then (set(fBTOS,1)) FI
	IF (eqs(substr(bBTOS,1,1),y)) then (set(fBTOS,1)) FI
       )
FI

IF (fBTOS eq 1) then 
       (
	out(
	Are you using BTOS II System Calls	(y or n)? )
	define(bBTOSII)(in)
	IF (eqs(substr(bBTOSII,1,1),Y)) then (set(fBTOSII,1)) FI
	IF (eqs(substr(bBTOSII,1,1),y)) then (set(fBTOSII,1)) FI
       )
FI

IF (fDISTRIX eq 1) then 
       (
	out(
	Are you using DISTRIX System Calls 	(y or n)? )
	define (bDISTsc)(in)
	IF (eqs(substr(bDISTsc,1,1),Y)) then (set(fDISTRIXsc,1)) FI
	IF (eqs(substr(bDISTsc,1,1),y)) then (set(fDISTRIXsc,1)) FI
       )
 FI


;
;      The next three questions are valid for both BTOS and DISTRIX.         
;

IF ((fDISTRIX eq 1) or (fBTOS eq 1)) then 
       (
	out(

Unisys Library and Server packages:
	    )

	out(
	Are you using the FORMS library 	(y or n)? )
	define(bFORMS)(in)
	set(fFORMS,0)
	IF (eqs(substr(bFORMS,1,1),Y)) then (set(fFORMS,1)) FI
	IF (eqs(substr(bFORMS,1,1),y)) then (set(fFORMS,1)) FI

	out(
	Are you using the ISAM library 		(y or n)? )
	define(bISAM)(in)
	set(fISAM,0)
	IF (eqs(substr(bISAM,1,1),Y)) then (set(fISAM,1)) FI
	IF (eqs(substr(bISAM,1,1),y)) then (set(fISAM,1)) FI

	out(
	Are you using the SORTMERGE library 	(y or n)? )
	define(bSM)(in)
	set(fSM,0)
	IF (eqs(substr(bSM,1,1),Y)) then (set(fSM,1)) FI
	IF (eqs(substr(bSM,1,1),y)) then (set(fSM,1)) FI

       )
 FI


;
;           The remaining questions are valid only for BTOS.                 
;

IF (fBTOS eq 1) then 
       (
	out(
	Are you using the CONTEXT MGR services	(y or n)? )
	define(bContext)(in)
	set(fContext,0)
	IF (eqs(substr(bContext,1,1),Y)) then (set(fContext,1)) FI
	IF (eqs(substr(bContext,1,1),y)) then (set(fContext,1)) FI

	out(
	Are you using the BMAIL services	(y or n)? )
	define(bMail)(in)
	set(fMail,0)
	IF (eqs(substr(bMail,1,1),Y)) then (set(fMail,1)) FI
	IF (eqs(substr(bMail,1,1),y)) then (set(fMail,1)) FI

	out(
	Are you using the Graphics Manager (y or n)? )
	define(bGRAPHMGR)(in)
	set(fGRAPHMGR,0)
	IF (eqs(substr(bGRAPHMGR,1,1),Y)) then (set(fGRAPHMGR,1)) FI
	IF (eqs(substr(bGRAPHMGR,1,1),y)) then (set(fGRAPHMGR,1)) FI

	out(
	Are you using the Graphics Library (y or n)? )
	define(bGRAPHLIB)(in)
	set(fGRAPHLIB,0)
	IF (eqs(substr(bGRAPHLIB,1,1),Y)) then (set(fGRAPHLIB,1)) FI
	IF (eqs(substr(bGRAPHLIB,1,1),y)) then (set(fGRAPHLIB,1)) FI
	IF (fGRAPHLIB eq 1) then (set(fGRAPHMGR,1)) FI

	out(
	Are you using the MODEM SERVER 		(y or n)? )
	define(bMODEM)(in)
	set(fMODEM,0)
	IF (eqs(substr(bMODEM,1,1),Y)) then (set(fMODEM,1)) FI
	IF (eqs(substr(bMODEM,1,1),y)) then (set(fMODEM,1)) FI

	out(
	Are you using the MOUSE SERVER 		(y or n)? )
	define(bMOUSE)(in)
	set(fMOUSE,0)
	IF (eqs(substr(bMOUSE,1,1),Y)) then (set(fMOUSE,1)) FI
	IF (eqs(substr(bMOUSE,1,1),y)) then (set(fMOUSE,1)) FI

	out(
	Are you using the VOICEDATA SERVICES 	(y or n)? )
	define(bVoiDa)(in)
	set(fVoiceData,0)
	IF (eqs(substr(bVoiDa,1,1),Y)) then (set(fVoiceData,1)) FI
	IF (eqs(substr(bVoiDa,1,1),y)) then (set(fVoiceData,1)) FI



	out(

BTOS Disk and File Management Calls:
            )

	out(
	Are you using FILE Management 		(y or n)? )
	define(bBTOSfm)(in)
	set(fFile,0)
	IF (eqs(substr(bBTOSfm,1,1),Y)) then (set(fFile,1)) FI
	IF (eqs(substr(bBTOSfm,1,1),y)) then (set(fFile,1)) FI

	out(
	Are you using DISK Management 		(y or n)? )
	define (bDisk)(in)
	set (fDisk,0)
	IF (eqs(substr(bDisk,1,1),Y)) then (set(fDisk,1)) FI
	IF (eqs(substr(bDisk,1,1),y)) then (set(fDisk,1)) FI

	out(
	Are you using SAM 			(y or n)? )
	define(bSAM)(in)
	set(fSAM,0)
	IF (eqs(substr(bSAM,1,1),Y)) then (set(fSAM,1)) FI
	IF (eqs(substr(bSAM,1,1),y)) then (set(fSAM,1)) FI

	out(
	Are you using RSAM		 	(y or n)? )
	define(bRSAM)(in)
	set(fRSAM,0)
	IF (eqs(substr(bRSAM,1,1),Y)) then (set(fRSAM,1)) FI
	IF (eqs(substr(bRSAM,1,1),y)) then (set(fRSAM,1)) FI

	out(
	Are you using DAM 			(y or n)? )
	define(bDAM)(in)
	set(fDAM,0)
	IF (eqs(substr(bDAM,1,1),Y)) then (set(fDAM,1)) FI
	IF (eqs(substr(bDAM,1,1),y)) then (set(fDAM,1)) FI


;
;   The following items all use OpenCloseFile, so set flag accordingly.     
;

IF (
     (fGRAPHLIB  eq 1) 
  OR (fGRAPHMGR  eq 1) 
  OR (fFORMS  eq 1) 
  OR (fISAM   eq 1) 
  OR (fSM     eq 1) 
  OR (fFile   eq 1) 
  OR (fDisk   eq 1)
  OR (fDAM    eq 1) 
  OR (fSAM    eq 1) 
  OR (fRSAM   eq 1) 
    )
 THEN (set(fBTOSoc,1))
 ELSE (set(fBTOSoc,0))
FI   

IF (fBTOSoc eq 1) 
  THEN (
	out(
	(BTOS OpenFileCloseFile already included.)
	     )
       )
  ELSE (
	out(
	Are you using BTOS OpenFileCloseFile 	(y or n)? )
	define(bBTOSoc)(in)
	IF (eqs(substr(bBTOSoc,1,1),Y)) then (set(fBTOSoc,1)) FI
	IF (eqs(substr(bBTOSoc,1,1),y)) then (set(fBTOSoc,1)) FI
       )
FI	;fBTOSoc flag set


	out(

Other Device Management Calls:
            )

	out(
	Are you using KEYBOARD Management 	(y or n)? )
	define(bBTOSkm)(in)
	set(fKbd,0)
	IF (eqs(substr(bBTOSkm,1,1),Y)) then (set(fKbd,1)) FI
	IF (eqs(substr(bBTOSkm,1,1),y)) then (set(fKbd,1)) FI

	out(
	Are you using TAPE Management 		(y or n)? )
	define(bTpM)(in)
	set(fTape,0)
	IF (eqs(substr(bTpM,1,1),Y)) then (set(fTape,1)) FI
	IF (eqs(substr(bTpM,1,1),y)) then (set(fTape,1)) FI

	out(
	Are you using TIMER Management 		(y or n)? )
	define(bBTOSttm)(in)
	set(fTimer,0)
	IF (eqs(substr(bBTOSttm,1,1),Y)) then (set(fTimer,1)) FI
	IF (eqs(substr(bBTOSttm,1,1),y)) then (set(fTimer,1)) FI

	out(
	Are you using VIDEO Management 		(y or n)? )
	define(bVID)(in)
	set(fVID,0)
	IF (eqs(substr(bVID,1,1),Y)) then (set(fVID,1)) FI
	IF (eqs(substr(bVID,1,1),y)) then (set(fVID,1)) FI



	out(

System Resource Management Calls:
            )

	out(
	Are you using CLUSTER Management 	(y or n)? )
	define(bBTOScm)(in)
	set(fCluster,0)
	IF (eqs(substr(bBTOScm,1,1),Y)) then (set(fCluster,1)) FI
	IF (eqs(substr(bBTOScm,1,1),y)) then (set(fCluster,1)) FI

	out(
	Are you using COMMUNICATIONS SAM 	(y or n)? )
	define(bSAMc)(in)
	set(fSAMc,0)
	IF (eqs(substr(bSAMc,1,1),Y)) then (set(fSAMc,1)) FI
	IF (eqs(substr(bSAMc,1,1),y)) then (set(fSAMc,1)) FI

	out(
	Are you using CONFIGURATION Management 	(y or n)? )
	define(bBTOSccm)(in)
	set(fConfig,0)
	IF (eqs(substr(bBTOSccm,1,1),Y)) then (set(fConfig,1)) FI
	IF (eqs(substr(bBTOSccm,1,1),y)) then (set(fConfig,1)) FI

	out(
	Are you using CONTINGENCY (Error) Mgt 	(y or n)? )
	define(bBTOSerrm)(in)
	set(fErr,0)
	IF (eqs(substr(bBTOSerrm,1,1),Y)) then (set(fErr,1)) FI
	IF (eqs(substr(bBTOSerrm,1,1),y)) then (set(fErr,1)) FI

	out(
	Are you using EXCHANGE Management 	(y or n)? )
	define(bBTOSem)(in)
	set(fExch,0)
	IF (eqs(substr(bBTOSem,1,1),Y)) then (set(fExch,1)) FI
	IF (eqs(substr(bBTOSem,1,1),y)) then (set(fExch,1)) FI

	out(
	Are you using INTERRUPT Handlers 	(y or n)? )
	define(bBTOSih)(in)
	set(fIntrupt,0)
	IF (eqs(substr(bBTOSih,1,1),Y)) then (set(fIntrupt,1)) FI
	IF (eqs(substr(bBTOSih,1,1),y)) then (set(fIntrupt,1)) FI

	out(
	Are you using IPC Management 		(y or n)? )
	define(bBTOSim)(in)
	set(fIPC,0)
	IF (eqs(substr(bBTOSim,1,1),Y)) then (set(fIPC,1)) FI
	IF (eqs(substr(bBTOSim,1,1),y)) then (set(fIPC,1)) FI

	out(
	Are you using MEMORY Management 	(y or n)? )
	define(bBTOSmm)(in)
	set(fMem,0)
	IF (eqs(substr(bBTOSmm,1,1),Y)) then (set(fMem,1)) FI
	IF (eqs(substr(bBTOSmm,1,1),y)) then (set(fMem,1)) FI

	out(
	Are you using PARAMETER Management 	(y or n)? )
	define(bBTOSpm)(in)
	set(fParam,0)
	IF (eqs(substr(bBTOSpm,1,1),Y)) then (set(fParam,1)) FI
	IF (eqs(substr(bBTOSpm,1,1),y)) then (set(fParam,1)) FI

	out(
	Are you using PARTITION and TASK Mgt 	(y or n)? )
	define(bBTOSppm)(in)
	set(fPartit,0)
	IF (eqs(substr(bBTOSppm,1,1),Y)) then (set(fPartit,1)) FI
	IF (eqs(substr(bBTOSppm,1,1),y)) then (set(fPartit,1)) FI

	out(
	Are you using PROCESS Management 	(y or n)? )
	define (bBTOSprm)(in)
	set (fProcess,0)
	IF (eqs(substr(bBTOSprm,1,1),Y)) then (set(fProcess,1)) FI
	IF (eqs(substr(bBTOSprm,1,1),y)) then (set(fProcess,1)) FI

	out(
	Are you using QUEUE Management 		(y or n)? )
	define(bBTOSqm)(in)
	set(fQueue,0)
	IF (eqs(substr(bBTOSqm,1,1),Y)) then (set(fQueue,1)) FI
	IF (eqs(substr(bBTOSqm,1,1),y)) then (set(fQueue,1)) FI

	out(
	Are you using SPOOLER Management 	(y or n)? )
	define(bBTOSsm)(in)
	set(fSpooler,0)
	IF (eqs(substr(bBTOSsm,1,1),Y)) then (set(fSpooler,1)) FI
	IF (eqs(substr(bBTOSsm,1,1),y)) then (set(fSpooler,1)) FI

	out(
	Are you using SYSTEM SERVICE Management (y or n)? )
	define(bBTOSssm)(in)
	set(fSysServ,0)
	IF (eqs(substr(bBTOSssm,1,1),Y)) then (set(fSysServ,1)) FI
	IF (eqs(substr(bBTOSssm,1,1),y)) then (set(fSysServ,1)) FI

	out(
	Are you using UTILITY Management 	(y or n)? )
	define(bUtility)(in)
	set(fUtility,0)
	IF (eqs(substr(bUtility,1,1),Y)) then (set(fUtility,1)) FI
	IF (eqs(substr(bUtility,1,1),y)) then (set(fUtility,1)) FI
       ) 
FI	; fBTOS flag set


	out(


Assembler Pass 1
... configuring BASIC with the following options:
	    )

	out(
        BASIC BuiltIn Functions)

) FI	;End of pass1 = 1


$title( BASIC BuiltIn Functions) eject

	TableEntry(1,6,DEFLPRINT)
	TableEntry(1,4,GETSA)
	TableEntry(1,4,GETRA)
	TableEntry(2,4,MAKEPOINTER)
	TableEntry(2,4,PWA)
	TableEntry(1,0,SYSERC)


IF ((fDISTRIX eq 1) or (fBTOS eq 1)) then 
(

if (fFORMS eq 1) then 
    (if (pass1 eq 1) then 
	(out(
	Forms Package)
	)fi
$title( Forms Package) eject
	TableEntry(1,14,OPENFORM)
	TableEntry(1,10,DISPLAYFORM)
	TableEntry(1,4,UNDISPLAYFORM)
	TableEntry(1,26,READFIELD)
	TableEntry(1,22,WRITEFIELD)
	TableEntry(1,12,DEFAULTFIELD)
	TableEntry(1,4,DEFAULTFORM)
	TableEntry(1,20,USERFILLFIELD)
	TableEntry(1,0,LOCKKBD)
	TableEntry(1,14,SETFIELDATTRS)
	TableEntry(1,18,GETFIELDINFO)
    ) fi

if (fISAM eq 1) then
    (if (pass1 eq 1) then
	(out(
	ISAM Package)
	)fi
$title( ISAM Package) eject
	TableEntry(1,6,CLOSEISAM)
	TableEntry(1,34,CREATEISAM)
	TableEntry(1,6,DELETEISAM)
	TableEntry(1,10,DELETEISAMRECORD)
	TableEntry(1,18,DELETEISAMRECORDBYKEY)
	TableEntry(1,4,ENDISAMTRANSACTION)
	TableEntry(1,18,GETISAMRECORDS)
	TableEntry(1,18,GETISAMRECORDSHOLD)
	TableEntry(1,10,HOLDISAMRECORD)
	TableEntry(1,28,LOADSINGLEUSERISAM)
	TableEntry(1,12,LOCKISAM)
	TableEntry(1,16,MODIFYISAMRECORD)
	TableEntry(1,18,MODIFYISAMRECORDBYKEY)
	TableEntry(1,24,OPENISAM)
	TableEntry(1,4,PURGEISAMTRANSACTION)
	TableEntry(1,16,READISAMRECORDBYURI)
	TableEntry(1,16,READISAMRECORDBYURIHOLD)
	TableEntry(1,16,READNEXTISAMRECORD)
	TableEntry(1,16,READNEXTISAMRECORDHOLD)
	TableEntry(1,24,READUNIQUEISAMRECORD)
	TableEntry(1,24,READUNIQUEISAMRECORDHOLD)
	TableEntry(1,10,RELEASEISAMRECORD)
	TableEntry(1,30,RENAMEISAM)
	TableEntry(1,18,SETISAMPROTECTION)
	TableEntry(1,14,SETUPISAMITERATION)
	TableEntry(1,22,SETUPISAMITERATIONLIMITS)
	TableEntry(1,14,SETUPISAMITERATIONKEY)
	TableEntry(1,14,SETUPISAMITERATIONPREFIX)
	TableEntry(1,24,SETUPISAMITERATIONRANGE)
	TableEntry(1,14,STARTISAMTRANSACTION)
	TableEntry(1,16,STOREISAMRECORD)
	TableEntry(1,4,UNLOCKISAM)
	TableEntry(1,8,HOLDISAMDATASET)
	TableEntry(1,4,ISAMREQUEST)
	TableEntry(1,4,NORMALIZEISAMSTATUS)
	TableEntry(1,6,RELEASEISAMDATASET)
	TableEntry(1,6,RELEASEISAMRECSFORUSER)
	TableEntry(1,10,VERIFYMULTIUSERISAM)
	TableEntry(1,4,BEGINTRANSACTION)
	TableEntry(1,4,COMMITTRANSACTION)
	TableEntry(1,14,QUERYTRANSACTIONPARAMS)
	TableEntry(1,4,ROLLBACKTRANSACTION)
	TableEntry(1,10,SETTRANSACTIONPARAMS)
    ) fi

if (fSM eq 1) then
    (if (pass1 eq 1) then
	(out(
	SortMerge Package)
	)fi
$title( SortMerge Package) eject
	TableEntry(1,20,RELEASERECORDANDKEY)
	TableEntry(1,4,DOSORT)
	TableEntry(1,20,RETURNRECORDANDKEY)
	TableEntry(1,4,CONCLUDESORT)
	TableEntry(1,4,TERMINATESORT)
	TableEntry(1,52,BASICPREPARESORT)
	TableEntry(1,12,RELEASERECORD)
	TableEntry(1,12,RETURNRECORD)
	TableEntry(1,54,BASICPREPAREKEYSORT)
    ) fi

)
FI

IF (fBTOS eq 1) then 
(

if (fContext eq 1) then
    (if (pass1 eq 1) then
	(out(
	BTOS Context Manager Services)
	)fi
$title( BTOS Context Manager) eject
	TableEntry(1,8,CMCURRENTVERSION)
	TableEntry(1,10,CMQUERYCONFIGFILE)
	TableEntry(1,4,CMQUERYCONTEXTHANDLE)
	TableEntry(1,4,CMQUERYERC)
	TableEntry(1,6,CMQUERYPARENT)
	TableEntry(1,4,CMSETPARENT)
	TableEntry(1,18,CMSTARTAPPL)
	TableEntry(1,18,CMSTARTAPPLBYBLOCK)
	TableEntry(1,18,CMSTARTAPPLBYNAME)
	TableEntry(1,2,CMSWITCHCONTEXT)
	TableEntry(1,2,CMSWITCHTOEXISTINGCONTEXT)
	TableEntry(1,2,CMTERMINATECONTEXT)
	TableEntry(1,6,CMTRANSLATECHTOPH)
	TableEntry(1,6,CMTRANSLATEPHTOCH)
	TableEntry(1,8,NOTIFYCM)
	TableEntry(1,10,ICMSCHECK)
	TableEntry(1,8,ICMSCURRENTVERSION)
	TableEntry(1,2,ICMSFLUSH)
	TableEntry(1,8,ICMSSEND)
	TableEntry(1,10,ICMSWAIT)
    ) fi

if (fMail eq 1) then
    (if (pass1 eq 1) then
	(out(
	BMail Services)
	)fi
$title( BMail Services) eject
	TableEntry(1,10,ACKNOWLEDGEMAILRECEIPT)
	TableEntry(1,8,CHECKPOINTMSG)
	TableEntry(1,14,CONNECTNEXTMAILCENTER)
	TableEntry(1,4,DETACHMSG)
	TableEntry(1,4,ENCLOSEMSG)
	TableEntry(1,22,ESTABLISHMAILCONNECTION)
	TableEntry(1,4,FENCLOSEDMSG)
	TableEntry(1,10,GETCMSGELEMENTSFORID)
	TableEntry(1,22,GETMSGCOMPONENTBYID)
	TableEntry(1,24,INITMAILMSGBUFFER)
	TableEntry(1,14,INITVM)
	TableEntry(1,30,OPENMAILCONNECTION)
	TableEntry(1,16,PUTMSGCOMPONENT)
	TableEntry(1,8,QUERYMAIL)
	TableEntry(1,16,QUERYMAILSTATUS)
	TableEntry(1,16,RECEIVEMAIL)
	TableEntry(1,4,RELEASEMSG)
	TableEntry(1,20,SENDMAIL)
	TableEntry(1,2,TERMINATEMAILCONNECTION)
	TableEntry(1,22,VALIDATEMAIL)
    ) fi

if (fGRAPHMGR eq 1) then
    (if (pass1 eq 1) then
	(out(
	BTOS Graphics Package)
	)fi
$title( BTOS Graphics Manager) eject
	TableEntry(1,0,CLEARSCREEN)
	TableEntry(1,8,CLEARPIXELSCREENRECTANGLE)
	TableEntry(1,8,CLEARSCREENRECTANGLE)			; BTOS only
	TableEntry(1,8,CLEARVIRTUALRECTANGLE)			; BTOS II only
	TableEntry(1,16,DORASTEROP)
	TableEntry(1,12,DORASTEROPTEXT)
	TableEntry(1,8,DRAWPIXELSCREENLINE)
	TableEntry(1,14,DRAWSCREENARC)					; BTOS only
	TableEntry(1,6,DRAWSCREENBUFFER)				; BTOS only
	TableEntry(1,8,DRAWSCREENLINE)					; BTOS only
	TableEntry(1,8,DRAWVIRTUALLINE)				; BTOS II only
	TableEntry(1,18,FILLPIXELSCREENPOLYGON)		; BTOS II only
	TableEntry(1,10,FILLPIXELSCREENRECTANGLE)
	TableEntry(1,10,FILLSCREENRECTANGLE)			; BTOS only
	TableEntry(1,18,FILLVIRTUALPOLYGON)			; BTOS II only
	TableEntry(1,10,FILLVIRTUALRECTANGLE)			; BTOS II only
	TableEntry(1,4,GETDRAWATTRINFO)
	TableEntry(1,4,GETRASTERINFO)
	TableEntry(1,8,GETVDIVIEWPORT)
	TableEntry(1,8,GETVIRTUALPIXELS)				; BTOS II only
	TableEntry(1,0,GFX_CURSORSOFF)					; BTOS II only
	TableEntry(1,0,GFX_CURSORSON)					; BTOS II only
	TableEntry(1,0,INITADDITIONALGRAPHICSSCREEN)	; BTOS only
	TableEntry(1,0,INITSCREENGRAPHICS)
	TableEntry(1,6,LOADCOLOR)
	TableEntry(1,6,LOADCOLORMAPPER)
	TableEntry(1,4,LOADSOFTPATTERN)
	TableEntry(1,4,MAPGRAPHICSWINDOW)
	TableEntry(1,4,QUERYLASTRASTERTEXT)			; BTOS only
	TableEntry(1,8,READPIXELCOLOR)					; BTOS only
	TableEntry(1,0,RETURNGRAPHICSSCREEN)			; BTOS only
	TableEntry(1,2,SETCOLORMAPPER)
	TableEntry(1,2,SETCOMMANDSCREEN)
	TableEntry(1,2,SETDRAWDESTINATIONPLANE)
	TableEntry(1,2,SETMONOORCOLORDRQWMODE)
	TableEntry(1,10,SETRASTERCLIPPING)				; BTOS only
	TableEntry(1,6,SETRASTERDESTINATION)
	TableEntry(1,2,SETRASTERDESTINATIONPLANE)
	TableEntry(1,6,SETRASTERFONT)
	TableEntry(1,6,SETRASTERPATTERN)
	TableEntry(1,6,SETRASTERSOURCE)
	TableEntry(1,2,SETRASTERSOURCEPLANE)
	TableEntry(1,2,SETRASTERTEXTMODE)				; BTOS only
	TableEntry(1,2,SETSCREENCOLOR)
	TableEntry(1,2,SETSCREENDRAWINGMODE)
	TableEntry(1,2,SETSCREENLINETYPE)
	TableEntry(1,2,SETVISIBLESCREEN)
	TableEntry(1,0,TURNOFFGRAPHICS)
	TableEntry(1,0,TURNOFFGRAPHICSCOLOR)
	TableEntry(1,0,TURNONGRAPHICS)
	TableEntry(1,0,TURNONGRAPHICSCOLOR)


if (fGRAPHLIB eq 1) then (
$title( BTOS Graphics Library) eject
	TableEntry(1,30,ADDLABEL)
	TableEntry(1,22,ADDOBJECT)
	TableEntry(1,8,ADDPICTURE)
	TableEntry(1,0,CLEARLABELS)
	TableEntry(1,0,CLEARVECTORS)
	TableEntry(1,0,CLEARVIEWPORT)
	TableEntry(1,0,CLOSEOBJECT)
	TableEntry(1,2,CLOSEPICTURE)
	TableEntry(1,0,CLOSETEMPOBJECT)
	TableEntry(1,0,DELETECURRENTLABEL)
	TableEntry(1,0,DISPLAYCURRENTOBJECT)
	TableEntry(1,2,DISPLAYPICTURE)
	TableEntry(1,8,DRAW)
	TableEntry(1,20,DRAWARC)
	TableEntry(1,12,DRAWCIRCLE)
	TableEntry(1,16,DRAWLINE)
	TableEntry(1,8,DRAWRELATIVE)
	TableEntry(1,18,FILLRECTANGLE)
	TableEntry(1,6,GETCURRENTLABEL)
	TableEntry(1,4,GETCURSORPOSITION)
	TableEntry(1,10,GETFONTNAME)
	TableEntry(1,10,GETFONTNUMBER)
	TableEntry(1,4,GETLABELDATA)
	TableEntry(1,4,GETNUMBEROFFONTS)
	TableEntry(1,4,GETNUMBEROFOBJECTS)
	TableEntry(1,4,GETPICTURECOLORS)
	TableEntry(1,4,GETTRANSFORMATIONDATA)
	TableEntry(1,10,GETUSERFONTNAME)
	TableEntry(1,4,GETWINDOWDATA)
	TableEntry(1,0,INITGRAPHICS)
	TableEntry(1,2,LOADPAPER)
	TableEntry(1,4,MODIFYLABEL)
	TableEntry(1,8,MOVE)
	TableEntry(1,8,MOVERELATIVE)
	TableEntry(1,20,OPENPICTURE)
	TableEntry(1,16,OPENTEMPOBJECT)
	TableEntry(1,0,READINTERRUPTKEY)
	TableEntry(1,0,REMOVECURRENTOBJECT)
	TableEntry(1,4,SETCHARACTERSIZE)
	TableEntry(1,2,SETCOLOR)
	TableEntry(1,4,SETCURRENTPALETTE)
	TableEntry(1,2,SETDRAWINGMODE)
	TableEntry(1,6,SETFIRSTLABEL)
	TableEntry(1,0,SETFIRSTOBJECT)
	TableEntry(1,6,SETFONT)
	TableEntry(1,2,SETLABELORIGIN)
	TableEntry(1,16,SETLIMITS)
	TableEntry(1,2,SETLINETYPE)
	TableEntry(1,10,SETNDCCURSORPOSITION)
	TableEntry(1,6,SETNEXTLABEL)
	TableEntry(1,0,SETNEXTOBJECT)
	TableEntry(1,10,SETOBJECTCURSORPOSITION)
	TableEntry(1,2,SETOUTPUTDEVICE)
	TableEntry(1,2,SETOUTPUTTYPE)
	TableEntry(1,8,SETPEN)    
	TableEntry(1,6,SETPLOTTERDEVICE)
	TableEntry(1,2,SETPLOTTERMATERIAL)
	TableEntry(1,8,SETSCALE)
	TableEntry(1,8,SETSCALERELATIVE)
	TableEntry(1,8,SETTRANSLATE)
	TableEntry(1,8,SETTRANSLATERELATIVE)
	TableEntry(1,16,SETUSERCOORDINATES)
	TableEntry(1,6,SETUSERFONT)
	TableEntry(1,4,SETUPGRAPHICSSPOOLING)    
	TableEntry(1,16,SETVIEWPORT)
	TableEntry(1,16,SETWINDOW)
	TableEntry(1,10,SETWORLDCURSORPOSITION)
	TableEntry(1,0,TURNOFFCURSOR)
	TableEntry(1,0,TURNONCURSOR)
	TableEntry(1,6,WRITEPICTURE)
	TableEntry(1,6,WRITETEXTSTRING)
    ) fi
) fi

if (fMODEM eq 1) then
    (if (pass1 eq 1) then
	(out(
	BTOS Modem Services)
	)fi
$title( BTOS Modem Services) eject
	TableEntry(1,10,ACCEPTMODEMCALL)
	TableEntry(1,12,ADDMODEMLINE)
	TableEntry(1,2,CLOSEMODEMLINE)
	TableEntry(1,2,DISCONNECTMODEMCALL)
	TableEntry(1,28,EDITLINE)
	TableEntry(1,8,INITIATEMODEMCALL)
	TableEntry(1,22,OPENMODEMLINE)
	TableEntry(1,14,QUERYMODEMSERVERSTATUS)
	TableEntry(1,28,READINPUTLINE)
	TableEntry(1,12,READMODEMBYTES)
	TableEntry(1,6,RELEASEMODEMLINE)
	TableEntry(1,10,SETLINEPARAMETER)
	TableEntry(1,12,WRITEMODEMBYTES)
    ) fi

if (fMOUSE eq 1) then
    (if (pass1 eq 1) then
	(out(
	BTOS Mouse Services)
	)fi
$title( BTOS Mouse Services) eject
	TableEntry(1,6,GETIBUSDEVINFO)
	TableEntry(1,8,PDGETCURSORPOS)
	TableEntry(1,8,PDGETCURSORPOSNSC)
	TableEntry(1,8,PDLOADCURSOR)
	TableEntry(1,10,PDREADCURRENTCURSOR)
	TableEntry(1,18,PDREADICONFILE)
	TableEntry(1,6,PDSETCONTROLS)
	TableEntry(1,2,PDSETCURSORDISPLAY)
	TableEntry(1,4,PDSETCURSORPOS)
	TableEntry(1,4,PDSETCURSORPOSNSC)
	TableEntry(1,2,PDSETCURSORTYPE)
	TableEntry(1,8,PDSETMOTIONRECTANGLE)
	TableEntry(1,8,PDSETMOTIONRECTANGLENSC)
	TableEntry(1,6,PDSETSYSTEMCONTROLS)
	TableEntry(1,2,PDSETTRACKING)
	TableEntry(1,8,PDSETVIRTUALCOORDINATES)
	TableEntry(1,12,PDTRANSLATENSCTOVC)
	TableEntry(1,12,PDTRANSLATEVCTONSC)
	TableEntry(1,8,READINPUTEVENT)
	TableEntry(1,8,READINPUTEVENTNSC)
    ) fi

if (fVoiceData eq 1) then
    (if (pass1 eq 1) then
	(out(
	BTOS Voice  Data Services)
	)fi
$title( BTOS Voice Data) eject
	TableEntry(1,8,TSCONNECT)
	TableEntry(1,8,TSDATACHANGEPARAMS)
	TableEntry(1,4,TSDATACHECKPOINT)
	TableEntry(1,4,TSDATACLOSELINE)
	TableEntry(1,26,TSDATAOPENLINE)
	TableEntry(1,16,TSDATAREAD)
	TableEntry(1,8,TSDATARETREIVEPARAMS)
	TableEntry(1,6,TSDATAUNACCEPTCALL)
	TableEntry(1,14,TSDATAWRITE)
	TableEntry(1,8,TSDEINSTALL)
	TableEntry(1,16,TSDIAL)
	TableEntry(1,4,TSDOFUNCTION)
	TableEntry(1,10,TSGETSTATUS)
	TableEntry(1,4,TSHOLD)
	TableEntry(1,8,TSOFFHOOK)
	TableEntry(1,4,TSONHOOK)
	TableEntry(1,18,TSQUERYCONFIGPARAMS)
	TableEntry(1,18,TSREADTOUCHTONE)
	TableEntry(1,4,TSRING)
	TableEntry(1,8,TSSETCONFIGPARAMS)
	TableEntry(1,8,TSVOICECONNECT)
	TableEntry(1,26,TSVOICEPLAYBACKFROMFILE)
	TableEntry(1,26,TSVOICERECORDTOFILE)
	TableEntry(1,2,TSVOICESTOP)
    ) fi


if (fFile eq 1) then
    (if (pass1 eq 1) then
	(out(
	BTOS File Management)
	)fi
$title( BTOS File Management)  eject
	TableEntry(1,6,CHANGEFILELENGTH)
	TableEntry(1,10,CHANGEOPENMODE)
	TableEntry(1,8,CHECKREADASYNC)
	TableEntry(1,8,CHECKWRITEASYNC)
	TableEntry(1,0,CLEARPATH)
	TableEntry(1,0,CLOSEALLFILES)
	TableEntry(1,0,CLOSEALLFILESLL)
	TableEntry(1,22,CREATEDIR)
	TableEntry(1,16,CREATEFILE)
	TableEntry(1,12,DELETEDIR)
	TableEntry(1,2,DELETEFILE)
	TableEntry(1,20,GETDIRSTATUS)
	TableEntry(1,6,GETFHLONGEVITY)
	TableEntry(1,10,GETFILESTATUS)
	TableEntry(1,16,GETSTAMFILEHEADER)
	TableEntry(1,6,GETUCB)
	TableEntry(1,4,GETUSERNUMBER)
	TableEntry(1,8,GETUSERSTATUS)
	TableEntry(1,18,OPENFILELL)
	TableEntry(1,4,QUERYWSNUM)
	TableEntry(1,0,QUIETIO)
	TableEntry(1,18,READASYNC)
	TableEntry(1,16,READFILE)
	TableEntry(1,18,READDIRSECTOR)
	TableEntry(1,14,RENAMEFILE)
	TableEntry(1,6,SETNODE)
	TableEntry(1,20,SETDIRSTATUS)
	TableEntry(1,4,SETFHLONGEVITY)
	TableEntry(1,10,SETFILESTATUS)
	TableEntry(1,18,SETPATH)
	TableEntry(1,6,SETPREFIX)
	TableEntry(1,12,WILDCARDINIT)
	TableEntry(2,12,WILDCARDMATCH)
	TableEntry(1,8,WILDCARDNEXT)
	TableEntry(1,16,WRITEFILE)
	TableEntry(1,18,WRITEASYNC)
  ) fi

if (fBTOSoc eq 1) then
    (if (pass1 eq 1) then
	(out(
	BTOS OpenFileCloseFile)
	)fi
$title( BTOS OpenFileCloseFile)  eject
	TableEntry(1,2,CLOSEFILE)
	TableEntry(1,18,OPENFILE)
    ) fi


if (fDisk eq 1) then
    (if (pass1 eq 1) then
	(out(
	BTOS Disk Management)
	)fi
$title( BTOS Disk Management)  eject
	TableEntry(1,12,DISMOUNTVOLUME)
	TableEntry(1,16,FORMAT)
	TableEntry(1,12,GETVHB)
	TableEntry(1,12,MOUNTVOLUME)
	TableEntry(1,12,QUERYDCB)
	TableEntry(1,14,SETDEVPARAMS)
) fi

if (fDAM eq 1) then
    (if (pass1 eq 1) then
	(out(
	BTOS Direct Access Method)
	)fi
$title( BTOS Direct Access Method)  eject
	TableEntry(1,4,CLOSEDAFILE)
	TableEntry(1,8,DELETEDARECORD)
	TableEntry(1,26,OPENDAFILE)
	TableEntry(1,8,QUERYDALASTRECORD)
	TableEntry(1,12,QUERYDARECORDSTATUS)
	TableEntry(1,16,READDAFRAGMENT)
	TableEntry(1,12,READDARECORD)
	TableEntry(1,6,SETDABUFFERMODE)
	TableEntry(1,8,TRUNCATEDAFILE)
	TableEntry(1,12,WRITEDARECORD)
	TableEntry(1,16,WRITEDAFRAGMENT)
    ) fi

if (fSAM eq 1) then
    (if (pass1 eq 1) then
	(out(
	BTOS Sequential Access Method)
	)fi
$title( BTOS Sequential Access Method) eject
	TableEntry(1,4,CHECKPOINTBS)
	TableEntry(1,4,CLOSEBYTESTREAM)
	TableEntry(1,8,GETBSLFA)
	TableEntry(1,24,OPENBYTESTREAM)
	TableEntry(1,6,PUTBACKBYTE)
	TableEntry(1,8,QUERYVIDBS)
	TableEntry(1,14,READBSRECORD)
	TableEntry(1,8,READBYTE)
	TableEntry(1,14,READBYTES)
	TableEntry(1,4,RELEASEBYTESTREAM)
	TableEntry(1,8,SETBSLFA)
	TableEntry(1,6,SETIMAGEMODE)
	TableEntry(1,14,WRITEBSRECORD)
	TableEntry(1,6,WRITEBYTE)
    ) fi

if (fSAMc eq 1) then
    (if (pass1 eq 1) then
	(out(
	BTOS Comm Sequential Access Method)
	)fi
$title( BTOS Comm Sequential Access Method) eject
	TableEntry(1,32,ACQUIREBYTESTREAMC)
	TableEntry(1,8,CHECKFOROPERATORRESTARTC)
	TableEntry(1,14,CHECKPOINTBSASYNCC)
	TableEntry(1,6,CHECKPOINTBSC)
	TableEntry(1,8,DISCARDINPUTBSC)
	TableEntry(1,4,DISCARDOUTPUTBSC)
	TableEntry(1,24,FILLBUFFERASYNCC)
	TableEntry(1,14,FILLBUFFERC)
	TableEntry(1,24,FLUSHBUFFERASYNCC)
	TableEntry(1,14,FLUSHBUFFERC)
	TableEntry(1,24,OPENBYTESTREAMC)
	TableEntry(1,10,READBYTESTREAMPARAMETERC)
	TableEntry(1,10,READSTATUSC)
	TableEntry(1,4,RELEASEBYTESTREAMC)
	TableEntry(1,4,SENDBREAKC)
	TableEntry(1,6,SETIMAGEMODEC)
	TableEntry(1,8,WRITEBYTESTREAMPARAMETERC)
	TableEntry(1,8,WRITESTATUSC)
    ) fi

if (fRSAM eq 1) then
    (if (pass1 eq 1) then
	(out(
	BTOS Record Sequential Access Method)
	)fi
$title( BTOS Record Sequential Access Method) eject
	TableEntry(1,4,CHECKPOINTRSFILE)
	TableEntry(1,4,CLOSERSFILE)
	TableEntry(1,8,GETRSLFA)
	TableEntry(1,24,OPENRSFILE)
	TableEntry(1,14,READRSRECORD)
	TableEntry(1,4,RELEASERSFILE)
	TableEntry(1,16,SCANTOGOODRSRECORD)
	TableEntry(1,10,WRITERSRECORD)
    ) fi

if (fKbd eq 1) then
    (if (pass1 eq 1) then
	(out(
	BTOS Keyboard Management)
	)fi
$title( BTOS Keyboard Management)  eject
	TableEntry(1,2,ASSIGNKBD)
	TableEntry(1,0,BEEP)
	TableEntry(1,0,CHECKPOINTSYSIN)
	TableEntry(1,2,DISABLEACTIONFINISH)
	TableEntry(1,4,QUERYKBDLEDS)
	TableEntry(1,4,QUERYKBDSTATE)
	TableEntry(1,4,READACTIONCODE)
	TableEntry(1,6,READACTIONKBD)
	TableEntry(1,4,READKBD)
	TableEntry(1,6,READKBDDIRECT)
	TableEntry(1,4,SETKBDLED)
	TableEntry(1,2,SETKBDUNENCODEDMODE)
	TableEntry(1,4,SETSYSINMODE)
  ) fi

if (fTape eq 1) then
    (if (pass1 eq 1) then
	(out(
	BTOS Tape Management )
	)fi
$title( BTOS Tape Management ) eject
	TableEntry(1,2,CLOSETAPE)
	TableEntry(1,18,OPENTAPE)
	TableEntry(1,18,READTAPERECORDS)
	TableEntry(1,8,TAPEOPERATION)
	TableEntry(1,6,TAPESTATUS)
	TableEntry(1,18,WRITETAPERECORDS)
    ) fi

if (fTimer eq 1) then
    (if (pass1 eq 1) then
	(out(
	BTOS Timer Management)
	)fi
$title( BTOS Timer Management)  eject
	TableEntry(1,4,CLOSERTCLOCK)
	TableEntry(1,8,COMPACTDATETIME)
	TableEntry(1,2,DELAY)
	TableEntry(1,8,EXPANDDATETIME)
	TableEntry(1,8,FORMATTIME)
	TableEntry(1,8,FORMATTIMEDT)
	TableEntry(1,8,FORMATTIMETM)
	TableEntry(1,4,GETDATETIME)
	TableEntry(1,4,OPENRTCLOCK)
	TableEntry(1,8,PARSETIME)
	TableEntry(1,4,RESETTIMERINT)
	TableEntry(1,4,SETDATETIME)
	TableEntry(1,4,SETTIMERINT)
    ) fi

if (fVID eq 1) then
    (if (pass1 eq 1) then
	(out(
	BTOS Video Calls )
	)fi
$title( BTOS Video Calls )  eject
	TableEntry(1,2,ASSIGNVIDOWNER)
	TableEntry(1,6,INITCHARMAP)
	TableEntry(1,20,INITVIDFRAME)
	TableEntry(1,4,LOADCOLORSTYLERAM)
	TableEntry(1,6,LOADCURSORRAM)
	TableEntry(1,8,LOADFONTRAM)
	TableEntry(1,6,LOADSTYLERAM)
	TableEntry(0,0,LOCKVIDEO)
	TableEntry(0,0,LOCKVIDEOFORMODIFY)
	TableEntry(0,1,NPRINT)
	TableEntry(0,10,OUTPUTQUAD)
	TableEntry(0,8,OUTPUTWORD)
	TableEntry(1,6,POSFRAMECURSOR)
	TableEntry(1,24,PROGRAMCOLORMAPPER)
	TableEntry(0,2,PUTBYTE)
	TableEntry(0,6,PUTCHAR)
	TableEntry(1,10,PUTFRAMEATTRS)
	TableEntry(1,12,PUTFRAMECHARS)
	TableEntry(0,6,PUTPOINTER)
	TableEntry(0,6,PUTQUAD)
	TableEntry(0,4,PUTWORD)
	TableEntry(1,10,QUERYFRAMECHAR)
	TableEntry(1,6,QUERYVIDHDW)
	TableEntry(1,2,RESETFRAME)
	TableEntry(1,12,RESETVIDEO)
	TableEntry(0,6,SBPRINT)
	TableEntry(1,10,SCROLLFRAME)
	TableEntry(1,2,SETALPHACOLORDEFAULT)
	TableEntry(1,4,SETSCREENVIDATTR)
	TableEntry(0,2,SETSTYLERAM)
	TableEntry(0,4,SETSTYLERAMENTRY)
	TableEntry(1,2,SETVIDEOTIMEOUT)
	TableEntry(0,0,UNLOCKVIDEO)
	TableEntry(0,0,UNLOCKVIDEOFORMODIFY)
	TableEntry(0,1,ZPRINT)

  if (fBTOSII eq 1) then
      (if (pass1 eq 1) then
	  (out(
	BTOS II Video Calls )
	  )fi
$title( BTOS II Video Calls )  eject
	TableEntry(1,18,MOVEFRAMERECTANGLE)
	TableEntry(1,18,PUTFRAMECHARSANDATTRS)
	TableEntry(1,10,QUERYFRAMEBOUNDS)
	TableEntry(1,18,QUERYFRAMECHARSANDATTRS)
	TableEntry(1,10,QUERYFRAMECURSOR)
      ) fi
    ) fi

if (fCluster eq 1) then
    (if (pass1 eq 1) then
	(out(
	BTOS Cluster Management)
	)fi
$title( BTOS Cluster Management)  eject
	TableEntry(1,4,DISABLECLUSTER)
	TableEntry(1,8,GETCLUSTERSTATUS)
	TableEntry(1,8,GETWSUSERNAME)
	TableEntry(1,6,SETWSUSERNAME)
    ) fi

if (fConfig eq 1) then
    (if (pass1 eq 1) then
	(out(
	BTOS Configuration Management)
	)fi
$title( BTOS Configuration Management)  eject
	TableEntry(1,8,CURRENTOSVERSION)
	TableEntry(1,8,GETMODULEID)
	TableEntry(1,16,MAPXBUSWINDOW)
	TableEntry(1,4,LOCKXBIS)
	TableEntry(1,4,OSVERSION)
	TableEntry(1,2,RESETXBUSMISR)
	TableEntry(1,10,SETXBUSMISR)
	TableEntry(1,2,SWAPXBUSEAR) 
	TableEntry(1,10,QUERYMODULEPOSITION)
	TableEntry(1,0,UNLOCKXBIS)
    ) fi

if (fErr eq 1) then
    (if (pass1 eq 1) then
	(out(
	BTOS Contingency (Error) Management)
	)fi
$title( BTOS Err Management)  eject
	TableEntry(0,2,CHECKERC)
	TableEntry(0,2,CRASH)
	TableEntry(0,8,ERROREXITSTRING)
	TableEntry(0,2,ERROREXIT)
	TableEntry(0,0,EXIT)
	TableEntry(0,2,FATALERROR)
	TableEntry(1,6,WRITELOG)
) fi


if (fExch eq 1) then
    (if (pass1 eq 1) then
	(out(
	BTOS Exchange Management)
	)fi
$title( BTOS Exchange Management)  eject
	TableEntry(1,4,ALLOCEXCH)
	TableEntry(1,2,DEALLOCEXCH)
	TableEntry(1,4,QUERYDEFAULTRESPEXCH)
    ) fi

if (fIntrupt eq 1) then
    (if (pass1 eq 1) then
	(out(
	BTOS Interrupt Handlers)
	)fi
$title( BTOS Interrupt Handlers)  eject
	TableEntry(1,4,LOCKIN)
	TableEntry(1,4,LOCKOUT)
	TableEntry(1,2,MEDIATEINTHANDLER)
	TableEntry(1,2,RESETCOMMISR)
	TableEntry(1,22,SETCOMMISR)
	TableEntry(1,12,SETINTHANDLER)
	TableEntry(1,6,SETLPISR)
	TableEntry(1,6,SETTRAPHANDLER)
    ) fi

if (fIPC eq 1) then
    (if (pass1 eq 1) then
	(out(
	BTOS IPC Management)
	)fi
$title( BTOS IPC Management)  eject
	TableEntry(1,6,CHECK)
	TableEntry(1,6,PSEND)
	TableEntry(1,4,REQUEST)
	TableEntry(1,4,RESPOND)
	TableEntry(1,6,SEND)
	TableEntryRename(1,6,WAIT,OSWAIT)
    ) fi

if (fMem eq 1) then
    (if (pass1 eq 1) then
	(out(
	BTOS Memory Management)
	)fi
$title( BTOS Memory Management)  eject
	TableEntry(1,8,ALLOCALLMEMORYSL)
	TableEntry(1,6,ALLOCMEMORYLL)
	TableEntry(1,6,ALLOCMEMORYSL)
	TableEntry(1,6,DEALLOCMEMORYLL)
	TableEntry(1,6,DEALLOCMEMORYSL)
	TableEntry(1,0,RESETMEMORYLL)
	TableEntry(1,4,QUERYMEMAVAIL)

  if (fBTOSII eq 1) then
      (if (pass1 eq 1) then
	  (out(
	BTOS II Memory Management )
	  )fi
$title( BTOS II Memory Management )  eject
	TableEntry(1,6,ALLOCAREASL)
	TableEntry(1,2,DEACTIVATERUNFILE)
	TableEntry(1,10,EXPANDAREALL)
	TableEntry(1,10,EXPANDAREASL)
	TableEntry(0,0,FREELARGELL)
	TableEntry(1,4,QUERYBIGMEMAVAIL)
	TableEntry(0,0,RESETALLSEGS)
	TableEntry(1,6,SHRINKAREALL)
	TableEntry(1,6,SHRINKAREASL)
      ) fi
    ) fi

if (fParam eq 1) then
    (if (pass1 eq 1) then
	(out(
	BTOS Parameter Management)
	)fi
$title( BTOS Parameter Management)  eject
	TableEntry(1,0,CPARAMS)
	TableEntry(1,2,CSUBPARAMS)
	TableEntry(1,8,RGPARAM)
	TableEntry(1,8,RGPARAMINIT)
	TableEntry(1,4,RGPARAMSETELTNEXT)
	TableEntry(1,2,RGPARAMSETLISTSTART)
	TableEntry(1,6,RGPARAMSETSIMPLE)
    ) fi

if (fPartit eq 1 ) then
    (if (pass1 eq 1) then
	(out(
	BTOS Partition and Task Management)
	)fi
$title( BTOS Partition Management)  eject
	TableEntry(1,14,CREATEPARTITION)
	TableEntry(1,6,GETPARTITIONEXCHANGE)
	TableEntry(1,10,GETPARTITIONHANDLE)
	TableEntry(1,10,GETPARTITIONSTATUS)
	TableEntry(1,18,LOADINTERACTIVETASK)
	TableEntry(1,16,LOADPRIMARYTASK)
	TableEntry(1,6,LOADTASK)
	TableEntryRename(1,18,CHAIN,OSCHAIN)
	TableEntry(1,16,QUERYEXITRUNFILE)
	TableEntry(1,2,REMOVEPARTITION)
	TableEntry(1,14,SETEXITRUNFILE)
	TableEntry(1,2,SETPARTITIONEXCHANGE)
	TableEntry(1,2,SETPARTITIONLOCK)
	TableEntry(1,8,SETPARTITIONNAME)
	TableEntry(1,2,SETSWAPDISABLE)
	TableEntry(1,2,TERMINATEPARTITIONTASKS)
	TableEntry(1,2,VACATEPARTITION)

  if (fBTOSII eq 1) then
      (if (pass1 eq 1) then
	  (out(
	BTOS II Partition and Task Management)
	  )fi
$title( BTOS II Partition Management)  eject
	TableEntry(1,14,CREATEUSER)
	TableEntry(0,0,EXECFH)
	TableEntry(1,4,FORK)
	TableEntry(1,6,LOADFILE)
	TableEntry(1,2,SWAPINCONTEXT)
	TableEntry(1,12,WRITESWAP)
      ) fi
    ) fi

if (fProcess eq 1) then
    (if (pass1 eq 1) then
	(out(
	BTOS Process Management)
	)fi
$title( BTOS Process Management)  eject
	TableEntry(1,2,CHANGEPRIORITY)
	TableEntry(1,4,CREATEPROCESS)
	TableEntry(1,4,QUERYPROCESSNUMBER)
	TableEntry(1,6,REQUESTDIRECT)
	TableEntry(1,4,SETDELTAPRIORITY)
    ) fi

if (fQueue eq 1) then
    (if (pass1 eq 1) then
	(out(
	BTOS Queue Management)
	)fi
$title( BTOS Queue Management)  eject
	TableEntry(1,24,ADDQUEUEENTRY)
	TableEntry(1,10,ESTABLISHQUEUESERVER)
	TableEntry(1,34,MARKKEYEDQUEUEENTRY)
	TableEntry(1,20,MARKNEXTQUEUEENTRY)
	TableEntry(1,34,READKEYEDQUEUEENTRY)
	TableEntry(1,22,READNEXTQUEUEENTRY)
	TableEntry(1,22,REMOVEKEYEDQUEUEENTRY)
	TableEntry(1,10,REMOVEMARKEDQUEUEENTRY)
	TableEntry(1,16,REWRITEMARKEDQUEUEENTRY)
	TableEntry(1,6,TERMINATEQUEUESERVER)
	TableEntry(1,10,UNMARKQUEUEENTRY)
    ) fi

if (fSpooler eq 1) then
    (if (pass1 eq 1) then
	(out(
	BTOS Spooler Management)
	)fi
$title( BTOS Spooler Management)  eject
	TableEntry(1,22,CONFIGURESPOOLER)
	TableEntry(1,12,SPOOLERPASSWORD)
    ) fi

if (fSysServ eq 1) then
    (if (pass1 eq 1) then
	(out(
	BTOS System Service Management)
	)fi
$title( BTOS System Service Management)  eject
	TableEntry(1,0,CONVERTTOSYS)
	TableEntry(1,4,SERVERQ)
	TableEntry(1,8,QUERYREQUESTINFO)
    ) fi

if (fUtility eq 1) then
    (if (pass1 eq 1) then
	(out(
	BTOS Utility Management)
	)fi
$title( BTOS Utility Management)  eject
	TableEntry(1,4,GETPASCB)
	TableEntry(1,8,GETPSTRUCTURE)
	TableEntry(1,24,LOOKUPFIELD)
	TableEntry(1,18,LOOKUPNUMBER)
	TableEntry(1,0,LOOKUPRESET)
	TableEntry(1,24,LOOKUPSTRING)
	TableEntry(1,20,READTONEXTFIELD)
	TableEntry(1,8,STRINGSEQUAL)
	TableEntry(1,6,TEXTEDIT)
	TableEntry(1,10,ULCMPB)
    ) fi
) fi


if (fDISTRIX eq 1) then (
    if (fDISTRIXsc eq 1) then
      (if (pass1 eq 1) then
	  (out(
	DISTRIX System calls)
	  )fi
$title( DISTRIX System calls)  eject
	TableEntry(1,6,ACCESS)
	TableEntry(1,2,ALARM)
	TableEntry(1,4,BRK)
	TableEntry(1,4,CHDIR)
	TableEntry(1,6,CHMOD)
	TableEntry(1,8,CHOWN)
	TableEntry(1,4,CHROOT)
	TableEntryRename(1,2,PLM_CLOSE,OSCLOSE)
	TableEntry(1,6,CREAT)
	TableEntry(0,2,EXIT)
	TableEntry(1,6,FCNTL)
	TableEntry(1,0,FORK)
	TableEntry(1,0,GETPID)
	TableEntry(1,0,GETUID)
	TableEntry(1,4,KILL)
	TableEntry(1,8,LINK)
	TableEntry(2,8,LSEEK)
	TableEntry(1,8,MKNOD)
	TableEntryRename(1,10,PLM_MOUNT,MOUNT)
	TableEntry(1,8,MSGCTL)
	TableEntry(1,2,NICE)
	TableEntryRename(1,6,DX_OPEN2,OPEN2)
	TableEntryRename(1,8,DX_OPEN3,OPEN3)
	TableEntry(0,0,PAUSE)
	TableEntry(1,4,PIPE)
	TableEntry(1,2,PLOCK)
	TableEntryRename(1,8,DX_PLM_READ,DXREAD)
	TableEntry(1,8,SEMCTL)
	TableEntry(1,8,SEMOP)
	TableEntry(1,0,SETPGRP)
	TableEntry(1,2,SETUID)
	TableEntry(1,8,SHMCTL)
	TableEntry(1,6,SHMGET)
	TableEntry(1,8,SHMAT)
	TableEntry(1,4,SHMDT)
	TableEntry(1,6,SIGNAL)
	TableEntry(1,6,STAT)
	TableEntry(1,4,STIME)
	TableEntry(1,0,SYNC)
	TableEntry(1,4,TIME)
	TableEntry(1,4,TIMES)
	TableEntry(1,6,ULIMIT)
	TableEntry(1,2,UMASK)
	TableEntry(1,4,UMOUNT)
	TableEntry(1,4,UNAME)
	TableEntry(1,4,UNLINK)
	TableEntry(1,6,USTAT)
	TableEntry(1,8,UTIME)
	TableEntryRename(1,4,WAIT,DXWAIT)
	TableEntryRename(1,8,DX_PLM_WRITE,DXWRITE)

    ) fi
) fi

    if (pass1 eq 1) then
	  (out(

Assembler Pass 2    Please stand by ... )
	  )
    fi


	out(pn) ;This reenables video's Pause between Pages

; SENTINEL

data	segment word public 'data'
	DB	255
	even
set(enddata,this byte  rgforeignproc + 6)
data	ends

if (pass1 eq 0) then (
	out (

	For BASIC Interpreter usage,data size is enddata bytes.

)
) fi
END
