-
Notifications
You must be signed in to change notification settings - Fork 0
/
build
96 lines (90 loc) · 3.25 KB
/
build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# build
#
# Build am9511 emulator
#
# For the hardware version, we do not need ova (integer overflow
# math) or the am9511 front end or floating emulation. This is
# all done by the am9511 chip, through hw9511. We *do* need floatcnv
# to be able to make sense of the results of the chip.
#
# For the software version (test.com, vs the hardware testhw.com),
# we use ova for integer math, am9511 for command interpretation.
#
# The main routine test.c is used for both hardware and emulation.
# This is the test driver for the emulation and the chip.
#
# Choose the appropriate build sequence. gcc or zxc. gcc is the
# actual target, because this code is to be incorporated into 8080/
# Z80 emulators to provide AM9511 chip emulation.
#
# NOTE: Our initial target is AM9511 emulation and *not* AM9512 emulation.
# AM9511 offers more functions, and 16 and 32 bit integer operations.
# This can more easily enhance typical programs running on the
# 8080/Z80 platform. 16 bit add and subtract are not interesting --
# multiply and divide are. As are the 32 bit (double) operations.
#
# WHY: The AM9511 can deliver a floating point divide in 165.9
# 2Mhz 8080 cycles, or 41 register instructions. Compare to LLLBASIC
# at 13079.6 cycles, this is 78.8 times faster.
#
# We are going to incorporate am9511 into RunCPM for testing.
# We will see if we can get a floating point divide in the
# space of 41 instructions. When we get this, we are pretty
# much complete, and can submit for inclusion into z80pack
# and altair-duino.
# set -v to display without expansion
set -x
if true; then
# Build for gcc (emulation)
#
# -I. needed because #include <ansi.h> has to find ansi.h
#
# Compile hw9511.c to validate compile on gcc
#
echo building test
gcc -O3 -I. -Wall -c hw9511.c
gcc -O3 -I. -Wall -o test test.c getopt.c am9511.c floatcnv.c ova.c -lm
gcc -O3 -I. -Wall -DTEST1 -DTEST2 -DTEST3 -DTEST4 -o test14 \
test.c getopt.c am9511.c floatcnv.c ova.c -lm
gcc -O3 -I. -Wall -DTEST5 -DTEST6 -DTEST7 -DTEST8 -o test58 \
test.c getopt.c am9511.c floatcnv.c ova.c -lm
fi
if true; then
# Build for z80 using zxcc (validation)
#
# We optimize everything, to get smallest/best code. Need -LF
# on link for floating point.
#
# Do NOT optimize hw9511.c, as that has inline assembler in
# it. Attempting to run OPTIM on that can result in very strange
# things -- like the compiler simply hanging up.
#
echo building test.com
zxc -c hw9511.c
zxc -c -o getopt.c
zxc -c -o am9511.c
zxc -c -o floatcnv.c
zxc -c -o ova.c
#
zxc cnvtest.c floatcnv.obj -LF
#
rm test.obj
zxc -c -o -DTEST1 -DTEST2 -DTEST3 -DTEST4 test.c
zxc test.obj getopt.obj am9511.obj floatcnv.obj ova.obj -LF
cp test.com test14.com
zxc test.obj getopt.obj hw9511.obj floatcnv.obj -LF
cp test.com testhw14.com
#
rm test.obj
zxc -c -o -DTEST5 -DTEST6 -DTEST7 -DTEST8 test.c
zxc test.obj getopt.obj am9511.obj floatcnv.obj ova.obj -LF
cp test.com test58.com
zxc test.obj getopt.obj hw9511.obj floatcnv.obj -LF
cp test.com testhw58.com
#
rm test.obj
zxc -c -o test.c
zxc test.obj getopt.obj hw9511.obj floatcnv.obj -LF
cp test.com testhw.com
zxc test.obj getopt.obj am9511.obj floatcnv.obj ova.obj -LF
fi