home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Commodore 64 Scene Diskmags Assortment
/
DMBBS_Bi-Monthly_Magazine_5_1990-06-01_Sledge.d64
/
8.1
< prev
next >
Wrap
Text File
|
2023-02-26
|
3KB
|
129 lines
Wildy's Corner!
In the following issues I am going
to use this as a ML For Beginners
course. By the time you finish it, you
will have enough knowledge to do
almost anything you want in ML.
Including some rudimentary special
effects as used in software pirate's
demos.
For this month we are going to go
over the most basic commands in ML,
and I will show you how to use these
to write your first ML routine.
Although most people view ML as
the 'complex' language, it is really
much simpler than BASIC. It is just
that you need a number of simple
commands to equal one command from a
high-level language such as BASIC.
First we will learn about the most
important register in ML-the
Accumulator. Different ML instructions
allow you to copy the accumulator to a
memory location and vice versa, modify
its contents, and other useful tasks.
This may not seem like much but this
is where 50% of a program is
accomplished. In addition, the
accumulator is the only register that
has math instructions.
Now we will learn our first ML
instruction. LDA. You may have guessed
it stands for LoaD the Accumulator and
is arguably the most used of all
commands.
Putting a '#' after LDA tells the
computer that you want to LoaD the
Accumulator with the value after it.
A '$' following the LDA simply
tells the computer that the number
following is in hexadecimal form. (For
more info on HEX see the preceding
file.)
With this knowledge you should
know that:
LDA #$05
tells the computer to LoaD the
Accumulator with $05. Make sense?
Good. This is very simple to grasp but
is required to perform many things.
Our next command is STA. It stands
for STore the Accumulator. This
command takes the value in the
accumulator and transfers it to to any
memory location you wish.
Before we can write our first
routine we need to know one more
command. BRK. It is the BReaK command
and is needed because in ML, if there
is no BRK at the end-it will just lock
up.
Now we can write our first
routine. It is very simple and changes
the screen color to Cyan.
To type it in a ML monitor you
need to follow this format.
.A 1400 LDA #$03
The .A tells it that this is an
accumulator instruction. Afterwords,
the monitor will automatically number
and place the correct beginning on the
lines.
.A 1402 STA $D020
$D020 is the equivelant to 53280
in decimal.
Last but not least...
.A 1404 BRK
Now press return until you are on a
clean line and type G 1400.
Bingo! If you did everything right it
will change your screen to Cyan.
Congratulations. You have now
created you first program. Play around
with those commands and see how much
else you can accomplish with that
little bit of info.
Unfortunatly I was in a bind for
time this issue so it is semi small,
but next issue I will have a immense
column to help you further into the
world of ML.
As always, if you have questions
or comments on this or any other
articles-contact me through Digital
Fantasia. 301+553+0001!
Later!
TWO!