Title Test of the Graphics for an Mt-70 terminal (7_Dec_84) .z80 aseg org 0100h ;---------------------------------------------------------------------- ; Equates ;-------- ; ;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 ;Ascii Non_Printing Characters Lf equ 0Ah ;Line Feed Cr equ 0Dh ;Carriage Return Esc equ 1Bh ;Escape Code Sp equ 20h ;Space ;---------------------------------------------------------------------- ; Main Line ;---------- ; Main_Line: ld hl,Test_String call Print_String ;Print the Graphics String ld hl,Start_String call Print_String ;Print the Opening String ld hl,Local_Buffer ;HL:= Start of Local Buffer ld b,80 ;B:= Counter MlLp1: call Ser1_Input ;Repeat Get a Character ld (hl),a ; Save it in the Local Buffer inc hl ; Increment the Storage Pointer djnz MlLp1 ;Until (All 80 characters read) jp 0 ;Goto Cp/m ;---------------------------------------------------------------------- ; Print the String Pointed to by the HL Register Pair (5_Dec_84) ;--------------------------------------------------------------- ; Print_String: OsLp1: ld a,(hl) ;While (End_String ne 0) or a ret z ld c,a ; C:= Character to Print call Ser1_Output ; Print the Character inc hl ; Increment the Pointer jr OsLp1 ;---------------------------------------------------------------------- ; 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 ;---------------------------------------------------------------------- ; Data Area ;---------- ; Test_String: db Cr,Lf,'This is a Test Only a Test.........' db '............................................!',0Bh,0 Start_String: db Esc,'>',0 ds 0200h - $,0 Local_Buffer: ds 0100h,1 end