Intel i86W Manual page 192

Table of Contents

Advertisement

PROGRAMMING EXAMPLES
Table 9-3. Accumulator Initialization Table
Table Values
Alignment
*mZ
*mR
*mG
*mB
0
-1,
-3
-1,
-2,
-3,
2
-2,
-4
-2
-3,
-4,
4
-3,
-5
-3,
-4,
-5,
6
-4,
-6
-4,
-5,
-6,
II ACCUMULATOR INITIALIZATION TABLE
.data; .align .double
acc_init_tab::
.double [16] 0
.dsect
-4
-1,
-2,
-5
-2,
-3,
-6
-3,
-4,
-7
-4,
-5,
aBi:
.double
aGi:
. double
aRi:
. double
aZi:
.double
II Four initial 16-bit blue values
II Four initial 16-bit green values
II Four initial 16-bit red values
II Two initial 32-bit Z values
.end
.text
II INITIALIZE ACCUMULATORS
·macro acc_init
Lalign, Rtab, Rx, Ry, Fx, Fxh
-3,
-4,
-5,
-6,
II
Lalign -- left-end alignment C0 .. 3) in two-byte units
II
Rtab
-- register to use for addressing the table
II
Rx, Ry, Fx, Fxh -- scratch registers
mov
acc_init_tab,
Rtab
II
-4
-5
-6
-7
shl
5,
Lalign, Lalign
II Multiply by row width
-1,
-2,
-3,
-2,
-3,
-4,
-3,
-4,
-5,
-4,
-5,
-6
adds
Lalign, Rtab,
Rtab
II Index row corresponding to alignment
fld·d
aZiCRtab),
aZ
II Z
ixfr
Zl,
Fx
II Z
fld.d
aRiCRtab),
aR
II R--Load constant values
shl
16,
Redl,
Rx
II R--Shift startingvalue to hi-order
fmov.ss
Fx,
Fxh
II Z
shr
16,
Rx,
Ry
II R--Redl stripped of sign bits
fiadd.dd
Fx,
aZ,
aZ
II Z
or
Rx,
Ry,
Ry
II R--Form CRedl,Redl)
ixfr
Ry,
Fx
II R--Put in 64-bit register
fld.d
aGiCRtab),
aG
II G
shl
16,
Grnl,
Rx
II G
fmov.ss
Fx,
Fxh
II R--Form CRedl,Redl,Redl,Redl)
shr
16,
Rx,
Ry
II G
fiadd.dd
Fx,
aR,
aR
II R--Add variables to constants
or
Rx,
Ry,
Ry
I I
G
ixfr
Ry,
Fx
II G
fld.d
aBiCRtab),
aB
II
B
shl
16,
Blul,
Rx
II B
fmov.ss
Fx,
Fxh
II
G
shr
16,
Rx,
Ry
I I
B
fiadd.dd
Fx,
aG,
aG
II G
or
Rx,
Ry,
Ry
II
B
ixfr
Ry,
Fx
II
B
fmov.ss
Fx,
Fxh
II B
fiadd.dd
Fx,
aB,
aB
II
B
.endm
Example 9-20. Accumulator Initialization
9-30
-4
-5
-6
-7

Advertisement

Table of Contents
loading

Table of Contents