Setcolor
Set Color Register
Setcolor() Opcode = 7
T his fu nctio n allo w s y o u to ch a n g e th e co lo r in a s in g le h ard w a re co lo r
reg ister.
C macro format
in t o ld co lo r, re giste r, n ew c o lo r;
o ld colo r = S etco lo r(reg ister, n e w co lo r);
Machine language format
m o v e.w # n e w c o lo r, - (sp )
m o v e .w # re g is te r, - (s p)
m o v e.w # 7 , - (sp)
trap # 1 4
ad d q .l # 6 ,s p
Inputs
n ew co lor w o rd
reg iste r
w o rd
A 1 6-b it w o rd in dicating th e n ew co lo r
for th e re giste r. Bits 0 - 3 are u sed fo r th e
b lue c o m p o n en t, bits 4 - 7 for g re en , a n d
bits 8 - 1 1 fo r re d . A n eg ativ e va lu e in di
c ates th at yo u d o n 't w ish to ch an g e th is
reg iste r, b u t on ly to re ad its cu rren t co n
te n ts.
T h e n u m b er o f th e h ard w a re co lo r reg is
te r to ch an g e .
Results
DO o ld co lo r lo n g T he va lu e co n tain ed in th e co lo r re g iste r p rior to
th e call.
See also
S e tp a le tte ()
198