Finally, I have a version of the game Startrek written in the Cowgol language that can be compiled on a Z80 CP/M computer that has only 64KB of RAM.
Of course, the option -B must be used when compiling the source files.
Here is the compilation log:
--------------------
c>cowgol -b -o misc.coo string.coo seqfile.coo sttrek.cow staux.cow stmain.cow
COWGOL COMPILER (CP/M-80) V2.0
Copyright (C) David Given
STTREK.COW
0:COWFE1 STTREK.COW
COWFE phase 1:
> STTREK.COW
done!
0:COWFE2 $CTMP1.$$$
COWFE phase 2:
24kB free
done!
6kB free
ERA COWFE.$$$
0:COWBE $CTMP1.$$$ STTREK.COO
COWBE: 22kB free
__main
TO_FIXED
FROM_FIXED
TO_FIXED00
FROM_FIXED00
get_rand
rand8
isqrt
abs16
abs32
square00
cint100
input
yesno
input_f00
input_int
print100
get_dev_name
fgets
showfile
get_map
put_map
get_c
distance_to
find_space
fs_empty_pl_k
fs_empty_pl_b
fs_empty_pl
inoperable
repair_damage
klingons_shoot
wipe_klingon
klingons_move
put1bcd
putbcd
l_range_scan
photon_tor
get_quadname
place_ship
new_quadrant
done: 13kB free
STAUX.COW
0:COWFE1 STAUX.COW
COWFE phase 1:
> STAUX.COW
done!
0:COWFE2 $CTMP1.$$$
COWFE phase 2:
24kB free
done!
4kB free
ERA COWFE.$$$
0:COWBE $CTMP1.$$$ STAUX.COO
COWBE: 22kB free
__main
quadrant_name
damage_control
shield_control
man_energy
get_status
s_range_scan
complete_man
course_control
no_klingon
phaser_control
torpedo_hit
done: 14kB free
STMAIN.COW
0:COWFE1 STMAIN.COW
COWFE phase 1:
> STMAIN.COW
done!
0:COWFE2 $CTMP1.$$$
COWFE phase 2:
24kB free
done!
5kB free
ERA COWFE.$$$
0:COWBE $CTMP1.$$$ STMAIN.COO
COWBE: 22kB free
__main
get_kdata_x
get_kdata_y
get_kdata_energy
set_kdata_x
set_kdata_y
set_kdata_energy
get_starbases
set_starbases
get_starbases_left
set_starbases_left
get_base_x
set_base_x
get_base_y
set_base_y
get_docked
set_docked
get_energy
set_energy
get_energy0
get_klingons
set_klingons
get_total_klingons
get_klingons_left
set_klingons_left
get_torps
set_torps
get_torps0
get_quad_x
set_quad_x
get_quad_y
set_quad_y
get_shield
set_shield
get_stars
set_stars
get_time_start
get_time_up
get_damage
set_damage
get_d4
set_d4
get_ship_x
set_ship_x
get_ship_y
set_ship_y
get_stardate
set_stardate
get_quad
put_quad
intro
initialize
galactic_rec
status_report
estimate2
estimate1
compute_vector
torpedo_data
nav_data
dirdist_calc
galaxy_map
lib_computer
new_game
end_of_game
resign
end_of_time
ship_destroyed
won_game
done: 12kB free
0:COWLINK COWGOL.COO MISC.COO STRING.COO SEQFILE.COO STTREK.COO STAUX.COO STMAIN.COO -o $CTMP1.$$$
COWLINK: 45kB free
Adding input file: COWGOL.COO
Adding input file: MISC.COO
Adding input file: STRING.COO
Adding input file: SEQFILE.COO
Adding input file: STTREK.COO
Adding input file: STAUX.COO
Adding input file: STMAIN.COO
Analysing...
Workspace sizes:
#0: 937 bytes
Creating output file: $CTMP1.$$$
Copying from input file: COWGOL.COO
Copying from input file: MISC.COO
Copying from input file: STRING.COO
Copying from input file: SEQFILE.COO
Copying from input file: STTREK.COO
Copying from input file: STAUX.COO
Copying from input file: STMAIN.COO
done: 11kB free
0:COWFIX $CTMP1.$$$ $CTMP2.$$$ -O
COWFIX v17 fixing syntax and optimizing code
PASS 1
PASS 2
PASS 3
3 fixed PUSH statements
51 fixed POP statements
353 fixed JR statements
51 fixed too long DB statements
354 not needed labels dropped
18 RET statements added
11 fixed JP to JP statements
13 fixed statement groups involving conditionals
76 dropped not needed LD statements
7462 input source lines processed
DONE!
ERA $CTMP1.$$$
0:Z80AS -J -N -OSTTREK.OBJ $CTMP2.$$$
Z80AS Macro-Assembler V4.8
Errors: 0
Jump optimizations done: 286
Finished.
ERA $CTMP2.$$$
0:LINK -Z -Ptext=100H,data,bss -C100H -
OSTTREK.COM STTREK.OBJ
ERA $$EXEC.$$$
c>
c>sttrek
*************************************
* *
* *
* * * Super Star Trek * * *
* *
* *
*************************************
Do you need instructions (y/Y=YES):
------*------
------------- `--- ------'
`-------- --' / /
\\\\------- --
'-----------'
The USS Enterprise --- NCC - 1701
Your orders are as follows:
Destroy the 10 Klingon warships which have invaded
the galaxy before they can attack Federation Headquarters
on stardate 2432. This gives you 32 days.
You have 7 starbase(s) in the galaxy for resupplying your ship.
Hit any key to accept command.
Your mission begins with your starship located
in the Canopus IV quadrant...
-1--2--3--4--5--6--7--8-
1 * 1 Stardate 2400
2 <*> 2 Condition green
3 3 Quadrant 5, 4
4 4 Sector 2, 2
5 * 5 Photon Torpedoes 10
6 6 Total Energy 3000
7 7 Shields 0
8 8 Klingons Remaining 10
-1--2--3--4--5--6--7--8-
Command?
----------------------------------------------
thanks,
Ladislau