home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
CPM
/
GENASM
/
FLIFEH89.LBR
/
FASTLIFE.DZC
/
FASTLIFE.DOC
Wrap
Text File
|
2000-06-30
|
3KB
|
48 lines
Jim Petersen
March 10, 1985
The file FASTLIFE.MAC is my first attempt at machine language programming.
It is written in Z-80 code, and needs to be assembled by M80. I have included
the .COM file in this library for those who have a Kaypro, or don't have M80
and L80.
I wrote the program to run on a Kaypro 10, in normal text mode. No special
graphics are used, just the standard ADM-3A cursor addressing, plus a couple
of extra "non-standard" Kaypro screen codes: cursor on and cursor off. If
you patch the .COM file with DDT, the cursor commands are the only things
you would have to change.
I had a few reasons to write a Game of Life in machine language. I have seen
the Game of Life run on languages ranging from BASIC to MC68000 machine
language. The speed of execution ranges from unbearably slow in BASIC, to
incredibly fast in MC68000. BASIC typically created a new generation every
20 to 30 seconds, while MC68000 (run on a Macintosh, by the way) was able
to create about five generations per second!
For my first project, I wanted to see how fast I could make the game run on
a Z-80. My first priority was speed, and space was secondary. The code for
the program turns out to be only a few hundred bytes, but the space for the
game board is the big guzzler, taking about 6k for a 24x78 screen. In
exchange for the space taken, though, the program runs quite fast. It
creates a little over one generation per second.
Another reason I chose to write the Game of Life in machine language was
that I wanted to write something fun as my first try. If anyone has any
suggestions on how to make the game run faster, or how to make it better,
or just comments about it, I'd like to hear from you. I check the
Royal Oak RBBS every once in awhile.
When you try the program, you might wonder what patterns you could put in
to create nice displays. I have found that putting my name on the screen
in big letters creates some nice action. Also, symmetrical patterns seem
to work the best and live the longest. Don't put cells too close together
(they'll die from overpopulation) or too far apart (they'll die from
isolation). If you put your pattern in the middle of the screen, where
the cursor is initially positioned, it will have the most room to
spread out. My version of the game has a fixed board; the ends are not
joined to form a torus, and life, therefore, cannot leave one side of
the board and return on the other.
Have fun! --Jim Petersen