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
Text File  |  2000-06-30  |  3KB  |  48 lines

  1. Jim Petersen
  2. March 10, 1985
  3.  
  4. The file FASTLIFE.MAC is my first attempt at machine language programming.
  5. It is written in Z-80 code, and needs to be assembled by M80.  I have included
  6. the .COM file in this library for those who have a Kaypro, or don't have M80
  7. and L80.
  8.  
  9. I wrote the program to run on a Kaypro 10, in normal text mode.  No special
  10. graphics are used, just the standard ADM-3A cursor addressing, plus a couple
  11. of extra "non-standard" Kaypro screen codes:  cursor on and cursor off.  If
  12. you patch the .COM file with DDT, the cursor commands are the only things
  13. you would have to change.
  14.  
  15. I had a few reasons to write a Game of Life in machine language.  I have seen
  16. the Game of Life run on languages ranging from BASIC to MC68000 machine
  17. language.  The speed of execution ranges from unbearably slow in BASIC, to
  18. incredibly fast in MC68000.  BASIC typically created a new generation every
  19. 20 to 30 seconds, while MC68000 (run on a Macintosh, by the way) was able
  20. to create about five generations per second!
  21.  
  22. For my first project, I wanted to see how fast I could make the game run on
  23. a Z-80.  My first priority was speed, and space was secondary.  The code for
  24. the program turns out to be only a few hundred bytes, but the space for the
  25. game board is the big guzzler, taking about 6k for a 24x78 screen.  In
  26. exchange for the space taken, though, the program runs quite fast.  It
  27. creates a little over one generation per second.
  28.  
  29. Another reason I chose to write the Game of Life in machine language was
  30. that I wanted to write something fun as my first try.  If anyone has any
  31. suggestions on how to make the game run faster, or how to make it better,
  32. or just comments about it, I'd like to hear from you.  I check the
  33. Royal Oak RBBS every once in awhile.
  34.  
  35. When you try the program, you might wonder what patterns you could put in
  36. to create nice displays.  I have found that putting my name on the screen
  37. in big letters creates some nice action.  Also, symmetrical patterns seem
  38. to work the best and live the longest.  Don't put cells too close together
  39. (they'll die from overpopulation) or too far apart (they'll die from
  40. isolation).  If you put your pattern in the middle of the screen, where
  41. the cursor is initially positioned, it will have the most room to
  42. spread out.  My version of the game has a fixed board; the ends are not
  43. joined to form a torus, and life, therefore, cannot leave one side of
  44. the board and return on the other.
  45.  
  46. Have fun!    --Jim Petersen
  47.  
  48.