;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;                                                               ;
;      MODUL NAME :  BIS-80/3270  USER CONFIGURATION MODULE     ;
;                                                               ;
;        COMPUTER :  PHILIPS  P3500                             ;
;        TERMINAL :  PHILIPS  P2711                             ;
;                                                               ;
;     PREPARED BY :  FRANK VAN DE RIDDER                        ;
;                 :  PHILIPS DATA SYSTEMS                       ;
;                 :  POSTBUS 245                                ;
;                 :  7300 AE  APELDOORN                         ;
;                                                               ;
;            DATE :  29.09.82                                   ;
;          UPDATE :  08.03.83                                   ;
;                                                               ;
;                                                               ;
;       THIS MODULE CONTAINS ALL USER CONFIGURABLE PARAMETERS   ;
;       WITHIN BISYNC80/3270. THE PARAMETERS THAT MAY BE        ;
;       CHANGED INCLUDE:                                        ;
;                - COMMUNICATION LINE REQUIREMENTS              ;
;                - DEVICE MODE (3271/3277 OR 3275)              ;
;                - MICROCOMPUTER SYNCHRONOUS I/O PORT TYPE      ;
;                     AND ADDRESSES                             ;
;                - MICROCOMPUTER CPU CLOCK SPEED                ;
;                - MICROCOMPUTER CONSOLE SPEED                  ;
;                - MICROCOMPUTER LIST (PRINTER) DEVICE DRIVER   ;
;                - MICROCOMPUTER CONSOLE TERMINAL OPERATIONAL   ;
;                     CODES AND ADDRESSING SEQUENCES            ;
;                - 3270 TO MICROCOMPUTER KEYBOARD EQUIVALENTS   ;
;                - 3270 ADDRESSING (POLLING) CHARACTERS         ;
;                - 3270 TO MICROCOMPUTER KEYBOARD DEFINITION    ;
;                                                               ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;                                                               ;
;       ** MICRO-INTEGRATION, INC. PROPRIETARY INFORMATION **   ;
;                                                               ;
;       THIS PROGRAM IS SUPPLIED UNDER THE TERMS OF A LICENSE   ;
;       AGREEMENT WITH MICRO-INTEGRATION, INC. AND MAY NOT BE   ;
;       COPIED OR DISCLOSED EXCEPT IN ACCORDANCE WITH THAT      ;
;       AGREEMENT.                                              ;
;                                                               ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;
;               THE FOLLOWING EQUATE STATEMENTS ARE PROVIDED
;               TO ALLOW CONVENIENT CONFIGURATION.  THEY
;               MUST NOT BE CHANGED:
;
;
;       INTERNAL USE EQUATES:
;
;
TRUE    EQU     01H             ;TRUE EQUATE
FALSE   EQU     00H             ;FALSE EQUATE
CPM     EQU     00005H          ;CP/M CALL ADDRESS
POLLED  EQU     02H             ;POLLED COMMUNICATION LINE EQUATE
SWITCH  EQU     03H             ;SWITCHED COMMUNICATION LINE EQUATE
M3271   EQU     02H             ;3271 MODE EQUATE
M3274	EQU	02H		;3274 MODE EQUATE
M3275   EQU     03H             ;3275 MODE EQUATE
M3276	EQU	02H		;3276 MODE EQUATE
IN8251  EQU     02H             ;INTEL 8251 EQUATE
IN8274	EQU	03H		;INTEL 8274 EQUATE
Z80SIO  EQU     03H             ;ZILOG Z80-SIO EQUATE
ROWCOL  EQU     00H             ;ROW/COLUMN CURSOR ADDRESSING
ABSPOS  EQU     01H             ;ABSOLUTE CURSOR POSITIONING
COLROW	EQU	02H		;COLUMN/ROW CURSOR ADDRESSING
MLTKY1  EQU     8CH             ;MULTIPLE KEY SEQUENCE IDENTIFIER 1
MLTKY2  EQU     8DH             ;MULTIPLE KEY SEQUENCE IDENTIFIER 2
MLTKY3  EQU     8EH             ;MULTIPLE KEY SEQUENCE IDENTIFIER 3
MLTKY4  EQU     8FH             ;MULTIPLE KEY SEQUENCE IDENTIFIER 4
;
;
;    -  3270 KEYBOARD KEY EQUATES  -
;
;       USE THESE NAMES TO DEFINE 3270 KEYS IN KBTAB:
 
 
ENTER   EQU     0FDH            ;ENTER KEY
CLEAR   EQU     0EDH            ;CLEAR KEY
RESET   EQU     080H            ;RESET KEY
PF1     EQU     0F1H            ;PF1 KEY
PF2     EQU     0F2H            ;PF2 KEY
PF3     EQU     0F3H            ;PF3 KEY
PF4     EQU     0F4H            ;PF4 KEY
PF5     EQU     0F5H            ;PF5 KEY
PF6     EQU     0F6H            ;PF6 KEY
PF7     EQU     0F7H            ;PF7 KEY
PF8     EQU     0F8H            ;PF8 KEY
PF9     EQU     0F9H            ;PF9 KEY
PF10    EQU     0FAH            ;PF10 KEY
PF11    EQU     0FBH            ;PF11 KEY
PF12    EQU     0FCH            ;PF12 KEY
PA1     EQU     0ECH            ;PA1 KEY
PA2     EQU     0EEH            ;PA2 (CANCEL) KEY
PA3     EQU     0EBH            ;PA3 KEY
FWSPAC  EQU     081H            ;RIGHT (FORWARD SPACE) KEY
BKSPAC  EQU     082H            ;LEFT (BACK SPACE) KEY
UPLINE  EQU     083H            ;UP KEY
DNLINE  EQU     084H            ;DOWN KEY
FWTAB   EQU     085H            ;FORWARD TAB KEY
BKTAB   EQU     086H            ;BACK TAB KEY
NXLINE  EQU     087H            ;NEXT LINE KEY
ERAEOF  EQU     088H            ;ERASE END OF FIELD KEY
ERAINP  EQU     089H            ;ERASE INPUT KEY
FMARK   EQU     08AH            ;FIELD MARK KEY
DUP     EQU     08BH            ;DUP KEY
HOME    EQU     090H            ;HOME KEY
PRINT   EQU     091H            ;LOCAL PRINT KEY
RUBOUT  EQU     092H            ;RUB-OUT KEY
INSERT  EQU     093H            ;INSERT MODE KEY
TSTREQ	EQU	094H		;TEST REQUEST KEY
;
;       -  CONTROL KEY EQUATES  -
;
;          USE THESE EQUATES WHEN DEFINING A CONTROL/KEY
;
CTLAT   EQU     00H             ;CONTROL/@ (NUL)
CTLA    EQU     01H             ;CONTROL/A (SOH)
CTLB    EQU     02H             ;CONTROL/B (STX)
CTLC    EQU     03H             ;CONTROL/C (ETX)
CTLD    EQU     04H             ;CONTROL/D (EOT)
CTLE    EQU     05H             ;CONTROL/E (ENQ)
CTLF    EQU     06H             ;CONTROL/F (ACK)
CTLG    EQU     07H             ;CONTROL/G (BEL)
CTLH    EQU     08H             ;CONTROL/H (BS)
CTLI    EQU     09H             ;CONTROL/I (HT - TAB)
CTLJ    EQU     0AH             ;CONTROL/J (LF)
CTLK    EQU     0BH             ;CONTROL/K (VT)
CTLL    EQU     0CH             ;CONTROL/L (FF)
CTLM    EQU     0DH             ;CONTROL/M (CR - RETURN)
CTLN    EQU     0EH             ;CONTROL/N (SO)
CTLO    EQU     0FH             ;CONTROL/O (SI)
CTLP    EQU     10H             ;CONTROL/P (DLE)
CTLQ    EQU     11H             ;CONTROL/Q (DC1)
CTLR    EQU     12H             ;CONTROL/R (DC2)
CTLS    EQU     13H             ;CONTROL/S (DC3)
CTLT    EQU     14H             ;CONTROL/T (DC4)
CTLU    EQU     15H             ;CONTROL/U (NAK)
CTLV    EQU     16H             ;CONTROL/V (SYN)
CTLW    EQU     17H             ;CONTROL/W (ETB)
CTLX    EQU     18H             ;CONTROL/X (CAN)
CTLY    EQU     19H             ;CONTROL/Y (EM)
CTLZ    EQU     1AH             ;CONTROL/Z (SUB)
CTLLBK  EQU     1BH             ;CONTROL/[ (ESC)
CTLBSL  EQU     1CH             ;CONTROL/\ (FS)
CTLRBK  EQU     1DH             ;CONTROL/] (GS)
CTLUPA  EQU     1EH             ;CONTROL/^ (RS)
CTLUNS  EQU     1FH             ;CONTROL/_ (US)
;
;
;
;       -  OTHER CONVENIENT EQUATES  -
;
;
CR      EQU     0DH             ;CR OR RETURN KEY
LF      EQU     0AH             ;LINE FEED KEY
ESC     EQU     1BH             ;ESCAPE KEY
;
;
;
;
;
;       THE FOLLOWING STATEMENTS MUST NOT BE MODIFIED.
;       NO CODE MAY BE INSERTED BEFORE THESE STATEMENTS.
;
BASEAD  EQU     0100H           ;BASE ADDRESS FOR THIS MODULE
        ORG     BASEAD          ;ORG TO MODULE START ADDRESS
        JMP     USDTIN          ;USART DATA INPUT
        JMP     USDTOT          ;USART DATA OUTPUT
        JMP     USSTIN          ;USART STATUS INPUT
        JMP     USSTOT          ;USART STATUS OUTPUT
        JMP     TMCTOT          ;TIMER CONTROL OUTPUT
        JMP     TMDTIN          ;TIMER DATA INPUT
        JMP     TMDTOT          ;TIMER DATA OUTPUT
        JMP     SELDAT          ;SELECT DATA MODE
        JMP     SELCMD          ;SELECT CONTROL MODE
        JMP     RTMODE          ;RETURN DEVICE MODE
        JMP     RTCPUS          ;RETURN CPU CLOCK SPEED
        JMP     RTCONS          ;RETURN CONSOLE SPEED
        JMP     LSTDRV          ;CALL LIST DEVICE ROUTINE
        JMP     RTXLAT          ;RETURN TRANSLATE TABLE ADDRESS
        JMP     CKCMOT          ;BAUD RATE CLOCK COMMAND OUTPUT
        JMP     CKDTOT          ;BAUD RATE CLOCK DATA OUTPUT
        DW      BDRTVL          ;BAUD RATE CLOCK SET VALUE
        DW      CLRSCR          ;CLEAR SCREEN CODE ADDRESS
        DW      HILITE          ;HIGHLIGHT FIELD CODE
        DW      LOLITE          ;NORMAL FIELD CODE
        DW      ROWCON          ;ROW CONSTANT ADDRESS
        DW      COLCON          ;COLUMN CONSTANT ADDRESS
        DW      ROWTAB          ;ROW TABLE ADDRESS
        DW      COLTAB          ;COLUMN TABLE ADDRESS
        DW      ENDROW          ;END OF ROW CONSTANT ADDRESS
        DW      ENDCOL          ;END OF COLUMN TABLE ADDRESS
        DW      KBTAB           ;KEYBOARD TABLE ADDRESS
        DW      MLTTB1          ;MULTIPLE SEQUENCE TABLE 1 ADDRESS
        DW      MLTTB2          ;MULTIPLE SEQUENCE TABLE 2 ADDRESS
        DW      MLTTB3          ;MULTIPLE SEQUENCE TABLE 3 ADDRESS
        DW      MLTTB4          ;MULTIPLE SEQUENCE TABLE 4 ADDRESS
        DW      CUADDR          ;CONTROL UNIT ADDRESS VALUE
        DW      DVADDR          ;DEVICE ADDRESS VALUE
        DW      TERMID          ;TERMID VALUE ADDRESS
        DW      STRTSC          ;START SCROLLING SEQUENCE
        DW      STOPSC          ;STOP SCROLLING SEQUENCE
        JMP     RTIO            ;RETURN I/O DEVICE
        JMP     GETTIM          ;RETURN TIME-OUT VALUE
        JMP     RTRTSA          ;ASSERT RTS
        JMP     RETNL           ;RETURN AUTO-NEWLINE STATUS
        JMP     CONDRV          ;USER SUPPLIED CONSOLE INPUT ROUTINE
        JMP     CNSTAT          ;USER SUPPLIED CONSOLE STATUS ROUTINE
        JMP     MAINLN          ;USER SUPPLIED EXIT
        JMP     SCROUT          ;USER SUPPLIED EXIT
        JMP     SCRNIN          ;USER SUPPLIED EXIT
        JMP     SETSCR          ;PARAMETER
        JMP     SETAID          ;PARAMETER
        JMP     SETDSP          ;PARAMETER
        JMP     SETSTA          ;PARAMETER
        JMP     SETCUR          ;PARAMETER
        DW      VIDRAM          ;VIDEO MEMORY MAP INDICATOR
        DW      VIDADR          ;ADDRESS OF VIDEO MEMORY
        JMP     RTCMLN          ;RETURN COMMUNICATION LINE EQUATE
        JMP     RTPRN           ;RETURN PRINTER START-UP VALUE
	DW	ADRMOD		;CURSOR ADDRESSING TYPE
        JMP     FSTEXT          ;
        JMP     EXTEXT          ;
        JMP     INEXT           ;
        JMP     OUTEXT          ;
        JMP     INTEXT          ;
        JMP     RTSEXT          ;
        JMP     RSTEXT          ;
        JMP     XMTEXT          ;
        JMP     RCVEXT          ;
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;                                                                ;
;                 USER CONFIGURABLE PARAMETER SECTION            ;
;                                                                ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;
;
;       THE FOLLOWING EQUATE STATEMENTS MAY BE USER CHANGED
;       TO RECONFIGURE THE EMULATOR'S DISTRIBUTION DISKETTE
;       SUPPLIED PARAMETERS FOR --
;               -       POLLED OR SWITCHED COMMUNICATION LINE
;               -       3271/3277, 3274/3278, 3276 OR 3275 DEVICE MODE
;               -       8251 USART, 8274 MPSC, OR Z80-SIO SERIAL
;                            CHANNEL USE
;               -       8251, 8274, OR Z80-SIO PORT ADDRESSES
;               -       CPU CLOCK SPEED
;               -       TERMINAL BAUD RATE
;               -       SELF CLOCKING I/O PORT BAUD RATE
;
;
;
;								;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;                                                               ;
;                                                               ;
;                COMMUNICATION LINE EQUATE SECTION              ;
;                                                               ;
;                ** THIS VALUE MUST BE SUPPLIED **              ;
;                                                               ;
;                                                               ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
COMLNE  EQU     POLLED          ;CHANGE THIS STATEMENT TO 'SWITCH' IF
;                               ;THE EMULATOR IS TO OPERATE IN A SWITCHED
;                               ;(DIAL-UP) ENVIRONMENT.  LEAVE THIS STATEMENT
;                               ;SET TO 'POLLED' IF THE EMULATOR IS TO
;                               ;OPERATE IN A POLLED (POINT-TO-POINT)
;                               ;ENVIRONMENT.
;                               ;
;                               ;            ** NOTE **
;                               ;
;                               ;IF THIS VALUE IS SET TO 'SWITCH' AN
;                               ;IBM 3275 WILL BE EMULATED.  IF THIS VALUE
;                               ;IS SET TO 'POLLED', AN IBM 3271 OR 3275 WILL
;                               ;BE EMULATED, DEPENDING ON THE VALUE THAT
;                               ;IS SPECIFIED FOR THE 'DEVICE' EQUATE.
;
;
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;                                                               ;
;                                                               ;
;                  EMULATOR DEVICE EQUATE SECTION               ;
;                                                               ;
;       ** THIS VALUE MUST BE SUPPLIED, ONLY IF 'COMLNE' **     ;
;       **             IS SET TO 'POLLED'                **     ;
;                                                               ;
;                                                               ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
DEVICE  EQU     M3271           ;CHANGE THIS STATEMENT TO 'M3271'
;                               ;TO ENABLE BISYNC-80/3270 TO EMULATE
;                               ;AN IBM 3271/3277 DEVICE.
;                               ;CHANGE THIS STATEMENT TO 'M3274'
;                               ;TO ENABLE BISYNC-80/3270 TO EMULATE
;                               ;AN IBM 3274/3278 DEVICE.
;                               ;CHANGE THIS STATEMENT TO 'M3276'
;                               ;TO ENABLE BISYNC-80/3270 TO EMULATE
;                               ;AN IBM 3276 DEVICE.
;                               ;LEAVE THIS STATEMENT SET TO 'M3275'
;                               ;TO ENABLE BISYNC-80/3270 TO EMULATE
;                               ;AN IBM 3275 DEVICE
;
;
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;                                                                   ;
;                                                                   ;
;                TERMINAL ADDRESSING CONFIGURATION                  ;
;                                                                   ;
;   ** THESE VALUES MUST BE SUPPLIED IF 'COMLNE' EQUALS 'POLLED' ** ;
;                                                                   ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;
;
;        THE FOLLOWING DEFINE THE 3270 ADDRESSES
;        THAT ARE TO BE RECOGNIZED BY THE EMULATOR.
;        TWO ADDRESSES MUST BE DEFINED --
;
;        CONTROL UNIT ADDRESS - CUADDR
;        DEVICE ADDRESS   -     DVADDR
;
;        SINCE THE EMULATOR WILL NOT RESPOND TO A SPECIFIC POLL UNLESS
;        BOTH ADDRESSES MATCH, MULTIPLE EMULATORS MAY SHARE
;        THE SAME LINE AND THE SAME CONTROL UNIT ADDRESS, SO LONG AS
;        SPECIFIC POLLING IS USED AND DIFFERENT DEVICE ADDRESSES ARE
;        USED. IF GENERAL POLLING IS USED, DEVICE ADDRESS MUST BE
;        SPECIFIED AS ZERO.
;
;
CUADDR  EQU     0               ;CHANGE THIS STATEMENT TO REFLECT THE
;                               ;3270 CONTROL UNIT ADDRESS TO BE
;                               ;RECOGNIZED BY THE EMULATOR (0-31).
;
;
DVADDR  EQU     0               ;CHANGE THIS STATEMENT TO REFLECT THE
;                               ;327X DEVICE ADDRESS TO BE RECOGNIZED BY
;                               ;THE EMULATOR (0-31).  LEAVE THIS STATEMENT
;                               ;SET TO 0 IF A 3275 IS BEING EMULATED,
;                               ;I.E. DEVICE EQU M3275.
;
;
;
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;                                                                   ;
;                                                                   ;
;                      TERMINAL ID CONFIGURATION                    ;
;                                                                   ;
;  ** THESE VALUES MUST BE SUPPLIED IF 'COMLNE' EQUALS 'SWITCH' **  ;
;                                                                   ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;
;       THE FOLLOWING DEFINES THE 3275 TERMID TO BE USED IN
;       3275 SWITCHED MODE (COMLNE EQU SWITCH).  IF THE EMULATOR
;       IS OPERATING ON A SWITCHED LINE, USING CONTENTION,
;       ENTER THE THREE CHARACTER 3275 TERMID TO BE USED.
;
;
;
TERMID  EQU     $
        DB      0C6H,0C4H,0D9H
;
;
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;                                                               ;
;                                                               ;
;                INPUT/OUTPUT DEVICE EQUATE SECTION             ;
;                                                               ;
;              ** THIS THIS VALUE MUST BE SUPPLIED **           ;
;                                                               ;
;                                                               ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
IODEV   EQU     Z80SIO          ;CHANGE THIS STATEMENT TO 'IN8274'
;                               ;TO CHANGE THE EMULATOR COMMUNICATIONS
;                               ;DEVICE TO AN INTEL 8274 USART.
;                               ;CHANGE THIS STATEMENT TO 'Z80SIO'
;                               ;TO USE A ZILOG Z80-SIO USART.
;				;LEAVE THIS STATEMENT SET TO
;				;'IN8251' IF AN INTEL 8251 USART
;				;IS BEING USED.
;
;
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;                                                               ;
;                                                               ;
;            INPUT/OUTPUT DEVICE INPUT EQUATE SECTION           ;
;                                                               ;
;                ** THIS VALUE MUST BE SUPPLIED **              ;
;                                                               ;
;                                                               ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
USDATA  EQU     00H             ;CHANGE THIS STATEMENT TO REFLECT
;                               ;THE 8251 USART, 8274 MPSC, OR
;				;Z80-SIO DATA PORT ADDRESS IF THE
;				;ADDRESS IS NOT 58H (88 DECIMAL).
;
;                      =>=>=>=> ;Z80-SIO DATA-PORT A FOR DC = 00
;                      =>=>=>=> ;TERMINAL IS CONNECTED TO CHAN A
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;                                                               ;
;                                                               ;
;            INPUT/OUTPUT DEVICE STATUS EQUATE SECTION          ;
;                                                               ;
;                ** THIS VALUE MUST BE SUPPLIED **              ;
;                                                               ;
;                                                               ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
USSTAT  EQU     02H             ;CHANGE THIS STATEMENT TO REFLECT
;                               ;THE 8251 USART, 8274 MPSC, OR
;				;Z80-SIO USART STATUS PORT ADDRESS
;				;IF THE ADDRESS IS NOT 59H
;                               ;(89 DECIMAL).
;
;                      =>=>=>=> ;Z80-SIO STATUS-PORT A FOR DC = 02
;                      =>=>=>=> ;TERMINAL IS CONNECTED TO CHAN A
;
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;                                                               ;
;                                                               ;
;                 CPU CLOCK SPEED EQUATE SECTION                ;
;                                                               ;
;                ** THIS VALUE MUST BE SUPPLIED **              ;
;                                                               ;
;                                                               ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
CPUSPD  EQU     02H             ;CHANGE THIS STATEMENT TO REFLECT THE
;                               ;MICROCOMPUTER CPU CLOCK SPEED IN
;                               ;MHZ IF THE CLOCK IS NOT A 4MHZ CLOCK.
;                               ;IF THE CPU CLOCK SPEED IS NOT AN
;                               ;EVEN NUMBER, ROUND DOWN TO THE NEXT
;                               ;LOWER NUMBER.  LEAVE THIS STATEMENT
;                               ;SET AT 4 IF THE CPU CLOCK IS A 4MHZ
;                               ;CLOCK.
;
;
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;                                                               ;
;                                                               ;
;                 CONSOLE BAUD RATE EQUATE SECTION              ;
;                                                               ;
;                ** THIS VALUE MUST BE SUPPLIED **              ;
;                                                               ;
;                                                               ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
CONSPD  EQU     9600            ;CHANGE THIS STATEMENT TO REFLECT THE
;                               ;BAUD RATE OF THE MICROCOMPUTER
;                               ;CONSOLE.
;
;
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;                                                                   ;
;                                                                   ;
;                     LIST DEVICE (PRINTER) ROUTINE                 ;
;                                                                   ;
;                         ** OPTIONAL ENTRY **                      ;
;                                                                   ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;
;
;       THE FOLLOWING IS THE ROUTINE USED TO WRITE DATA TO THE
;       LIST DEVICE (PRINTER).  IF THE CP/M BIOS ROUTINE IS
;       MODIFIED TO NOT WAIT ON THE PRINTER, THEN THIS ROUTINE
;       MAY BE LEFT AS A CP/M CALL.  IF THE CP/M BIOS ROUTINE
;       IS NOT MODIFIED, CHANGE THIS ROUTINE TO WRITE DATA TO THE
;       PRINTER WITHOUT WAITING ON PRINTER READY, PER THE
;       USER'S MANUAL.
;
;
LSTDRV  EQU     $
        CALL    CPM             ;CPM LIST DRIVER ROUTINE
        RET                     ;RETURN TO CALLER
;
;
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;                                                                   ;
;                                                                   ;
;               LIST DEVICE (PRINTER) START-UP VALUE                ;
;                                                                   ;
;                         ** OPTIONAL ENTRY **                      ;
;                                                                   ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;
;
;        THIS VALUE IS TO BE SUPPLIED IF THE LIST DEVICE IS TO BE
;        INITIALIZED TO A PHYSICAL OR LOGICAL PRINTER UPON
;        START-UP OF THE EMULATOR.  IF NO PRINTER VALUE IS REQUIRED
;        UPON START-UP, LEAVE THIS SECTION UNCHANGED.  IF A FILE IS
;        TO BE ASSIGNED TO THE PRINTER UPON START-UP (NO OPERATOR
;        INPUT REQUIRED), CHANGE THIS SECTION TO INDICATE THE
;        PRINTER FILE TO USE.
;
;        FOR EXAMPLE:
;
;        IF THE EMULATOR IS TO START-UP WITH THE LIST DEVICE TO BE
;        ASSIGNED TO THE PHYSICAL PRINT DEVICE, THE PARAMETERS ENTERED
;        WILL APPEAR AS FOLLOWS:
;
;  EX. 1 ---  PRTFIL  EQU     $
;                     DB      4               ;LENGTH OF FILE NAME
;                     DB      'LST:'           ;FILE NAME
;
;        IF THE EMULATOR IS TO START-UP WITH THE LIST DEVICE TO BE
;        ASSIGNED TO THE LOGICAL PRINT DEVICE 'B:PRINT.001', THE PARAMETERS
;        ENTERED WILL APPEAR AS FOLLOWS:
;
;  EX. 2 ---  PRTFIL  EQU     $
;                     DB      11              ;LENGTH OF FILE NAME
;                     DB      'B:PRINT.001'   ;FILE NAME
;
;
PRTFIL  EQU     $
        DB      00             ;LIST DEVICE IS ASSIGNED ON START-UP
;                              ;
;
;
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;                                                                    ;
;                                                                    ;
;                        CONSOLE STATUS ROUTINE                      ;
;                                                                    ;
;                         ** OPTIONAL ENTRY **                       ;
;                                                                    ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;
;
;       CHANGE THIS ROUTINE TO RETURN CONSOLE STATUS TO A CALLING
;       PROGRAM.  IF NO CONSOLE CHARACTER IS AVAILABLE RETURN WITH
;       ACCUMULATOR EQUAL TO ZERO.  IF A CHARACTER IS READY RETURN
;       WITH THE ACCUMULATOR EQUAL TO A 0FFH.  IF A CPM VERSION 2.0
;       OR GREATER IS BEING USED, THIS ROUTINE MUST NOT BE CHANGED.
;
;
CNSTAT  EQU     $
        RET                     ;CPM VERSION IS 2.0 OR GREATER
;
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;                                                                    ;
;                                                                    ;
;                        CONSOLE INPUT ROUTINE                       ;
;                                                                    ;
;                         ** OPTIONAL ENTRY **                       ;
;                                                                    ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;
;
;       IF A CPM VERSION LESS THAN 2.0 IS BEING USED
;       CHANGE THIS ROUTINE TO RETURN A CONSOLE INPUT
;       CHARACTER IN THE ACCUMULTOR.  PARITY MUST BE REMOVED
;       FROM THE CHARACTER RECEIVED.  IF CPM VERSION 2.0 OR
;       GREATER IS BEING USED, THIS ROUTINE MUST NOT BE CHANGED.
;
;
CONDRV  EQU     $
        RET                     ;CMP VERSION 2.0 OR GREATER IS BEING USED
;
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;                                                                    ;
;                                                                    ;
;                 USER SUPPLIED MAINLINE EXIT ROUTINE                ;
;                                                                    ;
;                        ** OPTIONAL ENTRY **                        ;
;                                                                    ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;
;
;       INSERT CODE HERE FOR A MAINLINE EXIT ROUTINE.  THIS EXIT IS
;       NEARLY CONTINUOUSLY EXECUTED AND MUST BE VERY TIME CONSCIOUS.
;       THE TIME PERIOD FOR THE 'MAINLN' EXIT TO COMPLETE ITS PROCESSING
;       IS DEPENDENT ON THE BAUD RATE OF THE LINE TO THE REMOTE.
;       AS A GENERAL RULE:
;
;                 BAUD RATE               MAINLN TIME LIMIT
;
;                   1200                       3.0ms
;                   2400                       1.5ms
;                   4800                       500us
;                   9600                       200us
;                 19,200                       No exit possible
;
;       LEAVE THIS STATEMENT UNCHANGED IF NO MAINLINE EXIT IS DESIRED
;
;
MAINLN  EQU     $               ;THIS IS FOR THE USER SUPPLIED
        RET                     ;MAINLINE EXIT
;
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;                                                                    ;
;                                                                    ;
;                    USER SUPPLIED SCREEN OUT EXIT                   ;
;                                                                    ;
;                         ** OPTIONAL ENTRY **                       ;
;                                                                    ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;
;
;       INSERT CODE HERE FOR USER SUPPLIED EXIT.  THIS EXIT IS
;       CALLED IMMEDIATELY BEFORE DATA IS TRANSMITTED TO THE
;       REMOTE.  LEAVE IS ROUTINE UNCHANGED IF NO SCREEN OUT
;       EXIT IS DESIRED.
;
;
SCROUT  EQU     $               ;USER SUPPLIED SCREEN OUT EXIT
        RET                     ;GOES HERE
;
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;                                                                    ;
;                                                                    ;
;                     USER SUPPLIED SCREEN IN EXIT                   ;
;                                                                    ;
;                         ** OPTIONAL ENTRY **                       ;
;                                                                    ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;
;
;       INSERT CODE HERE IF A USER SUPPLIED SCREEN IN EXIT IS DESIRED
;       THIS ROUTINE IS CALLED IMMEDIATLY BEFORE THE DATA IS DISPLAYED
;       ON THE CONSOLE.  LEAVE THIS ROUTINE UNCHANGED IF NO SCREEN IN
;       EXIT IS DESIRED.
;
;
SCRNIN  EQU     $               ;USER SUPPLIED SCREEN IN EXIT
        RET                     ;GOES HERE
;
;
;
;
AIDADR: DW      00              ;THIS LOCATION CONTAINS THE
;                               ;ADDRESS OF THE AID VALUE TO
;                               ;BE TRANSMITTED TO THE REMOTE
;
;
;
;
SCRADR: DW      00              ;THIS LOCATION CONTAINS THE
;                               ;ADDRESS OF THE 1920 BYTE
;                               ;SCREEN BUFFER
;
;
;
;
DSPADR: DW      00              ;THIS LOCATION CONTAINS THE
;                               ;ADDRESS OF A SINGLE BYTE
;                               ;DISPLAY/NO DISPLAY INDICATOR
;
;
;
;
STAADR: DW      00              ;THIS LOCATION CONTAINS THE
;                               ;ADDRESS OF A SINGLE BYTE
;                               ;SCREEN STATUS INDICATOR
;
;
;
;
CURADR: DW      00              ;THIS LOCATION CONTAINS THE
;                               ;ADDRESS OF THE CURSOR POSITION WORD
;
;
;
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;                                                                   ;
;                                                                   ;
;                TERMINAL SCREEN CODE DEFINITION SECTION            ;
;                                                                   ;
;      ** THE FOLLOWING TERMINAL SCREEN CODES MUST BE DEFINED **    ;
;                                                                   ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;
;
;
;       THE FOLLOWING DEFINES THE CLEAR SCREEN CODE USED BY THE
;       MICROCOMPUTER CONSOLE DEVICE.  THE CODE IS DEFINED WITH
;       A ONE BYTE LENGTH FIELD, GIVING THE LENGTH OF THE CLEAR
;       SCREEN DATA NOT INCLUDING THE LENGTH BYTE, FOLLOWED BY
;       THE DATA THAT WILL CAUSE THE SCREEN TO CLEAR.
;       SOME TERMINALS MAY REQUIRE NULLS AFTER THE CLEAR SCREEN.
;       INSERT NULLS AS 80H, NOT AS 00H.
;
;
CLRSCR  EQU     $
        DB      3               ;LENGTH BYTE
        DB      CTLUPA          ;CURSOR TO HOME POSITION
        DB      ESC,'*'         ;CLEAR ALL CHARACTERS BEHIND CURSOR
;
;
;
;       THE FOLLOWING DEFINES THE HIGHLIGHTING CODE USED BY THE
;       MICROCOMPUTER CONSOLE DEVICE.  THE CODE IS DEFINED WITH
;       A ONE BYTE LENGTH FIELD, GIVING THE LENGTH OF THE HIGH-
;       LIGHTING (REVERSE VIDEO, ETC.) DATA FOR THE TERMINAL, NOT
;       INCLUDING THE LENGTH BYTE, FOLLOWED BY THE DATA THAT WILL
;       CAUSE A SCREEN FIELD TO BE HIGHLIGHTED. IF THE TERMINAL
;       BEING USED DOES NOT SUPPORT HIGHLIGHTING OR OTHER MARKING
;       OF FIELDS, THE LENGTH BYTE MUST BE SET TO ZERO.
;
HILITE  EQU     $
	DB	2		;2 LENGTH BYTE -
        DB      ESC,')'         ;LOW INTENSITY SWITCH-ON SEQUENCE
;
;       THE FOLLOWING DEFINES THE NORMAL FIELD CODE USED BY THE
;       MICROCOMPUTER CONSOLE DEVICE.  THE CODE IS DEFINED WITH A
;       ONE BYTE LENGTH FIELD, GIVING THE LENGTH OF THE DATA THAT
;       WILL CAUSE NORMAL PRESENTATION OF A FIELD AFTER A HIGHLIGHTED
;       FIELD, FOLLOWED BY THE DATA ITSELF.  THE LENGTH BYTE VALUE
;       DOES NOT INCLUDE THE LENGTH BYTE ITSELF. IF THE TERMINAL BEING
;       USED DOES NOT SUPPORT HIGHLIGHTING OR OTHER MARKING OF FIELDS,
;       THE LENGTH BYTE MUST BE SET TO ZERO.
;
LOLITE  EQU     $
        DB      2               ;2 LENGTH BYTE -
        DB      ESC,'('         ;NORMAL INTENSITY SWITCH-OFF SEQUENCE
;
;       THE FOLLOWING DEFINES THE CURSOR ADDRESSING MODE USED BY
;       THE TERMINAL.  IF ROW/COLUMN ADDRESSING IS USED, THE
;       FOLLOWING STATEMENT MUST BE EQUATED TO 'ROWCOL'.  IF
;       COLUMN/ROW ADDRESSING IS USED, THE FOLLOWING STATEMENT
;	MUST BE EQUATED TO 'COLROW'.  IF ABSOLUTE CURSOR
;       ADDRESSING IS USED, CHANGE THE EQUATE TO 'ABSPOS'.
;
;
ADRMOD  EQU     ROWCOL
;
;
;       THE FOLLOWING ENTRIES ARE SET TO INDICATE IF THE MICRO-COMPUTER
;       CONSOLE SUPPORTS MEMORY MAPPED I/O.  IF MEMORY MAPPED VIDEO
;       IS SUPPORTED, CHANGE 'VIDRAM' TO TRUE.  IF MEMORY MAPPED
;       IS NOT SUPPORTED, LEAVE 'VIDRAM' SET TO FALSE.  IF
;       'VIDRAM' IS SET TO TRUE, 'VIDADR' MUST BE SET TO THE
;       BEGINNING ADDRESS OF THE VIDEO MEMORY.
;
;            EXAMPLE:   IF YOUR TERMINAL SUPPORTS MEMORY MAPPED I/O
;                       AND THE STARTING ADDRESS FOR THE VIDEO MEMORY
;                       BEGINS AT ADDRESS EF00 HEX, THE VALUES
;                       ENTERED FOR 'VIDRAM' AND 'VIDADR' ARE:
;
;                       VIDRAM  EQU     TRUE
;                       VIDADR  EQU     0EF00H
;
;
;
;
VIDRAM  EQU     FALSE
;
;
VIDADR  EQU     00000H
;
;
;
;       THE FOLLOWING DEFINES THE CONSTANT THAT, WHEN SENT TO THE
;       TERMINAL, DEFINES THE START OF A ROW POSITIONING SEQUENCE.
;       THE CONSTANT IS DEFINED WITH A LENGTH BYTE THAT GIVES THE
;       LENGTH OF THE CONSTANT, NOT INCLUDING THE LENGTH BYTE ITSELF,
;       FOLLOWED BY THE CONSTANT.
;
;
ROWCON  EQU     $
        DB      2               ;LENGTH OF CONSTANT
        DB      ESC,'='         ;ESC/[ SEQUENCE IS CURSOR
;                               ;POSITIONING ADDRESSING SEQUENCE
;                               ;START
;
;
;
;       THE FOLLOWING DEFINES THE CONSTANT, IF ANY, THAT MUST BE SENT
;       TO THE TERMINAL TO IDENTIFY THE START OF COLUMN POSITIONING
;       DATA.  THE ENTRY CONTAINS A LENGTH BYTE, GIVING THE LENGTH OF
;       THE CONSTANT, NOT INCLUDING THE LENGTH BYTE, THAT MUST BE SENT.
;       IF NO DATA IS TO BE SENT, THE LENGTH BYTE MUST BE ZERO.
;
;
COLCON  EQU     $
        DB      0               ;LENGTH OF ZERO INDICATES NO
;                               ;POSITIONING DATA IS NEEDED.
;
;
;
;       THE FOLLOWING TABLE DEFINES THE CHARACTERS THAT MUST BE SENT
;       TO THE TERMINAL TO POSITION THE CURSOR TO A SPECIFIED ROW (LINE)
;       ON THE SCREEN.  THE TABLE CONTAINS A LENGTH BYTE THAT GIVES
;       THE LENGTH OF EACH FOLLOWING TABLE ENTRY.  AFTER THE LENGTH
;       BYTE ARE 24 TABLE ENTRIES, ONE FOR EACH ROW ON THE SCREEN.
;       THE CHARACTER IN THE FIRST TABLE ENTRY IS TO SELECT ROW 1,
;       ETC., TO THE 24TH TABLE ENTRY WHICH IS FOR ROW 24.
;
;
ROWTAB  EQU     $
        DB      1               ;LENGTH OF EACH ENTRY
;
        DB      ' '             ;ROW  1 SELECT
        DB      '!'             ;ROW  2 SELECT
        DB      '"'             ;ROW  3 SELECT
        DB      '#'             ;ROW  4 SELECT
        DB      '$'             ;ROW  5 SELECT
        DB      '%'             ;ROW  6 SELECT
        DB      '&'             ;ROW  7 SELECT
        DB      ''''            ;ROW  8 SELECT
        DB      '('             ;ROW  9 SELECT
        DB      ')'             ;ROW 10 SELECT
        DB      '*'             ;ROW 11 SELECT
        DB      '+'             ;ROW 12 SELECT
        DB      ','             ;ROW 13 SELECT
        DB      '-'             ;ROW 14 SELECT
        DB      '.'             ;ROW 15 SELECT
        DB      '/'             ;ROW 16 SELECT
        DB      '0'             ;ROW 17 SELECT
        DB      '1'             ;ROW 18 SELECT
        DB      '2'             ;ROW 19 SELECT
        DB      '3'             ;ROW 20 SELECT
        DB      '4'             ;ROW 21 SELECT
        DB      '5'             ;ROW 22 SELECT
        DB      '6'             ;ROW 23 SELECT
        DB      '7'             ;ROW 24 SELECT
;                   
;
;
;       THE FOLLOWING TABLE DEFINES THE CHARACTERS THAT MUST BE SENT
;       TO THE TERMINAL TO POSITION THE CURSOR AT A SPECIFIED COLUMN
;       ON THE SCREEN.  THE LAYOUT OF THIS TABLE IS THE SAME AS THAT
;       FOR ROW POSITIONING DATA, AS ABOVE, WITH A ONE BYTE LENGTH
;       FIELD FOLLOWED BY THE TABLE ENTRIES NEEDED.
;
;
COLTAB  EQU     $
        DB      1               ;LENGTH OF EACH TABLE ENTRY
;
        DB      ' '             ;COLUMN  1 SELECT
        DB      '!'             ;COLUMN  2 SELECT
        DB      '"'             ;COLUMN  3 SELECT
        DB      '#'             ;COLUMN  4 SELECT
        DB      '$'             ;COLUMN  5 SELECT
        DB      '%'             ;COLUMN  6 SELECT
        DB      '&'             ;COLUMN  7 SELECT
        DB      ''''            ;COLUMN  8 SELECT
        DB      '('             ;COLUMN  9 SELECT
        DB      ')'             ;COLUMN 10 SELECT
        DB      '*'             ;COLUMN 11 SELECT
        DB      '+'             ;COLUMN 12 SELECT
        DB      ','             ;COLUMN 13 SELECT
        DB      '-'             ;COLUMN 14 SELECT
        DB      '.'             ;COLUMN 15 SELECT
        DB      '/'             ;COLUMN 16 SELECT
        DB      '0'             ;COLUMN 17 SELECT
        DB      '1'             ;COLUMN 18 SELECT
        DB      '2'             ;COLUMN 19 SELECT
        DB      '3'             ;COLUMN 20 SELECT
        DB      '4'             ;COLUMN 21 SELECT
        DB      '5'             ;COLUMN 22 SELECT
        DB      '6'             ;COLUMN 23 SELECT
        DB      '7'             ;COLUMN 24 SELECT
        DB      '8'             ;COLUMN 25 SELECT
        DB      '9'             ;COLUMN 26 SELECT
        DB      ':'             ;COLUMN 27 SELECT
        DB      ';'             ;COLUMN 28 SELECT
        DB      '<'             ;COLUMN 29 SELECT
        DB      '='             ;COLUMN 30 SELECT
        DB      '>'             ;COLUMN 31 SELECT
        DB      '?'             ;COLUMN 32 SELECT
        DB      '@'             ;COLUMN 33 SELECT
        DB      'A'             ;COLUMN 34 SELECT
        DB      'B'             ;COLUMN 35 SELECT
        DB      'C'             ;COLUMN 36 SELECT
        DB      'D'             ;COLUMN 37 SELECT
        DB      'E'             ;COLUMN 38 SELECT
        DB      'F'             ;COLUMN 39 SELECT
        DB      'G'             ;COLUMN 40 SELECT
        DB      'H'             ;COLUMN 41 SELECT
        DB      'I'             ;COLUMN 42 SELECT
        DB      'J'             ;COLUMN 43 SELECT
        DB      'K'             ;COLUMN 44 SELECT
        DB      'L'             ;COLUMN 45 SELECT
        DB      'M'             ;COLUMN 46 SELECT
        DB      'N'             ;COLUMN 47 SELECT
        DB      'O'             ;COLUMN 48 SELECT
        DB      'P'             ;COLUMN 49 SELECT
        DB      'Q'             ;COLUMN 50 SELECT
        DB      'R'             ;COLUMN 51 SELECT
        DB      'S'             ;COLUMN 52 SELECT
        DB      'T'             ;COLUMN 53 SELECT
        DB      'U'             ;COLUMN 54 SELECT
        DB      'V'             ;COLUMN 55 SELECT
        DB      'W'             ;COLUMN 56 SELECT
        DB      'X'             ;COLUMN 57 SELECT
        DB      'Y'             ;COLUMN 58 SELECT
        DB      'Z'             ;COLUMN 59 SELECT
        DB      '['             ;COLUMN 60 SELECT
        DB      '\'             ;COLUMN 61 SELECT
        DB      ']'             ;COLUMN 62 SELECT
        DB      '^'             ;COLUMN 63 SELECT
        DB      '_'             ;COLUMN 64 SELECT
        DB      '`'             ;COLUMN 65 SELECT
        DB      'a'             ;COLUMN 66 SELECT ;NOTE THAT SOME ASSEMBLERS
        DB      'b'             ;COLUMN 67 SELECT ;WILL ASSEMBLE LOWER CASE
        DB      'c'             ;COLUMN 68 SELECT ;ALPHABETIC CHARACTER AS
        DB      'd'             ;COLUMN 69 SELECT ;UPPER CASE.  IF YOUR
        DB      'e'             ;COLUMN 70 SELECT ;ASSEMBLER MAKES THIS CHANGE,
        DB      'f'             ;COLUMN 71 SELECT ;LOWER CASE ALPHABETIC CHAR.
        DB      'g'             ;COLUMN 72 SELECT ;MUST BE ENTERED IN HEX
        DB      'h'             ;COLUMN 73 SELECT
        DB      'i'             ;COLUMN 74 SELECT
        DB      'j'             ;COLUMN 75 SELECT
        DB      'k'             ;COLUMN 76 SELECT
        DB      'l'             ;COLUMN 77 SELECT
        DB      'm'             ;COLUMN 78 SELECT
        DB      'n'             ;COLUMN 79 SELECT
        DB      'o'             ;COLUMN 80 SELECT
;
;
;
;       THE FOLLOWING DEFINES THE CONSTANT, IF ANY, THAT MUST BE
;       SENT TO THE TERMINAL TO DELIMIT THE END OF ROW POSITIONING
;       DATA.  THE DATA IS DEFINED WITH A LENGTH BYTE THAT GIVES THE
;       LENGTH OF THE CONSTANT, NOT INCLUDING THE LENGTH BYTE ITSELF,
;       FOLLOWED BY THE END OF ROW CONSTANT.  IF NO END OF ROW DATA IS
;       TO BE SENT, THE LENGTH BYTE MUST BE ZERO.
;
;
ENDROW  EQU     $
        DB      0               ;NOT NECESSARY
;
;
;
;       THE FOLLOWING DEFINES THE CONSTANT, IF ANY, THAT MUST BE
;       SENT TO THE TERMINAL TO DELIMIT THE END OF COLUMN POSITIONING
;       DATA.  THE DATA IS DEFINED WITH A LENGTH BYTE THAT GIVES THE
;       LENGTH OF THE CONSTANT, NOT INCLUDING THE LENGTH BYTE,
;       FOLLOWED BY THE CONSTANT TO BE SENT.  IF NO END OF ROW DATA
;       IS TO BE SENT, THE LENGTH BYTE MUST BE ZERO.
;
;
ENDCOL  EQU    $
        DB     0                ;NOT NECESSARY
;
;
;       THE FOLLOWING DEFINES THE CONSTANT, IF ANY, THAT MUST BE
;       SENT TO THE TERMINAL TO START SCREEN SCROLLING, UNDER
;       SOFTWARE CONTROL.  THE DATA IS DEFINED WITH A LENGTH
;       BYTE THAT GIVES THE LENGTH OF THE CONSTANT, NOT INCLUDING
;       THE LENGTH BYTE, FOLLOWED BY THE CONSTANT TO BE SENT.
;       IF NO START SCREEN SCROLLING SEQUENCE IS ALLOWED, THE
;       LENGTH BYTE MUST BE ZERO.
;
;
STRTSC  EQU     $
        DB      0
;
;
;       THE FOLLOWING DEFINES THE CONSTANT, IF ANY, THAT MUST BE
;       SENT TO THE TERMINAL TO STOP SCREEN SCROLLING UNDER
;       SOFTWARE CONTROL.  THE DATA IS DEFINED WITH A LENGTH
;       BYTE THAT GIVES THE LENGTH OF THE CONSTANT, NOT INCLUDING
;       THE LENGTH BYTE, FOLLOWED BY THE  CONSTANT TO BE SENT.
;       IF NO START SCREEN SCROLLING SEQUENCE  IS ALLOWED, THE
;       LENGTH BYTE MUST BE ZERO.
;
;
STOPSC  EQU     $
        DB      0
;
;
NEWLNE  EQU     TRUE            ;THIS STATEMENT INDICATES IF THE TERMINAL
;                               ;HAS AUTO NEW-LINE CAPIBILITIES.  LEAVE
;                               ;THIS STATEMENT SET TO 'TRUE' IF THE
;                               ;TERMINAL DOES SUPPORT AUTOMATIC NEW-LINE.
;                               ;CHANGE THIS STATEMENT TO 'FALSE' IF THE
;                               ;TERMINAL DOES NOT SUPPORT AUTOMATIC NEW LINE.
;
;
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;                                                                   ;
;                                                                   ;
;            3270 TO MICROCOMPUTER KEYBOARD EQUIVALENCE TABLE       ;
;                                                                   ;
;                                                                   ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;
;
;
;       THE FOLLOWING TABLE DEFINES THE 3270 KEYBOARD KEYS TO
;       BE REPRESENTED BY EACH MICROCOMPUTER CONSOLE KEY.
;
;       THIS TABLE HAS 128 ENTRIES, EACH CORRESPONDING TO A
;       CHARACTER THAT MAY BE ENTERED ON A STANDARD ASCII TERMINAL.
;       GRAPHIC CHARACTERS (THOSE THAT ARE DISPLAYABLE ASCII
;       CHARACTERS) ARE IN THE TABLE IN THEIR NATIVE FORM. SPECIAL
;       3270 CHARACTERS ARE IN THE TABLE THROUGH USE OF THE
;       EQUATES DEFINED ABOVE.  TO CHANGE THE MEANING
;       OF A KEY, CHANGE THE VALUE OF THE DEFINITION OF THE KEY
;       IN THE TABLE.
;
;       TABLE ENTRIES WITH ZERO VALUES WILL CAUSE THE CORRESPONDING
;       KEY TO BE A NO-OPERATION.
;
;       TO DEFINE A MULTIPLE KEY SEQUENCE, ENTER ONE OF THE MULTIPLE
;       KEY IDENTIFIERS MLTKY1 THROUGH MLTKY4 IN KBTAB AND COMPLETE
;       THE DEFINITION BY ENTERING THE REST OF THE SEQUENCE IN ONE
;       OF THE FOUR MULTIPLE KEY SEQUENCE TABLES, MLTTB1 THROUGH
;       MLTTB4, RESPECTIVELY.
;
;
KBTAB  EQU     $               ;KEYBOARD CORRESPONDENCE TABLE
;
        DB      00              ;CONTROL/@ IS NO OPERATION
	DB	BKTAB		;CONTROL/A FIELD LEFT IS BACKTAB
	DB	ERAINP		;CONTROL/B REFORM  IS ERASE INP.FIELDS
	DB	DNLINE		;CONTROL/C CURSOR DOWN (DOUBLE) IS DOWN LINE
	DB	FWSPAC		;CONTROL/D CURSOR RIGHT IS FORW.SP./CUR. RIGHT
        DB      00              ;CONTROL/E IS NO OPERATION
	DB	FWTAB		;CONTROL/F FIELD RIGHT IS FORWARD TAB
	DB	RUBOUT		;CONTROL/G DELETE CHAR IS DELETE KEY
        DB      BKSPAC          ;CONTROL/H BACK SPACE IS LEFT (BACK SPACE) 
	DB	DUP		;CONTROL/I TAB IS DUP KEY
        DB      TSTREQ          ;CONTROL/J HELP IS TEST REQUEST 
	DB	FMARK		;CONTROL/K FILE/BLOCK IS FIELD-MARK
	DB	RESET		;CONTROL/L FIND AGAIN IS RESET
        DB      ENTER           ;CONTROL/M (CR) OR ENTER IS ENTER 
	DB	NXLINE		;CONTROL/N LINEFEED IS NEXT LINE
	DB	00    		;CONTROL/O IS NO OPERATION
        DB      PRINT           ;CONTROL/P PRINT IS LOCAL PRINT 
	DB	HOME		;CONTROL/Q QUICK IS CURSOR HOME
	DB	UPLINE		;CONTROL/R CURSOR UP (DOUBLE) IS UPLINE
        DB      BKSPAC          ;CONTROL/S CURSOR LEFT IS LEFT (BACK SPACE)
	DB	ERAEOF		;CONTROL/T DELETE WORD IS ERASE TO E.O.FIELD
	DB	CLEAR		;CONTROL/U STOP IS CLEAR-KEY
	DB	INSERT		;CONTROL/V INSERT ON/OFF IS INSERT
	DB	00    		;CONTROL/W IS NO OPERATION
	DB	00     		;CONTROL/X IS NO OPERATION
        DB      00              ;CONTROL/Y IS NO OPERATION
	DB	00    		;CONTROL/Z IS NO OPERATION
        DB      MLTKY1          ;ESCAPE BEGINS MULTIPLE KEY SEQUENCE
        DB      0               ;CONTROL/\ IS NO OPERATION
        DB      0               ;CONTROL/] IS NO OPERATION
        DB      0               ;CONTROL/^ IS NO OPERATION
        DB      0               ;CONTROL/_ IS NO OPERATION
        DB      ' '             ;SPACE
        DB      '!'             ;EXCLAMATION POINT
        DB      '"'             ;DOUBLE QUOTE
        DB      '#'             ;POUND SIGN
        DB      '$'             ;DOLLAR SIGN
        DB      '%'             ;PERCENT SIGN
        DB      '&'             ;AMPERSAND
        DB      ''''            ;SINGLE QUOTE (APOSTROPHE)
        DB      '('             ;LEFT PARENTHESIS
        DB      ')'             ;RIGHT PARENTHESIS
        DB      '*'             ;ASTERISK
        DB      '+'             ;PLUS SIGN
        DB      ','             ;COMMA
        DB      '-'             ;HYPHEN
        DB      '.'             ;PERIOD
        DB      '/'             ;SLASH
        DB      '0'             ;0
        DB      '1'             ;1
        DB      '2'             ;2
        DB      '3'             ;3
        DB      '4'             ;4
        DB      '5'             ;5
        DB      '6'             ;6
        DB      '7'             ;7
        DB      '8'             ;8
        DB      '9'             ;9
        DB      ':'             ;COLON
        DB      ';'             ;SEMICOLON
        DB      '<'             ;LESS THAN
        DB      '='             ;EQUAL SIGN
        DB      '>'             ;GREATER THAN
        DB      '?'             ;QUESTION MARK
        DB      '@'             ;COMMERCIAL ADD SIGN
        DB      'A'             ;A
        DB      'B'             ;B
        DB      'C'             ;C
        DB      'D'             ;D
        DB      'E'             ;E
        DB      'F'             ;F
        DB      'G'             ;G
        DB      'H'             ;H
        DB      'I'             ;I
        DB      'J'             ;J
        DB      'K'             ;K
        DB      'L'             ;L
        DB      'M'             ;M
        DB      'N'             ;N
        DB      'O'             ;O
        DB      'P'             ;P
        DB      'Q'             ;Q
        DB      'R'             ;R
        DB      'S'             ;S
        DB      'T'             ;T
        DB      'U'             ;U
        DB      'V'             ;V
        DB      'W'             ;W
        DB      'X'             ;X
        DB      'Y'             ;Y
        DB      'Z'             ;Z
        DB      '['             ;LEFT BRACKET
        DB      '\'             ;BACK SLASH
        DB      ']'             ;RIGHT BRACKET
        DB      '^'             ;ACCENT CIRCUMFLEX
        DB      '_'             ;UNDERSCORE
        DB      '`'             ;REVERSE ACCENT
        DB      61H             ;a
        DB      62H             ;b
        DB      63H             ;c
        DB      64H             ;d
        DB      65H             ;e
        DB      66H             ;f
        DB      67H             ;g
        DB      68H             ;h
        DB      69H             ;i
        DB      6AH             ;j
        DB      6BH             ;k
        DB      6CH             ;l
        DB      6DH             ;m
        DB      6EH             ;n
        DB      6FH             ;o
        DB      70H             ;p
        DB      71H             ;q
        DB      72H             ;r
        DB      73H             ;s
        DB      74H             ;t
        DB      75H             ;u
        DB      76H             ;v
        DB      77H             ;w
        DB      78H             ;x
        DB      79H             ;y
        DB      7AH             ;z
        DB      '{'             ;LEFT BRACE
        DB      '|'             ;VERTICAL BAR
        DB      '}'             ;RIGHT BRACE
        DB      '~'             ;ACCENT TILDE (SPANISH)
        DB      RUBOUT          ;RUB OUT IS DELETE ONE CHARACTER 
;
;
;
;       -  THE FOLLOWING ARE THE MULTIPLE KEY SEQUENCE TABLES  -
;
;
MLTTB1  EQU     $               ;MULTIPLE KEY TABLE 1
;                               ;THIS TABLE IS ASSOCIATED WITH THE KEY
;                               ;DEFINED AS MLTKY1 (ESCAPE).
;
        DB      2               ;LENGTH OF EACH KEY SEQUENCE, NOT
;                               ;INCLUDING THE LEADING KEY IDENTIFIED
;                               ;IN KBTAB
;
	DB	'01',PF1	;ESC 0 1         IS PF1
	DB	'02',PF2	;ESC 0 2         IS PF2
	DB	'03',PF3	;ESC 0 3         IS PF3
	DB	'04',PF4	;ESC 0 4         IS PF4
	DB	'05',PF5	;ESC 0 5         IS PF5
	DB	'06',PF6	;ESC 0 6         IS PF6
	DB	'07',PF7	;ESC 0 7         IS PF7
	DB	'08',PF8	;ESC 0 8         IS PF8
	DB	'09',PF9	;ESC 0 9         IS PF9
	DB	'10',PF10	;ESC 1 0         IS PF10
	DB	'11',PF11	;ESC 1 1         IS PF11
	DB	'12',PF12	;ESC 1 2         IS PF12
	DB	'A1',PA1	;ESC A 1         IS PA1
	DB	'A2',PA2	;ESC A 2         IS PA2
	DB	'A3',PA3	;ESC A 3         IS PA3
;
        DB      0               ;END OF TABLE - OTHER ESC SEQUENCES
;                               ;ARE NO OPERATIONS
;
;
MLTTB2  EQU     $               ;MULTIPLE KEY SEQUENCE TABLE 2 -
;                               ;THIS TABLE IS ASSOCIATED WITH THE
;                               ;MLTKY2 IDENTIFIER.
;
        DB      0               ;NOT USED - END OF TABLE
;
;
MLTTB3  EQU     $               ;MULTIPLE KEY SEQUENCE TABLE 3 -
;                               ;THIS TABLE IS ASSOCIATED WITH THE
;                               ;MLTKY3 IDENTIFIER.
;
        DB      0               ;NOT USED - END OF TABLE
;
;
MLTTB4  EQU     $               ;MULTIPLE KEY SEQUENCE TABLE 4 -
;                               ;THIS TABLE IS ASSOCIATED WITH THE
;                               ;MLYKY4 IDENTIFIER.
;
        DB      0               ;NOT USED - END OF TABLE
;
;
;
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;                                                                   ;
;                      ASCII/EBCDIC TRANSLATE TABLES                ;
;                                                                   ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;
;
;        THE FOLLOWING TWO TABLES ARE THE ASCII TO EBCDIC
;        AND EBCDIC TO ASCII TRANSLATE TABLES USED BY THE
;        EMULATOR IN CODE CONVERSION.  THESE TABLES MAY BE
;        MODIFIED TO ALLOW TRANSLATION OF ANY CHARACTER TO
;        ANY OTHER CHARACTER, SO LONG AS LINE CONTROL
;        CHARACTERS ARE NOT TRANSMITTED.
;
;
ASCEBC  EQU     $               ;ASCII TO EBCDIC TRANSLATE TABLE
;
;
        DB 000H,001H,002H,003H,037H,02DH,02EH,02FH  ;00H-07H
        DB 016H,005H,025H,00BH,00CH,00DH,00EH,00FH  ;08H-0FH
        DB 010H,011H,012H,013H,03CH,03DH,032H,026H  ;10H-17H
        DB 018H,019H,03FH,027H,01CH,01DH,01EH,01FH  ;18H-1FH
        DB 040H,04FH,07FH,07BH,05BH,06CH,050H,07DH  ;20H-27H
        DB 04DH,05DH,05CH,04EH,06BH,060H,04BH,061H  ;28H-2FH
        DB 0F0H,0F1H,0F2H,0F3H,0F4H,0F5H,0F6H,0F7H  ;30H-37H
        DB 0F8H,0F9H,07AH,05EH,04CH,07EH,06EH,06FH  ;38H-3FH
        DB 07CH,0C1H,0C2H,0C3H,0C4H,0C5H,0C6H,0C7H  ;40H-47H
        DB 0C8H,0C9H,0D1H,0D2H,0D3H,0D4H,0D5H,0D6H  ;48H-4FH
        DB 0D7H,0D8H,0D9H,0E2H,0E3H,0E4H,0E5H,0E6H  ;50H-57H
        DB 0E7H,0E8H,0E9H,04AH,0E0H,05AH,05FH,06DH  ;58H-5FH
        DB 079H,081H,082H,083H,084H,085H,086H,087H  ;60H-67H
        DB 088H,089H,091H,092H,093H,094H,095H,096H  ;68H-6FH
        DB 097H,098H,099H,0A2H,0A3H,0A4H,0A5H,0A6H  ;70H-77H
        DB 0A7H,0A8H,0A9H,0C0H,06AH,0D0H,0A1H,007H  ;78H-7FH
        DB 020H,021H,022H,023H,024H,015H,006H,017H  ;80H-87H
        DB 028H,029H,02AH,02BH,02CH,009H,00AH,01BH  ;88H-8FH
        DB 030H,031H,01AH,033H,034H,035H,036H,008H  ;90H-97H
        DB 038H,039H,03AH,03BH,004H,014H,03EH,0E1H  ;98H-9FH
        DB 041H,042H,043H,044H,045H,046H,047H,048H  ;A0H-A7H
        DB 049H,051H,052H,053H,054H,055H,056H,057H  ;A8H-AFH
        DB 058H,059H,062H,063H,064H,065H,066H,067H  ;B0H-B7H
        DB 068H,069H,070H,071H,072H,073H,074H,075H  ;B8H-BFH
        DB 076H,077H,078H,080H,08AH,08BH,08CH,08DH  ;C0H-C7H
        DB 08EH,08FH,090H,09AH,09BH,09CH,09DH,09EH  ;C8H-CFH
        DB 09FH,0A0H,0AAH,0ABH,0ACH,0ADH,0AEH,0AFH  ;D0H-D7H
        DB 0B0H,0B1H,0B2H,0B3H,0B4H,0B5H,0B6H,0B7H  ;D8H-DFH
        DB 0B8H,0B9H,0BAH,0BBH,0BCH,0BDH,0BEH,0BFH  ;E0H-E7H
        DB 0CAH,0CBH,0CCH,0CDH,0CEH,0CFH,0DAH,0DBH  ;E8H-EFH
        DB 0DCH,0DDH,0DEH,0DFH,0EAH,0EBH,0ECH,0EDH  ;F0H-F7H
        DB 0EEH,0EFH,0FAH,0FBH,0FCH,0FDH,0FEH,0FFH  ;F8H-FFH
;
;
EBCASC  EQU     $               ;EBCDIC TO ASCII TRANSLATE TABLE
;
;
       DB 000H,001H,002H,003H,09CH,009H,086H,07FH  ;00H-07H
       DB 097H,08DH,08EH,00BH,00CH,00DH,00EH,00FH  ;08H-0FH
       DB 010H,011H,012H,013H,09DH,085H,008H,087H  ;10H-17H
       DB 018H,019H,092H,08FH,01CH,01DH,01EH,01FH  ;18H-1FH
       DB 080H,081H,082H,083H,084H,00AH,017H,01BH  ;20H-27H
       DB 088H,089H,08AH,08BH,08CH,005H,006H,007H  ;28H-2FH
       DB 090H,091H,016H,093H,094H,095H,096H,004H  ;30H-37H
       DB 098H,099H,09AH,09BH,014H,015H,09EH,01AH  ;38H-3FH
       DB 020H,0A0H,0A1H,0A2H,0A3H,0A4H,0A5H,0A6H  ;40H-47H
       DB 0A7H,0A8H,05BH,02EH,03CH,028H,02BH,021H  ;48H-4FH
       DB 026H,0A9H,0AAH,0ABH,0ACH,0ADH,0AEH,0AFH  ;50H-57H
       DB 0B0H,0B1H,05DH,024H,02AH,029H,03BH,05EH  ;58H-5FH
       DB 02DH,02FH,0B2H,0B3H,0B4H,0B5H,0B6H,0B7H  ;60H-67H
       DB 0B8H,0B9H,07CH,02CH,025H,05FH,03EH,03FH  ;68H-6FH
       DB 0BAH,0BBH,0BCH,0BDH,0BEH,0BFH,0C0H,0C1H  ;70H-77H
       DB 0C2H,060H,03AH,023H,040H,027H,03DH,022H  ;78H-7FH
       DB 0C3H,061H,062H,063H,064H,065H,066H,067H  ;80H-87H
       DB 068H,069H,0C4H,0C5H,0C6H,0C7H,0C8H,0C9H  ;88H-8FH
       DB 0CAH,06AH,06BH,06CH,06DH,06EH,06FH,070H  ;90H-97H
       DB 071H,072H,0CBH,0CCH,0CDH,0CEH,0CFH,0D0H  ;98H-9FH
       DB 0D1H,07EH,073H,074H,075H,076H,077H,078H  ;A0H-A7H
       DB 079H,07AH,0D2H,0D3H,0D4H,0D5H,0D6H,0D7H  ;A8H-AFH
       DB 0D8H,0D9H,0DAH,0DBH,0DCH,0DDH,0DEH,0DFH  ;B0H-B7H
       DB 0E0H,0E1H,0E2H,0E3H,0E4H,0E5H,0E6H,0E7H  ;B8H-BFH
       DB 07BH,041H,042H,043H,044H,045H,046H,047H  ;C0H-C7H
       DB 048H,049H,0E8H,0E9H,0EAH,0EBH,0ECH,0EDH  ;C8H-CFH
       DB 07DH,04AH,04BH,04CH,04DH,04EH,04FH,050H  ;D0H-D7H
       DB 051H,052H,0EEH,0EFH,0F0H,0F1H,0F2H,0F3H  ;D8H-DFH
       DB 05CH,09FH,053H,054H,055H,056H,057H,058H  ;E0H-E7H
       DB 059H,05AH,0F4H,0F5H,0F6H,0F7H,0F8H,0F9H  ;E8H-EFH
       DB 030H,031H,032H,033H,034H,035H,036H,037H  ;F0H-F7H
       DB 038H,039H,0FAH,0FBH,0FCH,0FDH,0FEH,0FFH  ;F8H-FFH
;
;
;
;
;
;       THE FOLLOWING ROUTINES MUST NOT BE MODIFIED.
;
USDT    EQU     USDATA
USST    EQU     USSTAT
USDTIN: IN      USDT
        RET
USDTOT: OUT     USDT
        RET
USSTIN: IN      USST
        RET
USSTOT: OUT     USST
        RET
TMCTOT  EQU     $
TMDTIN  EQU     $
TMDTOT  EQU     $
SELDAT  EQU     $
SELCMD  EQU     $
CKCMOT  EQU     $
CKDTOT	EQU	$
        RET
RTMODE:	MVI A,DEVICE
	RET
RTXLAT:	LXI H,ASCEBC
        RET
RTCPUS: MVI     A,CPUSPD
        RET
RTCONS: MVI     A,CONCON
        RET
BDRTVL:	DW	0
CONCON  EQU     CONSPD/2400
;
RTIO:   MVI     A,IODEV
        RET
;
RTRTSA: MVI     A,FALSE
        RET
;
GETTIM  EQU     $
        MVI     A,CONCON
        CPI     8
        JZ      TIM4
        JNC     TIM4
        CPI     4
        JZ      TIM2
        JNC     TIM2
        LXI     H,016EH
GETTM   EQU     $
        MVI     A,CPUSPD        ;GET THE CPU SPEED
        MOV     B,H             ;PUT HIGH ORDER IN B
        MOV     C,L             ;PUT LOW  ORDER IN C
        LXI     H,0             ;CLEAR H,L
SETVAL  EQU     $
        DAD     B               ;ADD TIME CONSTANT TO ITSELF
        DCR     A               ;UNTIL WE
        JNZ     SETVAL          ;GET IT
        RET                     ;RIGHT
;
TIM4:   LXI     H,05BH
        JMP     GETTM
TIM2:   LXI     H,0B7H
        JMP     GETTM
;
SETSCR  EQU     $
        SHLD    SCRADR
        RET
SETAID  EQU     $
        SHLD    AIDADR
        RET
SETDSP  EQU     $
        SHLD    DSPADR
        RET
SETSTA  EQU     $
        SHLD    STAADR
        RET
SETCUR  EQU     $
        SHLD    CURADR
        RET
;
RETNL   EQU     $
        MVI     A,NEWLNE
        RET
;
RTCMLN  EQU     $
        MVI     A,COMLNE
        RET
;
RTPRN   EQU     $
        LXI     H,PRTFIL
        RET
;
FSTEXT: RET
EXTEXT: RET
INEXT:  RET
OUTEXT: RET
INTEXT: RET
RTSEXT: RET
RSTEXT: RET
XMTEXT: RET
RCVEXT: RET
;
        END
