Commodore 128 Programmer's Reference Manual page 147

Hide thumbs Also See for 128:
Table of Contents

Advertisement

MACHINE LANGUAGE ON THE COMMODORE 128
137
n
n
HEXADECIMAL
$0
$1
$2
$3
$4
$5
$6
$7
$8
$9
$A
$B
$C
$D
$F
DECIMAL
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
BINAR
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
mi
Figure 5-7. Hexadecimal/Decimal/Binary Conversion
Each hex digit represents four bits. The highest number you can represent with
four bits is 15 decimal. In machine language, you usually represent operands and
addresses as two or four hex digits. Since each hex digit of a four-digit hexadecimal
address takes up four bits, four of them represent 16 bits for addressing.
At first you'll find yourself converting decimal addresses and operands into
hexadecimal. Then you'll want to convert the other way. See the HEX$ and DEC
functions for quick and easy decimal to HEX conversions. In the machine language
monitor, use the ( + ) plus sign to represent decimal numbers. Use the conversions for
now, but eventually you should find yourself thinking hexadecimal notation instead of
always converting from decimal to hexadecimal.
ADDRESSING MODES IN
THE COMMODORE 128
Addressing is the process by which the microprocessor references memory. The 8502
microprocessor has many ways to address the internal locations in memory. The
different addressing modes require either one, two or three bytes of storage depending
on the instruction. Each instruction has a different version and op-code. For example,
LDA (LoaD the Accumulator) has eight versions, each with a different op-code to
specify the various addressing modes. See the 8502 Instruction and Addressing Table
section for the different versions of all the 8502 machine-language instructions.

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents