Commodore 128 Programmer's Reference Manual page 148

Hide thumbs Also See for 128:
Table of Contents

Advertisement

138
COMMODORE 128
ACCUMULATOR ADDRESSING
INSTRUCTION
LDA #$0F
CMP #$FF
SBC #$E0
HEX OPCODE
$A9
$C9
$£9
MEANING
Load the accumulator with 15 ($0F)
Compare the accumulator with 255 ($FF)
Subtract 224 ($E0) from accumulator
u
u
Accumulator addressing implies that the specified operation code operates on the
| 1
accumulator. The operand field is omitted since the instruction can only perform the
LJ
operation on the accumulator. Accumulator instructions require only one byte of stor
age. Here are some examples of accumulator addressing instructions:
^ ,
INSTRUCTION
HEX OPCODE
MEANING
ASL
$0A
Shift one bit left
LSR
$4A
Shift one bit right
ROR
$6A
Rotate one bit right
] 1
IMMEDIATE ADDRESSING
"
Immediate addressing specifies that the operand be a constant value rather than the
I
contents of a particular address. The operand is the data, not a pointer to the data. At
J
machine level, the microprocessor actually interprets an operand field constant
and an address in the operand field as two different op-codes, so the pound sign gives
f I
the programmer a way to distinguish between the data and a pointer to the data.
jj
Immediate addressing instructions require two bytes of storage. Here are some immedi
ate addressing instruction examples:
.
I—;
U
0
ABSOLUTE ADDRESSING
Absolute addressing allows you to access any of the memory locations within either 64K
'-/
RAM bank. Absolute addressing requires three bytes of storage; the first byte for the
op-code, the second for the low byte of the address and the third for the high byte. Here
j I
are some examples of absolute addressing instructions:
LJ
u

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents