User's Manual

iAPX286
MACRO
ASSEMBLER
LOC
OBJ
0007
98
aooa
8S46FA
0000
2DCl
0000
7722
OODF
DF46FC
00E2
SaFe!
00E4
BOEAFE
aOE7 DB6EFO
OOEA
D9FD
aOEe
0001
OOEe
D9FC
OOFO
0809
OOFe!
9BDD7EFE
00F6
F146FE0040
00F9
7550
OOFO
0008
DOFF BnOb
0101
0101
8907
0103
F708
0105
EBOOOO
0108
OD6EFO
010/3 DEC9
0100
813FI
0101='
01E6
0111
01E6
011:3
0lE6
0115
OF46FC
0118
DEC2
OIIA
D9FD
011C
0009
011E
011E
2EDC940eoo
0123
9BDFEO
0126
A90041
0129
750C
0129
2EOE360000
0130
BaE2FD
01:33
FF07
0135
E814
0137
0137
2EOC940000
013C
9DDFEO
013F
A90001
0142
7401
0144
:2EOEOeOOOO
0149
FFOF
0149
0149
D9FC
0140
0140
OF76FO
0150
13E0800
NUMERIC
PROGRAMMING
EXAMPLES
80287
Floating-Point
to
is-Digit
ASCII
Conversion
10: 12:
38
0'1'/25/83
PAGE
LINE
32.
323
3.4
32S
326
327
328
3
••
330
331
332
333
334
33'
336
337
338
33'
340
341
342
343
344
345
346
347
348
34.
350
351
352
333
354
33.
306
357
358
339
360
361
362
363
364
365
366
367
368
36.
370
371
372
373
37.
375
376
377
378
37.
380
381
382
383
38.
38.
386
387
388
39.
3.0
3.,
39.
3.3
394
39.
396
397
399
39'
400
401
40.
403
404
40S
406
407
408
40.
410
411
41.
413
414
415
SOURCE
,
i'Li/ait
mov
,ax,poLlla,,_ten
sub
ax,
ex
J,a
adJust_"luult
Wait
for
power_ten
to
be
valid
I
Get
powe"
of
tan
of
value
I
Form
scaling
factor
nacaIl5.,,1,1
in
ax
Jump
if
number
will
not
fit
The
number
is
betwaen
1 ,and
10**<field_lIirel.
Test
if
it
is
an
intega".
HId
pOLlIa"
_
two
mov
II
i.
d x
.ub
dl.
NORMAL-EXACT
fl'
fraction
fscal
a
'"
,t
(1)
f"ndint
fcomp
fstsw
status
test
status.4000H
J"'
c
onvl!rt_i
ntagar
htp
st(Ol
d
x.
IIi
I Ra ..
to"e
original
number
S.va
"eturn
valua
I
Conv."t
to
exact
".tu"n
v ..
lue
I
Form
full
value.
this
1s
safe
here
Copy
value
fo"
comparl!
J
Tast
if
its
an
intege"
I
Compa"a
values
J
Save
status
C3
a
1
implil!S
it
was
an
integl!"
J Remove
non
integer
value
I
Restore
original
return
value
Sc,ala
the
number
to
Ll/ithin
the
range
allowed
by
the
BCD
form,at.
The
scaling
operation
5hould
produce
,a
numb.r
within
one
decimal
order
of
magnitUde
of
the
largut
decim.!ll
number
repra
..
ntabla
within
the
given
string
width.
nl!
seal
ing
power
of
ten
value
is
in
u.
adJu
..
t_ruult:
moy
no,
call
fl'
fmul
moY
'h
1
'h
1
.h
1
Hid
faddp
flcale
htp
word
ptr
Cbx~
••
u
Practlen
sit
ex
si.1
\ii.t
si.
1
power
_two
st(2).
lit
I
s.t
initial
powe"
of
ten
return
value
j
Subtract
one
'or
each
order
0'
J
magnitude
the
vo!!Ilue
i!li
scaled
by
Scaling
flactor
is
returned
as
uponent
and
fraction
Q"t
.p"action
Combine
fractions
I
Form
pOlller
of
ten
of!
the
maximum
j
BCD
value
to
fit
in
the
string
)
Indu
in
s1
j
Combine
powlfrs
of
two
Form
full
value.
exponent
wall
saile
J Remove
exponent
Tl!st
the
adJu.t.d
value
against
a
tablli!
of
t'~act
powers
of
tt!n.
Til.
combined
er"or'
of
thE!'
magnitude
IIstimatl!
and
power
function
ca.,
ret.ult
in
a
value
one
ordl'r
of!
magnitude
too
small
01"
too
large
to
fit
corrl!ctly
in
,the
BCD
Held.
To
handle
thi!l
pT'obhm.
pretest
the
adJUsted
valull>
if
it
is
too
small
01'
large.
than
adJust
it
by
ten
and
adJust
th.
powe"
of
ten
value
,
testJower:
f!com
power_tableCsiJ+type
power_table)
Compare
against
exact
power
fstsw
test
J"'
f:Ldiv
an'
in'
Jmp
.,
ax.
4100H
test_fo"
_sm,all
const10
d
1.
not
EXACT
word
ptr
tb
xJ
.ho"t;
in_ranga
pOWIi!1"_hbhCsiJ
..
1U.IOOH
1n_range
Umul
constiO
dac
LIIo"d
pt,.
Cbx~
flrndint
"
J
entry.
U!ie
thf!
ne~t
entry
since
cx
J
has
been
decremented
by
one
)
No
lIIait
is
necessart,!
)
If
C3 -
CO
..
0
than
too
big
Elu
adJust
value
Rli!mova
axact
fllag
I
AdJust
power
of
tan
value
J
Convart
the
value
to
a
BCD
int.g.r
j
Test
relative
size
No
wait
is
naca.sart,!
If!
CO
- 0
than
st(O)
>-
low.,.
bound
I
Conv.rt
tha
valua
to
a
BCD
intager
AdJust
valu.
into
range
AdJu.t
powar
of
t.n
valua
A
....
rt:
0 <-
TOS
<-
999.999.999.999.999.999
J
The
TOS
number
will
ba
...
c:tll,l
repraunhble
in
19
digit
BCD
format.
,
convart_i
nteg.,.:
Whih
the
.to,..e
BCD
"uns
...
etup
ragi.tns
for
the
conversion
to
ASCII.
I
Initial
BCD
index
valua
Figure 4-6. Floating-Point
to
ASCII Conversion Routine (Cont'd.)
4-11