beautypg.com

Zilog Z80195 User Manual

Page 36

background image

Z80185/195 D

EVELOPMENT

K

IT

U

SER

'

S

M

ANUAL

3-16

UM951800100

Z

ILOG

RST 20H Services

The monitor program offers a number of console I/O services using the RST 20 instruction. These
services have advantages over direct I/O to the ASCI or ESCC registers—they implicitly use the
console port that the user has selected.

Prior to the RST 20h, the user should set the B register to identify the services required, from the
following list. No registers are changed except as indicated.

The TSTRST20. HEX program, which is on the Z80185 Source Diskette, can be used to test the RST
20 instruction.

(B)

Name

Service Performed

0

out_char

Waits, if necessary, for monitor console device to be ready for output,
then outputs the ASCII character in A. A is not changed.

1

in_char

Waits, if necessary, for user to press a key on the monitor console
device; returns its ASCII value in A.

2

test_char

Returns NZ condition code if user has pressed a key on the monitor
console device, else returns Z. A is not changed.

3

out_a

Waits, if necessary, for monitor console device to be ready for output,
then outputs the 8-bit hexadecimal value in A. A is changed.

4

out_hl

Waits, if necessary, for monitor console device to be ready for outputs,
then outputs the 16-bit value in HL. A is changed.

5

in_hl

Waits for user to enter a hexadecimal value on the monitor console
device, and returns it in HL. Terminating characters are as in monitor
hex entry; the terminating character is returned in A.

6

message

Outputs a null-terminated string—pointed to by HL—on the monitor
console device. HL is advanced over the terminating null. A is not
changed.