Dosound
Start Sound Interrupt Processing
Dosound() Opcode = 32
T he D o s o u n d () fu n c tion en ab les an in terru p t-d riv e n rou tin e th at ca n play
m u sic o r so u n d effects in th e b ack g ro u n d .
C macro format
lo ng c om m an d list;
D o so u n d (co m m an d list);
Machine language format
m o ve .l co m m an d list, - (sp )
m o v e, w # 3 2 , - (sp )
trap # 1 4
ad d q .l # 6 ,s p
Inputs
co m m a n d list lo n g A p o in te r to a d ata sto rag e are a th a t co n tain s a
n u m b er o f qu eu ed so u n d c o m m an d s, o n e of w h ich
is e x ec u te d ea ch 1 /5 0 o f a se c o n d .
T h e co m m an d stru ctu re is:
(Command Number)
First Byte Second Byte
Third Byte Fourth Byte
0 - 1 5 L o ad a T h e b y te v alu e
b yte v alu e in to
to lo ad in to the
th e re giste r
reg iste r (0 -2 5 5 ).
specified b y this
co m m an d b y te.
(0 -1 5 )
128 S to re a
T h e by te v alu e
va lu e in a
to sto re in th e
te m p o ra ry
te m p o ra ry
reg ister fo r u se re gis ter (0 -2 5 5 ).
b y co m m a n d
T h is is th e
n u m b er 129 (see
sta rtin g reg ister
b elo w ). v alu e for
co m m an d 129 .
129 L oa d a
T h e n u m b er of In cre m e n t v alu e Final reg is ter
reg ister w ith th e
th e re gister to
(0 -2 5 5 ). A d d ed value .
va lu e sto re d in
u se . (0 -1 5 ) to re g iste r va lu e
C o m m an d e n d s
th e te m p o ra ry
e ach tim e r tick.
w h en th is v alu e
reg iste r (by C an b e p o sitiv e
is rea ch ed .
co m m an d 128).
(0 -1 2 7 ) o r
In cre m e n t th e
n eg ativ e.
v alu e in th e
reg iste r eac h
tim e r tick , until
an en d v alu e is
rea ch ed .
225