80-Bus News


May-June 1983, Volume 2, Issue 3

Page 41 of 59

we en em em ew

wm Oe em ae en em om oe

a-vee-- Start of program listing -----

page 60

title TERMB Buffered Terminal Program

+280 Program for a simple half or full duplex terminal. Operates at slow and fast speeds. Tested at up to 9600 bps. Execute with command TERM H for half duplex, otherwise it is full duplex. Type Control-C to exit to CP/M. Patch 0103H to change this character. Type Control-P to toggle printer. Patch O104H to change this character.

Configuration is Gemini IVC for display and keyboard.

The UART is an 8250, or a 6402.

The printer may be either the CP/M list device, or a serial printer which may have an 8250 or 6402 UART.

If the printer is the CP/M list device, then this must be fast enough to keep up with the input data.

Code could be added for a Centronics printer, scanning for serial input while waiting for the printer to be ready.

false equ 0 true equ not false

. ’

u8250 equ false

UART type – 8250 if true, 6402 if false UART to host/modem

5 p8250 = equ false ; UART for serial printer, if selected

‘ Y

Printer type – CP/M list device if true, serial printer if false

epml equ false


Ports for UART to host/modem if u8250

uartd equ Obd8h 3 Data ;

uarts equ uartd+5

uartd equ ith uarts equ uartd+{

: ’

puartd equ ObSh

Status else

Data Status


3 endif

Ports for serial printer

if p8250 Data

$ puarts equ puartd+5 3; Status

puartd equ Oth puarts equ puartd+{



Data Status endif

Ports for IVC

pyvdud equ Obth 3; Data :

pyvdus equ Ob2h

: ’

ichex equ conc


Keyboard command characters Exit to CP/M

5 ichpr equ conp 3; Toggle printer

* ?


condir equ 6 jwboot equ 0000h Jbdos equ 0005h


’ co

bell equ O7h


lf equ Oah er equ Odh

co. es

cul equ ich

. y

chex: defb ichex chpr: defb ichpr

ab ob sp

param: defb 0 vbusy: defb 0




: ’

. ,

* 5


. $



CP/M routines st equ 5 List output

Direct console I/0 Warm boot



om ne ee an am

equ 005dh


ne equ O3h Control-c



Line feed Carriage return Control-P Escape

Cursor left

equ O8h

np equ 10h e equ tbh

oe a

Working storage

Exit to CP/M -- can patch this value Toggle printer – can patch this value Input position in buffer

Output position in buffer

Printer toggle – 0 to not print

H for half duplex, otherwise full duplex

FF when VDU is busy answering keyboard request Stack

uf: defw buffer uf: defw buffer rt: defb 0

see ER ee em em en ee

defs 32 ack:

Start art: 1d sp,stack

Load parameter entered in command line ld a,(f1) 1d (param),a

Start of main processing loop

Sean for serial input rm2: call serin

Examine buffer rm3: 1d hl, (abut) ld de, (obuf) ora sbe hl,de jr nz,term3a 1d hl, buffer ; Empty, so reset buffer ld (abuf),hi ld (obuf),hl jr term6 rm3a: 1d a, (de) ; Get char from buffer inc de ld (obuf),de


This is an OCR’d version of the scanned page and likely contains recognition errors.

Page 41 of 59