Bconstat
Get Input Device Status
Bconstat() Opcode = 1
T his fu n ctio n allow s y o u to d ete rm in e w h e th e r th ere is a ch a ra cte r w aitin g
to be rece iv ed fro m a p articu lar in p u t d ev ice . S ince th e C o n in () call
d o e sn 't re tu rn un til a ch a ra cte r h as b een re ceiv ed , B c o n s ta t () can b e u sed
to in su re th at a call to C o n i n () w ill retu rn im m e d iately .
C macro format
in t d ev n u m ;
lo n g statu s;
statu s = B co n sta t(d ev n u m );
Machine language format
m o v e .w # d e v n u m , - (sp )
m o v e .w # 1 , - (sp )
trap # 1 3
a d d q .l # 4 ,s p
Inputs
d ev n u m w o rd T h e d ev ice n u m b er of th e in p u t d ev ice to
ch eck :
1 = A U X : (R S-2 32 po rt)
2 = C O N : (C o n so le k e yb oard )
3 = M ID I: (M ID I in pu t)
Results
DO s ta tu s lo n g In p u t sta tu s o f th e d ev ice
0 = n o ch ara cte rs rea d y
- 1 = o n e o r m o re ch ara cte rs rea d y
See also
B c o n in (), B c o s ta t(), B c o n o u t ()
176