PROGRAMMING NUMERIC APPLICATIONS
PL/M--;'~86
COt1P
ILER
ARRAYSUt1
SER
IES--
I I I
PL/M-286
V1.
0
Cot1P
I LAT ION
OF
MODULE ARRAVSUM
OBJECT
MODULE
PLACED
It-l
:
F6:
D.
Du.)
COMPILER
If
NO
KED
BY
PLM286
86
F6:
D.
SRC
XREF
2
3
4
5
6
7
8
9
1
10
:2
11 2
/ *** ** ***'*** * *** *** ****** ***
*****
* *
***""*
************
*
A R
RAY
SUM
MOD
* ******** **** **** ** *******'I't *
it
**
********** ********** /
arT'ay$sum:
do;
dec
lare
(sum$x,
sum$indexes,
sum$sq,uares)
real;
declare
x$array(100)
reaL
declare
(n$of$)(,
i)
integer;
declare
control$287
literally
'033eh
';
1*
Assume
x$array
and
n$o;$x
are
initialized
*1
1*
Prepare
the
80287
of
its
emulator
*1
call
init$real$math$uniti
call
set$real$mode{control$287)j
1*
Clear
sums
-It/
sum$x,
5um$indexes,
sum$squaT'es
=
0.0;
1*
Loop
through
array,
accumulating
*1
do
i = 0
to
n$of$x-l;
sum$x
=
sum$x
+
x$array
(i);
sum$indexes
=
sum$indexes
+
(x$array(i)
*
float(i+l»;
12
13
2
2
sum$sli.uares
=
sum$squares
+
{x$array
(i
)*x$array
(i»;
end;
1*
etc.
*1
14
end
array$sumi
PLlM-286
COMP
I
LER
ARRAYSUM
CROSS-REFERENCE
LISTING
DEFN
AD
DR
SIZE
NAME.
ATTRIBUTES.
AND
REFERENCES
00Q6H
117
ARRAysur1
CONTROL287
FLOAT.
4
019EH
2
I.
INITREALMATHUNIT
019CH
2 NOFX
SETREAU10DE.
2
0004H
4
SUMINDEXES
2
0008H
4 SUMSQUARES
:2
OOOOH
4
SUMX
3
OOOCH
400
XARRAV
MODULE
INFORMATION,
CODE AREA
SIZE
CONSTANT AREA
SIZE
VARIABLE
AREA
SIZE
MAXIMUM
STACK
SIZE
33
LINES
READ
=
0077H
=
0004H
01AOH
=
0002H
o PROGRAM ERRORS
DICTIONARY
SUMMARY,
96KB
MEMORY
AVAILABLE
3KB t1EMORY USED
(31.)
OKe
DISK
SPACE USED
END OF
PL1t1-286
COMPILATION
119D
40
416D
2D
PROCEDURE
STACK=OO02H
LITERALLY
'033eh
I
BUlL
TIN
11
INTEGER
9*
BUlL
TIN
6
INTEGER
9
BUlL
TIN
7
REAL
8*
11
REAL
8*
12
REAL
8*
10
REAL
ARRAY(
!DO)
7
9
11*
12*
10*
10
Figure
2-6_
Sample
PL/M-286
Program
2-44
10
11
12
13
11
12