80-Bus News


September-October 1984, Volume 3, Issue 5

Page 16 of 47

3; PIO port B to mode 1, input

ld a,4fh out (pe2),a 5; Interrupt control word – enable interrupts for port B 1d a,87h out Cpe2),a

5; Dummy read to start handshake

; BC is st2:

in a,(pd2) endif

PLO is now ready

used to point to the end of the buffertl ld be,(abdos)

; Set up work area


push be

ld hl ,head ld de,work ld be ,headl ldir

pop be

; Set number of bytes spare


; HL is

; Reset

ld hl,stk ; Start of buffer push hl

call sparep

ine hl

or a

sbe hl,be

add hl,be

jr nz,siz

used to point to character to be output pop hl 3; Set to start of buffer

used to point to position to store input ld d,b 3 Set to end of buffer ld e,c

dec de

bit 7 to not represent compressed blanks xor a

ld (de),a

3; Scan for keyboard input


push hl push de push be

ld e,0ffh ld c,conio call jbdos pop be

pop de

pop hl

or a

jr z,noin ep "a" 3; Accept lower case drvoc,yinl and 5fh 3 If "D" restart with empty buffer yinl: cp "Dp" jr a,st2 3 Tf "T" restart with 2 byte buffer ep vqet jr nz,yin2 ld be,stk+2 jr st3 ; Lf "N" return to RP/M yin2: cp "N" jr nz,yin3 1d a,07h 3 RS232, ROM out Cuartm) ,a ret ; If CR output CR/LF to printer yin3: ep cr jr nz,yin4 push hl push de push be ld de,her fr yind 3; 1£ "M" output message to printe yin4: ep "M" jr nz,yin6 push hl push de push be ld de,work yinS: ld c,prts call jbdos jv yine 3; If " " flip "Halted" yine: ep" s Space entered jv nz,yin8 push hl push de push be ld de,headh 3 Move to work area ld be,6 ld a,(de) cp Wout ld hl,haltm 3; Move "Halted" jr 2,yin7 ld hl ,hh ; Move spaces yin7: ldir yine: pop be

tinx: jr tin


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

Page 16 of 47