Crawio
Input/Output Console Character
Crawio() Opcode = 6 ($06)
T his fu n ctio n a llo w s y o u e ith er to se n d ch a rac te rs to th e con so le d ev ice, o r
to receiv e th em . T h e re ceiv e ch a ra cte r p o rtio n of th e fu n ctio n d o es n o t
w ait fo r a c h a ra cte r to b ec o m e availab le, b u t retu rn s im m e d iate ly w h e th er
o r n o t on e w a s re ceiv ed .
C macro format
in t ch in , ch o u t;
ch in = C ra w io (ch ou t);
Machine language format
m o v e.w ch o u t, - (sp )
m o v e.w # 6 , - ( s p )
trap # 1
ad d q .l # 4 ,s p
Inputs
ch o u t w o rd T he lo w b y te of th is w o rd eith e r co n tain s
an A SC II ch a ra cte r 0 - 2 5 4 to sen d to th e
sc ree n , o r a valu e of 2 5 5, w h ic h in dicates
th a t a ch ara cte r is to be re ceiv ed .
Results
DO ch in w o rd If chout w as se t to 25 5, th e v alu e of th e ch ar a cte r re ad
fro m th e k ey b oa rd is re tu rn e d h ere . If n o ch a rac te r
w a s availab le, a 0 is re tu rn e d in b oth b y tes. If a ch a r
a cte r c an be re a d , th e lo w b y te co n ta in s its A SC II
v alu e, a n d th e h ig h b yte co n ta in s its sca n co d e.
245