HESMON INSTRUCTIONS
If You've Never Used a 'Machine Language Monitor' Before
The following section is intended for people who are unfamiliar with
the uses of a machine language (M.L.) monitor program. However, it is
not a tutorial in the architecture of the C64 or the 6502. Nor is it
intended to teach 6502 assembly language programming. In fact, some
knowledge of assembler language will be most helpful. It is intended
to help the beginner get started in using HESMON. Even those who know
nothing about the 6502 or the C64 will find some of HESMON's commands
useful (see, for example, the Interpret Memory command).
If you are familiar with the C64's screen editor, you should have no
trouble entering and editing HESMON commands. HESMON commands are
entered and edited just as are BASIC direct mode commands. They
consist of a single character usually followed by one or more
'parameters' and a RETURN. The parameters consist of hexadecimal
numbers or character strings and are separated from one another by
spaces. With one exception (the 'U' command) numeric parameters must
be hexadecimal and do not need to be prefixed with '$'. String
parameters are identified by enclosing them in double quotes ("). If
HESMON doesn't understand a command it will print '?', usually just to
the right of the bad command. If the command is understood, but the
result is impossible or illegal, e.g., trying to save HESMON itself on
tape, HESMON prints a '?' on the following line.
To use HESMON, turn your C64 off, insert the HESMON cartrtdge into the
expansion slot In the C64 and then turn the power on. You will see the
HESMON version number, the programmars name, the H.E.S. copyright
message, and the 'cold start' register display:
C.
PC IRQ SR AC XR YR SP
0000 EA31 27 0n 00 00 FA
The meaning of this rather cryptic display is as follows: The first
line 'C' identifies a cold start of HESMON, that is, starting up from
power-on. The next line identities the pseudo 6502 registers
maintained by HESMON:
PC = program counter
IRQ = interrupt request vector
SR = status register
AC = accumulator
XR = X register
YR = Y register
SP = stack pointer
NOTE: "6502" is used synonomously for "6510" in this document.
The register contents are shown on the third line. The quantities
shown in the register display (except the IRQ) are not the actual
register contents, they are the numbers HESMON will use to set the
6502 registers when instructed to begin execution of a M.L. program.
IRQ is not a 6502 register, but a RAM 'vector' that points to an IRQ
interrupt service routine. Beginners may ignore this location - but
better not change it! The ';' at the beginning of the last line is
really a HESMON command. It tells HESMON (if the RETURN key is pressed
with the cursor on this line) to put the seven numbers that follow
into the corresponding pseudo registers. Just before beginning
execution of a M.L. program HESMON copies the pseudo register contents
to the 6502 registers. so, for example, If we want the C64 to print
'HI.', we could first move the cursor up to the ';' line and alter it
to read:
1200 EA31 27 48 49 2E FA
When we press RETURN, the 6502 pseudo program counter is set to $1200,
while the accumulator, and X and Y pseudo registers are set to $48
(ASCII H), $49 (ASCII I), and $2E (ASCII). Now, if we write a program
at $1200 to print the AC, XA, and YR it will print 'HI.' when we
execute the HESMON Go command. Let's write such a program using the
HESMON simple Assembler command, 'A'. Type in the following lines:
A 1200 JSR FF02
TXA
JSR FF02
TYA
JSR FF02
BRK
The 'A' beginning the first line tells HESMON we wish to assemble,
that is, translate assembly mnemonics into machine code. As you press
RETURN after typing each of the above lines, you will see HESMON
reprint the line, showing the machine code generated from the assembly
language instruction. HESMON will then prompt for the next line of
program by printing the 'A' command and the next available address
followed by
K.J. REVEALED TRILOGY PAGE [161] (C)1990 K.J.P.B.
<<previous page -
next page>>