Title Talk to an Md3 through the Aux Port (13_Oct_84) ; ; Copyright 1984 ; Morrow Designs, Inc. ; San Leandro Ca. ; .z80 Aseg org 0100h page 60 ;---------------------------------------------------------------------- ; Equates (13_Oct_84) ;-------------------- ; Rev equ 20h ;Revision Number Stop equ 0FFh ;Stop Flag for Get Parameters ;Bdos Functions Bdos_Entry equ 5 ;Entry Point into the Bdos Bdos_PString equ 9 ;Bdos Print String Function Bdos_ConIn equ 1 ;Bdos Console Input ;Extended Bios Function Numbers Bios_Entry equ 0 ;Bios Entry Point EB_Get_Chr_Tbl equ 6 ;Get the Character Table EB_Write_Sys equ 1 ;Write to system memory EB_Init_Ctc equ 10 ;Initialize the Ctc and HandShaking EB_Execute equ 14 ;Execute in the System Bank ;Default Values Default_CFlag equ 00100011b ;Translations On,Centronics List Default_HndShk equ 11000001b ;Aux Format 8 bits, Rx_Enabled ;Offsets CFlag_Off equ 3 ;CFlag from Start of Char Table Hand_Off equ 6 ;HandShaking Status from Start Char Tbl ConIn_Offset equ 9 ;ConIn from Start of Bios Jump Table ConOut_Offset equ 0Ch ;ConOut " " " " " " ;Limits Max_Escapes equ 2 ;(Serves as a print code as well) Max_Assgn equ 3 ;Number of Device Assignment Selections Max_Baud equ 8 ;Number of Baud Rate Selections ;Uart Flags $TxRdy equ 00000100b ;Uart Transmitter Ready Bit $RcvRdy equ 00000001b ;Uart Reciever Ready Bit ;I/O Port Addresses s1data equ 60h ;serial port 1 data (dart1 = con port) s1stat equ 61h ;serial port 1 status s2data equ 62h ;serial port 2 data (dart2 = prn port) s2stat equ 63h ;serial port 2 status s3data equ 70h ;serial port 3 data (sio) s3stat equ 71h ;serial port 3 status (sio) ;Error Message Codes Err_OverFlow1 equ 10 ;Que 1 Has OverFlowed Err_OverFlow2 equ 11 ;Que 2 Has OverFlowed ;Normal Message Codes Title_Block equ 20 ;Title Block Device1_Select equ 21 ;Device 1 Selection Message Device2_Select equ 22 ;Device 2 Selection Message Device1_Baud equ 23 ;Device 1 Baud Rate Selection Message Device2_Baud equ 24 ;Device 2 Baud Rate Selection Message Baud_Table equ 25 ;Baud Rate Selection Table Device_Table equ 26 ;Device Selection Table Startup equ 27 ;Start Up Message Exit_Message equ 28 ;Ending Message ;Non Printing Ascii Character Equates Control_C equ 3 ;Control C BackSpace equ 08h ;Back Space Tab equ 09h ;Tab Lf equ 0Ah ;Line Feed Cr equ 0Dh ;Carriage Return Esc equ 1Bh ;Escape Character Bright equ '(' ;Set High Screen Intensity Dim equ ')' ;Sel Low Screen Intensity page ;---------------------------------------------------------------------- ; Main Line (13_Oct_84) ;---------------------- ; Main_Line: call Get_Parameters ;Get the Initial Parameters cp Stop ;If (Response eq Stop) jp z,Bios_Entry ; Go Directly to Warm Boot call Install_Parameters ;Install Baud Rates and Handshaking call Setup_Pointers ;Set the Vector Tables ld a,StartUp call Print_Message ;Print the StartUp Message MlLp1: call Dev1_to_Que1 ;Loop Dev_Que1:= Device1 or a ; If (Error or Return) jr nz,MlDone ; Break call Que1_to_Dev2 ; Device2:= Dev_Que1 call Dev2_to_Que2 ; Dev_Que2:= Device2 or a ; If (Error or Return) jr nz,MlDone ; Break call Que2_to_Dev1 ; Device1:= Dev_Que2 jr MlLp1 MlDone: call Print_Message ;Print the Closing Message call Restore_Parameters ;Restore the original Parameters jp Bios_Entry ;Warm Boot page ;====================================================================== ; Get the Initial Parameters (14_Aug_84) ;======================================= ; Get_Parameters: ld a,Title_Block ;Title Block call Print_Message ld a,Device_Table ;Device Selection Table call Print_Message ld a,Device1_Select ;Device 1 Selection Message call Print_Message ld b,Max_Assgn ;B:= Device Number Limit for Assignment call Get_Response ;Get the User's Reponse cp Stop ;If (Reponse eq Stop) ret z ; Return ld (Dev1_Id),a ;Install Device Assignment for Device 1 ld a,Device2_Select ;Device 2 Selection Message call Print_Message ld b,Max_Assgn ;B:= Device Number Limit for Assignment call Get_Response ;Get the User's Reponse cp Stop ;If (Reponse eq Stop) ret z ; Return ld (Dev2_Id),a ;Install Device Assignment for Device 2 ld a,(Dev1_Id) ;If (Device 1 ne Console) or a jr z,MlSk1 ld a,Baud_Table ; Print Baud Rate Selection Table call Print_Message ld a,Device1_Baud ; Print Dev 1's Baud Rate Message call Print_Message ld b,Max_Baud ; B:= Max Number of Response call Get_Response ; Get the User's Reponse cp Stop ; If (Reponse eq Stop) ret z ; Return ld (Dev1_Baud_Rate),a ; Update the Baud Rate Value ld a,0FFh MlSk1: ld b,a ;B:= Flag (Not Zero means Table Printed) ld a,(Dev2_Id) ;If (Device 2 ne Console) or a jr z,MlSk3 ld a,b or a ; If (Table hasn't been Printed) jr nz,MlSk2 ld a,Baud_Table ; Print Baud Select Table call Print_Message MlSk2: ld a,Device2_Baud ; Print Dev 2's Baud Rate Message call Print_Message ld b,Max_Baud ; B:= Max Number of Response call Get_Response ; Get the User's Reponse cp Stop ; If (Reponse eq Stop) ret z ; Return ld (Dev2_Baud_Rate),a ; Update the Baud Rate Value MlSk3: ld a,0 ;A:= Ok to Continue ret ;Return page ;---------------------------------------------------------------------- ; Get the Response From the User (13_Oct_84) ;------------------------------------------- ; Get_Response: call Get_Character ;Loop Read a Character cp Control_C ; If (Response eq Control C) jr nz,GrSk1 ld a,Stop ; A:= Stop ret ; Return GrSk1: sub '0' ; Adjust Response to 0 base cp b ; If (Repsonse in Range) ret c ; Return call Erase_Character ; Else Delete the Character jr Get_Response ret ;---------------------------------------------------------------------- ; Erase a Character from the Console Screen (1_Oct_84) ;----------------------------------------------------- ; 1) This routine erases one character from the console screen. ; 2) None of the Registers are effected. ; Erase_Character: push af ld a,BackSpace call Put_Character ;Backup over the Character ld a,' ' call Put_Character ;Print a Space over the Character ld a,BackSpace call Put_Character ;Backup the cursor pop af ret ;Return page ;---------------------------------------------------------------------- ; Get a Character from the Console (1_Oct_84) ;-------------------------------------------- ; 1) This routine gets one character from the console device by ; vectoring through the bios jump table and then echoes the ; character by calling Put_Character. ; 2) Notice that Control Characters are echoed as spaces. ; 2) Register Usage: ; A -> On exit holds the character read ; ----> No other register effected ; Get_Character: push bc push de push hl ld de,(Bios_Entry+1) ld e,0 ;DE:= Base of Bios Jump Table ld hl,ConIn_Offset ;HL:= Offset to ConIn Jump in Bios Table add hl,de ;HL:= Pointer to ConIn Jump ld a,EB_Execute ;A:= Execute in the System Bank call Extended_Bios ;Get a Character push af cp 20h ;If (Character is Control) jr nc,GcSk1 ld a,' ' ; Echo a Space GcSk1: call Put_Character ;Echo the Character pop af pop hl pop de pop bc ret ;Return page ;---------------------------------------------------------------------- ; Put a Character to the Console (1_Oct_84) ;------------------------------------------ ; 1) This routine prints one character on the console screen by ; vectoring through the bios jump table. ; 2) Register Usage: ; A -> On entry and exit holds the character printed ; ----> No other register effected ; Put_Character: push bc push de push hl push af ld c,a ;C:= Character to Print ld de,(Bios_Entry+1) ld e,0 ;DE:= Base of Bios Jump Table ld hl,ConOut_Offset ;HL:= Offset to ConOut Jump in Bios Table add hl,de ;HL:= Pointer to ConOut Jump ld a,EB_Execute ;A:= Execute in the System Bank call Extended_Bios ;Print the Character pop af pop hl pop de pop bc ret ;Return page ;====================================================================== ; Install the User Selected Parameters (13_Oct_84) ;================================================= ; Install_Parameters: ld a,EB_Get_Chr_Tbl ;A:= Read Character Table Function ld de,Buffer ;DE:= Pointer to Local Buffer call Extended_Bios ;Read the Character Table push hl push de push bc ld hl,Buffer + 0 ;HL:= Start of Character Table ld de,Save_Baud_Rate ;DE:= Save Area for Original Baud Rates ld bc,3 ;BC:= Length of Baud Rate Area ldir ;Save the Current Baud Rates ld hl,Buffer + Hand_Off ;HL:= Start Char Table + HandShake Offset ld de,Save_Handshake ;DE:= Save Area for Handshaking Status ld bc,3 ;BC:= Length of HandShake Area ldir ;Save the Original HandShaking Status ld a,(Buffer + CFlag_Off) ld (Save_CFlag),a ;Save the Original Value of CFlag call Setup_Baud_Rates ;Setup the Baud Rate Values call Setup_HandShaking ;Setup the Handshaking Protocols pop bc poð de pop hl ld a,EB_Write_Sys ;A:= Write to System Memory Function ex de,hl ;Swap source and destination call Extended_Bios ;Restore the Character Table ld a,EB_Init_Ctc ;A:= Set Baud Rate Function call Extended_Bios ;Set the Baud Rates ret ;Return page ;---------------------------------------------------------------------- ; Setup the Baud Rate Values in the Character Table (13_Oct_84) ;-------------------------------------------------------------- ; Setup_Baud_Rates: ld a,(Dev1_Id) ;If (Device 1 is NOT the Console) or a jr z,IaSk1 ld e,a ld d,0 ; DE:= Offset ld hl,Buffer add hl,de ; HL:= Pointer to Dev_1's Baud ld a,(Dev1_Baud_Rate) ld (hl),a ; Install Device 1's Baud Rate IaSk1: ld a,(Dev2_Id) ;If (Device 1 is NOT the Console) or a jr z,IaSk2 ld e,a ld d,0 ; DE:= Offset ld hl,Buffer add hl,de ; HL:= Pointer to Dev_2's Baud ld a,(Dev2_Baud_Rate) ld (hl),a ; Install Device 2's Baud Rate IaSk2: ret ;Return ;---------------------------------------------------------------------- ; Setup the HandShaking Protocol (13_Oct_84) ;------------------------------------------- ; Setup_HandShaking: ld hl,Buffer + Hand_Off ;HL:= Start Char Table + HandShake Offset ld a,Default_HndShk ;A:= Default HandShaking Status ld b,3 ;B:= Counter ShLp1: ld (hl),a ;Repeat Install Default inc hl ; Pointer:= Pointer + 1 djnz ShLp1 ;Until (All HandShaking Values Init) ld a,Default_CFlag ld (Buffer + CFlag_Off),a ;Initialize CFlag ret ;Return page ;---------------------------------------------------------------------- ; Call the Bios Cold Boot Entry Point (10_Aug_84) ;------------------------------------------------ ; 1) The Cold Boot Entry point to the bios (1st entry in the bios ; jump table) is located by looking at locations 1 & 2 which ; point to the warm boot address (the desired address + 3). ; Extended_Bios: push hl ;Save the HL Register Pair ld hl,(Bios_Entry+1) ;HL:= Warm Boot Address ld l,0 ;HL:= Cold Boot Address ex (sp),hl ;Restore the HL Register Pair ret ;Goto The Cold Boot entry page ;====================================================================== ; Initialize the Pointer Blocks (14_Aug_84) ;=========================================== ; 1) This routine installs the vectors for Input/Output Data/Status for ; both devices 1 and 2. ; Setup_Pointers: ld a,(Dev1_Id) call Get_Vector ;HL:= Base of Device's Vectors ld de,Dev1_In_Stat ;DE:= Start of Device 1's Vector Table ld bc,8 ;BC:= Length of Vector Table ldir ;Move the Vector Table into Place ld a,(Dev2_Id) call Get_Vector ;HL:= Base of Device's Vectors ld de,Dev2_In_Stat ;DE:= Start of Device 2's Vector Table ld bc,8 ;BC:= Length of Vector Table ldir ;Move the Vector Table into Place ret ;Return ;---------------------------------------------------------------------- ; Set the HL Pointing to the Desired Vector Parameters (14_Aug_84) ;----------------------------------------------------------------- ; 1) This routine uses the Device Id (passed in the accm) to set ; the HL pair pointing to the start of its vector table. ; 2) Register Usage: ; A -> On Entry is the Device Id (0 to 2) ; DE -> Used in calculating offsets ; HL -> Returned pointing to the start of the Device's Vectors ; Get_Vector: sla a ;Id:= Id * 2 ld e,a ld d,0 ;DE:= Device Id * 2 ld hl,Dev_Lookup add hl,de ;HL:= Vector to Table ld e,(hl) inc hl ld d,(hl) ex de,hl ;HL:= Pointer to Devices Vectors ret ;Return page ;---------------------------------------------------------------------- ; Read a Byte from Device 1 and EnQue it (13_Oct_84) ;--------------------------------------------------- ; Dev1_to_Que1: ld hl,(Dev1_In_Stat) ;If (Device 1 Input ne ready) call Indirect_HL or a ret z ; Return ld hl,(Dev1_Input) call Indirect_HL ;Read the Character and 01111111b ;(mask off parity bit) ld b,a ld a,(Que1_In_Pntr) ;A:= Pointer to Device 1's Que ld c,a inc c ;C:= Next Que Position ld a,(Que1_Out_Pntr) ;Inc the Input Pointer cp c ;If (There's an OverRun) jr nz,D1qSk1 ld a,Err_OverFlow1 ; A:= Que 1 Overflow Error ret ; Return D1qSk1: ld a,c ld (Que1_In_Pntr),a ld hl,Dev_Que1 ;HL= Base of Que ld l,a ;HL:= Current Que Position ld (hl),b ;Enque the Character ld a,Esc ;If (Character ne Escape) cp b jr z,D1qSk2 ld a,0 ld (Esc1_Counter),a ; Reset the Escape Counter ret ; Return D1qSk2: ld a,(Esc1_Counter) ;Else inc a ld (Esc1_Counter),a ; Increment the Escape Count cp Max_Escapes ; If (Escape Count eq Max) ld a,Exit_Message ; A:= End Message ret z ; Return ld a,0 ; Else ret ; Return (0) page ;---------------------------------------------------------------------- ; Read a Byte from Dev_Que1 and Write it to Device 2 (13_Aug_84) ;--------------------------------------------------------------- ; Que1_to_Dev2: ld a,(Que1_Out_Pntr) ;HL:= Pointer to Input Pointer ld c,a ld a,(Que1_In_Pntr) cp c ;If (Input Pointer eq Output Pointer) ret z ; Return ld hl,(Dev2_Out_Stat) ;If (Device 2 eq Busy) call Indirect_HL or a ret z ; Return inc c ld a,c ld (Que1_Out_Pntr),a ;Update the Output Que Pointer ld hl,Dev_Que1 ;HL:= Pointer to Base of Que ld l,c ;HL:= Pointer to Current Element ld c,(hl) ld hl,(Dev2_Output) ;Output the Current Character call Indirect_HL ret ;Return page ;---------------------------------------------------------------------- ; Read a Byte from Device 2 and EnQue it (13_Oct_84) ;--------------------------------------------------- ; Dev2_to_Que2: ld hl,(Dev2_In_Stat) ;If (Device 2 Input ne ready) call Indirect_HL or a ret z ; Return ld hl,(Dev2_Input) call Indirect_HL ;Read the Character and 01111111b ;(mask off parity bit) ld b,a ld a,(Que2_In_Pntr) ;A:= Pointer to Device 2's Que ld c,a inc c ld a,(Que2_Out_Pntr) ;Inc the Input Pointer cp c jr nz,D2qSk1 ld a,Err_OverFlow2 ; Que 2 Overflow ret ; Return D2qSk1: ld a,c ld (Que2_In_Pntr),a ld hl,Dev_Que2 ;HL= Base of Que ld l,a ;HL:= Current Que Position ld (hl),b ;Enque the Character ld a,Esc ;If (Character ne Escape) cp b jr z,D2qSk2 ld a,0 ld (Esc2_Counter),a ; Reset the Escape Counter ret ; Return D2qSk2: ld a,(Esc2_Counter) ;Else inc a ld (Esc2_Counter),a ; Increment the Escape Count cp Max_Escapes ; If (Escape Count eq 2) ld a,Exit_Message ; A:= Ending Message ret z ; Return ld a,0 ; Else ret ;Return page ;---------------------------------------------------------------------- ; Read a Byte from Dev_Que2 and Write it to Device 1 (13_Aug_84) ;--------------------------------------------------------------- ; Que2_to_Dev1: ld a,(Que2_Out_Pntr) ;HL:= Pointer to Input Pointer ld c,a ld a,(Que2_In_Pntr) cp c ;If (Input Pointer eq Output Pointer) ret z ; Return ld hl,(Dev1_Out_Stat) ;If (Device 2 eq Busy) call Indirect_HL or a ret z ; Return inc c ld a,c ld (Que2_Out_Pntr),a ;Update the Output Que Pointer ld hl,Dev_Que2 ;HL:= Pointer to Base of Que ld l,c ;HL:= Pointer to Current Element ld c,(hl) ld hl,(Dev1_Output) ;Output the Current Character call Indirect_HL ret ;Return page ;====================================================================== ; Restore the Baud Rates, HandShaking and Cflag (13_Oct_84) ;========================================================== ; Restore_Parameters: ld a,EB_Get_Chr_Tbl ;A:= Read Character Table Function ld de,Buffer ;DE:= Pointer to Local Buffer call Extended_Bios ;Read the Character Table push hl push de push bc ld hl,Save_Baud_Rate ;HL:= Save Area for Original Baud Rates ld de,Buffer + 0 ;DE:= Start of Character Table ld bc,3 ;BC:= Length of Baud Rate Area ldir ;Save the Current Baud Rates ld hl,Save_Handshake ;HL:= Save Area for Handshaking Status ld de,Buffer + Hand_Off ;DE:= Start Char Table + HandShake Offset ld bc,3 ;BC:= Length of HandShake Area ldir ;Restore Original HandShaking Status ld a,(Save_CFlag) ;Save the Original Value of CFlag ld (Buffer + CFlag_Off),a ;Restore the Original Value of CFlag pop bc poð de pop hl ld a,EB_Write_Sys ;A:= Write to System Memory Function ex de,hl ;Swap source and destination call Extended_Bios ;Restore the Character Table ld a,EB_Init_Ctc ;A:= Set Baud Rate Function call Extended_Bios ;Set the Baud Rates ret ;Return ;---------------------------------------------------------------------- ; Execute Indirectly through the HL register pair (11_Aug_84) ;------------------------------------------------------------ ; Indirect_HL: jp (hl) page ;---------------------------------------------------------------------- ; Serial Port 1 - (Default Console Device) Drivers (11_Jul_84) ;------------------------------------------------------------ ; Ser1_Input_Status: in a,(S1Stat) and $RcvRdy ;If (Reciever Status ne Ready) ret z ; Return 0 ld a,0FFh ;Else ret ; Return 0FFh Ser1_Input: call Ser1_Input_Status ;Repeat jr z,Ser1_Input ;Until (Input Port is Active) in a,(S1Data) ;A:= Input Character ret Ser1_Output_Status: in a,(S1Stat) and $TxRdy ;If (Transmitter Buffer ne Ready) ret z ; Return 0 ld a,0FFh ;Else ret ; Return 0FFh Ser1_Output: call Ser1_Output_Status ;Repeat jr z,Ser1_Output ;Until (Transmitter Buffer eq Ready) ld a,c ;(move character to output to Accm) out (s1data),a ;Output the Character ret ;Return page ;---------------------------------------------------------------------- ; Serial Port 2 - (Default List Device) Drivers (11_Jul_84) ;---------------------------------------------------------- ; Ser2_Input_Status: in a,(S2Stat) and $RcvRdy ;If (Reciever Buffer ne Ready) ret z ; Return 0 ld a,0FFh ;Else ret ; Return 0FFh Ser2_Input: call Ser2_Input_Status ;Repeat jr z,Ser2_Input ;Until (Reciever Buffer eq Ready) in a,(S2Data) ;A:= Input Character ret ;Return Ser2_Output_Status: in a,(S2Stat) and $TxRdy ;If (Transmitter Buffer ne Ready) ret z ; Return 0 ld a,0FFh ;Else ret ; Return 0FFh Ser2_Output: call Ser2_Output_Status ;Repeat jr z,Ser2_Output ;Until (Transmitter Buffer eq Ready) ld a,c ;(move character to output into Accm) out (S2Data),a ;Output the Character ret ;Return page ;---------------------------------------------------------------------- ; Serial Port 3 (Default Auxilary Device) Drivers (11_Jul_84) ;------------------------------------------------------------ ; Ser3_Input_Status: in a,(S3Stat) and $RcvRdy ;If (Reciever Buffer ne Ready) ret z ; Return 0 ld a,0FFh ;Else ret ; Return 0FFh Ser3_Input: call Ser3_Input_Status ;Repeat jr z,Ser3_Input ;Until (Reciever Buffer eq Ready) in a,(s3data) ;A:= Input Character ret ;Return Ser3_Output_Status: in a,(S3Stat) and $TxRdy ;If (Transmitter Buffer ne Ready) ret z ; Return 0 ld a,0FFh ;Else ret ; Return 0FFh Ser3_Output: call Ser3_Output_Status ;Repeat jr z,Ser3_Output ;Until (Transmitter Buffer eq Ready) ld a,c ;(move character to output into Accm) out (S3Data),a ;Output the Character ret ;Return page ;====================================================================== ; Print a Message on the Console (13_Oct_84) ;=========================================== ; 1) This routine prints the message string, whose code is passed in the ; accm, on the console. ; 2) Register Usage: ; A -> Has Message Code on entry ; B -> Counter ; C -> Holds copy of Message Code ; DE -> Used to hold pointers/Bdos print string functions ; HL -> Used to hold pointers ; Print_Message: ld c,a ;C:= Message Code to Find ld b,Max_Message ld hl,Message_Table ;HL:= Start of the Message Table PmLp1: ld a,(hl) ;Repeat A:= Table's Message Code inc hl ld e,(hl) inc hl ld d,(hl) ; DE:= Pointer to String inc hl ; (HL equal to start next entry) cp c ; If (Code eq table) jr z,Pmprn ; Goto Print djnz PmLp1 ;Until (the whole tables been checked) ld de,NoCode ;(Pointer:= 'Unrecognized Message') PmPrn: ld c,Bdos_PString ; call Bdos_Entry ; Print the Message ret page ;---------------------------------------------------------------------- ; Data Area for Report Errors (13_Oct_84) ;---------------------------------------- ; Message_Table: db Title_Block ;Title Block dw TBmsg db Device1_Select ;Device 1 Selection Message dw D1msg db Device2_Select ;Device 2 Selection Message dw D2msg db Device1_Baud ;Device 1 Baud Rate Selection Message dw B1msg db Device2_Baud ;Device 2 Baud Rate Selection Message dw B2msg db Baud_Table ;Baud Rate Selection Table dw BSmsg db Device_Table ;Device Selection Table dw DSmsg db Err_OverFlow1 ;Que 1 Has OverFlowed dw O1err db Err_OverFlow2 ;Que 2 Has OverFlowed dw O2err db StartUp ;StartUP Message dw STmsg db Exit_Message ;Sign_Off Message dw DnMsg End_Table: Max_Message equ ( (End_Table - Message_Table)/3 ) + 1 page ;---------------------------------------------------------------------- ; Message Strings (13_Oct_84) ;---------------------------- ; O1err: db Esc,Bright db 'Error -> Device 2 Has not Responded in Time $' O2err: db Esc,Bright db 'Error -> Device 1 Has not Responded in Time $' TBmsg: db 1Ah,Esc,Dim,Cr db 'MD-HD ' db Esc,Bright db 'Serial Port Redirection ' db Esc,Dim db 'Rev ' db ((rev and 0F0h) shr 4) + '0', '.', (rev and 0Fh) + '0' db Tab,Tab,Tab,Tab,' Copyright 1984' db cr,lf,'Morrow Designs Inc.' db Tab,Tab,Tab,Tab,Tab,Tab,'San Leandro, Ca $' DSmsg: db Esc,Bright,Cr,Lf,Lf,Tab db 'Device Assignments:' db Esc,Bright,Cr,Lf,Lf,Tab,Tab db '0' db Esc,Dim db ' - Console' db Esc,Bright,Cr,Lf,Tab,Tab db '1' db Esc,Dim db ' - List' db Esc,Bright,Cr,Lf,Tab,Tab db '2' db Esc,Dim db ' - Aux' db Cr,Lf,'$' D1msg: db Esc,Bright,Cr,Lf,Tab db 'Device 1 ' db Esc,Dim db 'Assignment ' db Esc,Bright,'$' D2msg: db Esc,Bright,Cr,Lf,Tab db 'Device 2 ' db Esc,Dim db 'Assignment ' db Esc,Bright,'$' BSmsg: db Esc,Bright,Cr,Lf,Lf,Lf,Tab db 'Baud Rate Selection:' db Esc,Bright,Cr,Lf,Lf,Tab,Tab db '0' db Esc,Dim db ' - 110' db Esc,Bright,Tab,Tab db '4' db Esc,Dim db ' - 2400' db Esc,Bright,Cr,Lf,Tab,Tab db '1' db Esc,Dim db ' - 300' db Esc,Bright,Tab,Tab db '5' db Esc,Dim db ' - 4800' db Esc,Bright,Cr,Lf,Tab,Tab db '2' db Esc,Dim db ' - 600' db Esc,Bright,Tab,Tab db '6' db Esc,Dim db ' - 9600' db Esc,Bright,Cr,Lf,Tab,Tab db '3' db Esc,Dim db ' - 1200' db Esc,Bright,Tab,Tab db '7' db Esc,Dim db ' - 19200' db Cr,Lf,'$' B1msg: db Esc,Bright,Cr,Lf,Tab db 'Device 1 ' db Esc,Dim db 'Baud Rate ' db Esc,Bright,'$' B2msgº db Esc,Bright,Cr,Lf,Tab db 'Device 2 ' db Esc,Dim db 'Baud Rate ' db Esc,Bright,'$' STmsg: db 1Ah,Esc,Dim,Cr db 'Type ' db Esc,Bright db (Max_Escapes and 0Fh) + '0' db ' Escapes ' db Esc,Dim db 'when you want to Return to CP/M' db Esc,Bright,Cr,Lf,'$' NoCode: db Esc,Bright db 'Unrecognized Message $' Dnmsg: db Esc,Bright,Cr,Lf,Lf db 'Restoring Parameters and Returning to CP/M ' db Cr,Lf,'$' page ;---------------------------------------------------------------------- ; Data Area (13_Oct_84) ;---------------------- ; ; Initialization Data ;-------------------- ; ;Device Id's (0=Console, 1=List, 2=Aux) Dev1_Id: db 0 Dev2_Id: db 0 ;Baud Rate Settings Dev1_Baud_Rate: db 0 ;Baud Rate Setting For Device 1 Dev2_Baud_Rate: db 0 ;Baud Rate Setting For Device 2 ;Save Locations Save_Baud_Rate: ds 3,0 ;Save Area for Original Baud Rates Save_Handshake: ds 3,0 ;Save Area for Original Handshaking Status Save_CFlag: db 0 ;Save Location for CFlag ;Device Vector Lookup Table Dev_Lookup: dw Dev1_Tbl dw Dev2_Tbl dw Dev3_Tbl Dev1_Tbl: dw Ser1_Input_Status dw Ser1_Input dw Ser1_Output_Status dw Ser1_Output Dev2_Tbl: dw Ser2_Input_Status dw Ser2_Input dw Ser2_Output_Status dw Ser2_Output Dev3_Tbl: dw Ser3_Input_Status dw Ser3_Input dw Ser3_Output_Status dw Ser3_Output ; Run Time Variables ;------------------- ; ;Device 1 Vector Table (Default is Console) Dev1_In_Stat: dw Ser1_Input_Status ;Input Status Dev1_Input: dw Ser1_Input ;Input a Character Dev1_Out_Stat: dw Ser1_Output_Status ;Output Status Dev1_Output: dw Ser1_Output ;Output a Character ;Device 2 Vector Table (Default is Aux) Dev2_In_Stat: dw Ser3_Input_Status ;Input Status Dev2_Input: dw Ser3_Input ;Input a Character Dev2_Out_Stat: dw Ser3_Output_Status ;Output Status Dev2_Output: dw Ser3_Output ;Output a Character ;Escape Counters Esc1_Counter: db 0 ;Escape Counter for Device 1 Esc2_Counter: db 0 ;Escape Counter for Device 2 ;Que Pointers Que1_In_Pntr: db Max_Escapes + 1 ;Device 1 Input Que Position Que1_Out_Pntr: db 0 ; " 1 Output " " Que2_In_Pntr: db Max_Escapes + 1 ;Device 2 Input Que Pointer Que2_Out_Pntr: db 0 ; " 2 Output " " ; Local Data Storage ;------------------- ; ;Ques ds ( ($ and 0FF00h) + 100h) - $,0 Dev_Que1: ds Max_Escapes,7Fh ds 100h - Max_Escapes,Cr Dev_Que2: ds Max_Escapes,7Fh ds 100h - Max_Escapes,Cr ;Local Buffer Buffer: db 0 ;Local Buffer for Reading Char Table end