Tandy 1000 Programmer's Reference Manual page 35

Hide thumbs Also See for 1000:
Table of Contents

Advertisement

Chapter 1
I
System Calls
StdC onInput
Keyboard Input
Function Call OIH
Waits for a character to be typed at the keyboard, then
echoes the character to the display and returns it in AL.
If
the
character
is
CONTROL-C,
Interrupt
23H
is
executed.
Entry Conditions:
AH
=
OIH
E xi t Conditions
:
AL
=
character typed
Macro Definition:
r e a d - k b d - a n d - e c h o
m a c r o
mov
a h ,
O I H
int 2 1 H
e n d m
Example:
The following program displays and prints characters as
they are typed. If
[ENTER]
is pressed, the program sends a
Line-FeedKarriage-Return t o
both
the
display
and
the
printer.
f u n c - O I H :
r e a d - k b d - a n d - e c h o
; T H I S F U N C T I O N
p r i n t - c h a r
a 1
; 5 e e
F u n c t i o n 0 5 H
C m P
a l , 0 D H
; 1 5
i t
a
C R ?
1 n e
f u n c - O I H
; n o , p r i n t
i t
p r i n t - c h a r
1 0
; 5 e e
F u n c t i o n 0 5 H
d i s p l a y - c h a r
1 0
; 5 e e
F u n c t i o n 0 2 H
I m p
f u n c - 0 l H
;get
a n o t h e r c h a r a c t e r
33

Advertisement

Table of Contents
loading

Table of Contents