Commodore 128 Programmer's Reference Manual page 205

Hide thumbs Also See for 128:
Table of Contents

Advertisement

n
n
n
n
n
n
n
n
n
n
n
HOW TO ENTER MACHINE LANGUAGE PROGRAMS INTO THE COMMODORE 128
195
by placing the ASCII values of the characters in memory locations within a program.
To modify a memory dump using the screen editor, issue the MEMORY com
mand with the address range in which you want to place the character string informa
tion. For example, suppose you want to place the word "TEXT" in memory starting at
location $2000. First, enter the machine language monitor with the MONITOR com
mand. Next, issue the memory command containing the address $2000 as follows:
M2000
The 128 responds with this display:
02000 FF 00 FF 00 FF 00 FF 00: tt.tt.tt.it.
The entire screen is filled with the contents of the memory (dump) locations $2000
n
through $205F. For illustrative purposes, only one line of the memory dump is shown.
| |
This line pertains to the address range $2000 through $2007. At the right of the screen is
an area that displays the corresponding ASCII character for each value within a memory
location in that line of the memory dump. The left character in the display area
corresponds to location $2000, the second character position to the right pertains to
address $2001, and so on. To place the word "TEXT" in memory starting at location
$2000, move the cursor up to the first line of the memory dump, move the cursor right
to the memory address that pertains to address $2000, and place the ASCII character
string code for the letter T in this position. To do this, type over the characters that are
there and replace them with the hexadecimal equivalent of decimal 84 ($54) and press
RETURN
. Notice that the letter T is now displayed at the right of the screen.
Refer to Appendix E, ASCII and CHR$ Codes, for a list of the Commodore ASCII
codes for each character available in the Commodore 128.
Now do the same procedure for the letters E, X and T. When you are through, the
word "TEXT" is displayed in the display area. The first line of the memory dump now
looks like this:
02000 54 45 58 54 FF 00 FF 00: TEXT ir. it.
Now the character string you wish to manipulate is in memory, starting at address
$2000. Your machine language routine can now act upon the characters of the word
"TEXT" in order to display them on the screen. An efficient way of manipulating
entire words is to use the start address in memory where the text begins, in this case
$2000. Determine the length of the string, and use an index register as an offset to the
end of the word. See the section Raster Interrupt Split Screen Program with Horizontal
Scrolling in Chapter 8, for a working example of manipulating text. This chapter has
described the use of machine language. For additional information on machine language
topics, see Chapter 5, 7, 8, 9, 10, II, and 13.

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents