***************************** Hi ********************************

It would appear that some people are actually trying to learn machine
language on the Model 4. At least judging from the number of requests I
get for source code I assume this. With that in mind, I was sitting around
the other day (today actually) and decided to code up a simple file to
do something. While digging and sratching for an idea, I came up with one
to write a simple program to display a message to the video and work with it.

The reason for using the video is two fold. Its a lot easier to debug your
programs since you are working with a visual feedback environment and secondly
you can keep the code fairly simple.

The idea of a game kept creeping into my mind, since games teach a number of
things I decided that for the first time since 1981 I would write a game.
The last one I wrote was a SLOTS game for the Model 1 which I gave away as
I didn't know what else to do with it. Obviously someone did and "borrowed"
about 80% of my program, added a couple of things and sold it and probably
made some money off it. Which incidently is why I've never written a game
since. However that's all in the past and this is now.

Most everyone with a computer of sorts can recollect having played the old
HI LOW number guessing game (yes, even the guys with the Hewlett Packard
pocket programmables did it). Effectively what happened was the computer
generate a number in a fixed range and you spent the next 20 seconds
guessing it. If it took you longer than that, better you should have used a
coin and played heads/tails. Be that as it may, the computer told you if
you were too high or low and if you were right, well that was the point of
the game now wasn't it. Many people wrote what must be a truck load of these
programs in BASIC (me included) and they had what we refer to as bells and
whistles. Meaning they got "fancy". Multi-player, disk saving of high scores,
playing against an opponent and more were added to a rather mundane program
idea in the first place. Of course all this just added to the growth of
computer anyway so all was not in vain.

In this ARC file there are both /CMD and /ASM (read source) files. If you
are learning machine language its always a good place to start by using
someone elses code and making little changes and seeing what effect your
changes have. Some words of advice. Write protect your drive 0 unless you
know exactly what your code will do, it is possible to recreate a DOS which
doesn't boot or work anymore. If you have trouble tracing the program put
in little @DSP (displays) to the video to see where its got to. Watch you
don't foul up a register when doing this. If you want to trace program
logic flow use a machine language monitor like OverVue (which I also wrote).
Oh, its also a good idea to make a backup....just in case of Murphy...

Game#1 :

GUESS/CMD and GUESS/ASM. These are the first examples I created. You'll notice
a complete lack of "polished" look about them when you run the /CMD file. That
is because they are what we call a SHELL. Basically they do all they ever will
in checking, error trapping and displaying but they are really the core to
which you hang a much more pleasing display to. It took me about 2-3 hours to
get this to where I liked it and naturally I can't leave well enough alone.

GAME#2 :

GUESS1/CMD and GUESS1/ASM. These are my "enhanced" versions of the same basic
game as game #1. But with many modifications to make it polished. Its still
not great by any stretch of the imagination but maybe the kids will like it.
It has sound, a graphic display and does more extensive error testing.

Both games can serve as learning tools. Routines are there to check limits of
input, screen positioning, writing to the screen, memory mapping the video,
cursor addressing, pseudo random number generation, displaying and more. All
it takes is for you to examine the routines to see what they do. I generally
use the K.I.S.S. method of programming (read Keep It Simple Stupid) but as
you can see I started to get carried away with this one. Once the initial
Game#1 was completed it only took about 2 hours to code up Game#2. If you
left it for a week wonder what I would come up with....

So this is my contribution to anyone learning machine language. If you want to
"borrow" my work or these programs, be my guest, but PLEASE at least give
credit to where you got them. These are not shareware but if you like what you
see and it does help you out with anything then I'll consider my task
completed. If you need info on how EXACTLY a routine works, better to write
me a letter and include .50 for return postage.

Mel Patrick, 13699 70A Ave. Surrey, B.C., Canada, V3W 2J8
FastPlus II BBS, (604) 594-7398, 300/1200/2400 24hrs (or when I am not coding)

