EasyManua.ls Logo

Atari ST series - Page 213

Atari ST series
420 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Iorec
Get I/O Buffer Record
Iorec() Opcode = 14
I o r e c () re tu rn s th e ad d re ss o f a d ata stru ctu re k n ow n as th e I/O bu ffer re
c o rd , c on tain s in fo rm a tio n a b o u t th e in p u t bu ffer u sed b y a sp ecified d e
v ice.
C macro format
in t d ev ;
lo n g b u frec;
b u frec = Io re c(d ev );
Machine language format
m o v e.w # d e v , - (sp )
m o v e .w # 1 4 , - ( s p )
trap # 1 4
ad d q .l # 4 ,s p
Inputs
d e v w o rd T h e in p ut d ev ic e w h ose bu ffer re co rd yo u
w ish to fin d:
0 = R S -232 serial p o rt
1 = C o n so le k ey bo ard
2 = M ID I p o rt
Results
DO b u frec lo n g T h e ad d re ss of th e d e v ice 's b uffer reco rd .
T his re co rd co n tain s 1 4 b y te s of d ata, in th e form at.
T h e co n te n ts of th e d ev ice 's bu ffer reco rd p o in te d to b y bufrec:
Byte Number Element Name Contents
0 - 3 ib uf A d d re ss o f th e in p u t bu ffer
4 - 5 ibu fsize Size of th e in p u t bu ffer (in b ytes)
6 - 7 ib ufh d In de x to h e ad (n ex t w rite p ositio n)
8 - 9 ibuftl In d ex to tail (n e x t rea d p ositio n)
1 0 -1 1 ibu flow Low water m a rk
1 2 -1 3 ib ufhi High water m ark
F or th e R S-232 d ev ice o n ly , an o u tp u t b u ffe r re co rd fo llow s im m ed iately
after th e in pu t bu ffer re co rd .
205