Commodore 128 Programmer's Reference Manual page 193

Hide thumbs Also See for 128:
Table of Contents

Advertisement

n
HOW TO ENTER MACHINE LANGUAGE PROGRAMS INTO THE COMMODORE 128
183
ENTERING MACHINE LANGUAGE
INSTRUCTIONS IN THE MONITOR
Begin entering machine language instructions by entering the monitor from BASIC with
the following command:
MONITOR
RETURN
The Commodore 128 responds with the following display:
MONITOR
PC
SR AC XR YR SP
; FB000 00 00 00 00 F8
These values indicate the contents of the microprocessor registers upon entering
the monitor. The abbreviations and definitions of the register names are as follows:
PC—Program Counter
Marks the address of the current machine language
instruction
SR—Status Register
Flags that alert the microprocessor of certain conditions
AC—Accumulator
Register for all mathematical operations
XR—X Index Register
Used for effective address modification
YR—Y Index Register
Same as X register
SP—Stack Pointer
Indicates the address of the first available memory
location on the stack
Now you can begin to enter machine language instructions. The ASSEMBLE
command within the monitor enters the instructions into the specified memory location.
To enter instructions, follow the format of this example:
A 01800 LDA #$00
Make sure to leave at least one space between each of the fields. Here's what each
part of the instruction means:
<Assemble>
<Address in memory where opcode is stored>
<Opcode>
<Operand>
The A stands for ASSEMBLE an opcode. The second part (field) is the address
where the opcode in the instruction is placed in the Commodore 128 memory. Notice
the 5-digit hexadecimal number specifying the address. The leftmost digit (0-F) speci
fies the configuration of the Commodore 128 memory layout. This is the same as the
BANK command in BASIC.
Once the entire machine language program is entered, reference the address that is
contained in the first instruction you entered to start execution of the program. Execute
the program with the GO command in the monitor, or exit the monitor with the X
(EXIT) command and issue the SYS command from BASIC. If you SYS to the start of
the program, you must use the decimal equivalent of the hexadecimal address, which

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents