[Prev] [Next] [Contents] [Commodore] [New] [Search] [Home]

This program. will display the alphabet using a KERNAL routine. The only new instruction introduced here is TXA Transfer the contents of the X index register, into the Accumulator.

   .A 1400 LDX #$41     - X = CBM ASCII of "A"
   .A 1402 TXA          - A = X
   .A 1403 JSR $FFD2    - print character
   .A 1406 INX          - bump count
   .A 1407 CPX #$5B     - have we gone past "Z"?
   .A 1409 BNE $1402    - no, go back and do more
   .A 140B BRK          - yes, return to 64MON

To see the Commodore 64 print the alphabet, type the familiar command:

   .G 1400

The comments that are beside the program, explain the program flow and logic. If you are writing a program, write it on paper first, and then test it in small parts if possible.

USEFUL TIPS FOR THE BEGINNER

One of the best ways to learn machine language is to look at other peoples' machine language programs. These are published all the time in magazines and newsletters. Look at them even if the article is for a different computer, which also uses the 6510 (or 6502) microprocessor. You should make sure that you thoroughly understand the code that you look at. This will require perseveres I ce, especially when you see a new technique that you have never come across before. This can be infuriat- ing, but if patience prevails, you will be the victor.

Having looked at other machine language programs, you MUST write your own. These may be utilities for your BASIC programs, or they may be an all machine language program.


[Prev] [Next] [Contents] [Commodore] [New] [Search] [Home]
This page has been created by Sami Rautiainen.
Read the small print. Last updated July 10, 2002.