Commodore 128 Programmer's Reference Manual page 149

Hide thumbs Also See for 128:
Table of Contents

Advertisement

n
n
MACHINE LANGUAGE ON THE COMMODORE 128
139
INSTRUCTION
INC $4FFC
LDX $200C
JSR $FFC3
HEX OPCODE
$EE
$AE
$20
MEANING
Increment the contents of address $4FFC by 1
Load the X register with the contents of address
$200C
Jump to location $FFC3 and save the return address
p
ZERO-PAGE ADDRESSING
Zero-page addressing requires two bytes of storage; the first byte is used for the opcode
and the second for the zero-page address. Since zero page ranges from addresses 0
through 255, the computer only needs the low byte to represent the actual address. The
high byte is assumed to be 0; therefore, it is not specified. When addressing a zero-page
location, you can still use absolute addressing; however, the execution time is not as fast
as zero-page addressing. Here are some examples:
INSTRUCTION
LDA $FF
ORA $E4
ROR $0F
HEX OPCODE
$A5
$05
$66
MEANING
Load the accumulator with the contents of zero-page
location $FF (255)
OR the accumulator with the contents of location
$E4
Rotate the contents of location $0F one bit to the
right
IMPLIED ADDRESSING
In implied addressing mode, no operand is specified because the op-code suggests the
action to be taken. Since no address or operand is specified, an implied instruction
requires only one byte for the op-code. Some examples are:
INSTRUCTION
DEX
INY
RTS
HEX OPCODE
$CA
$C8
$60
MEANING
Decrement the contents of the X register
Increment the contents of the Y register
Return from Subroutine

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents