English
Language : 

NSC800 Datasheet, PDF (26/76 Pages) National Semiconductor (TI) – NSC800TM High-Performance Low-Power CMOS Microprocessor
11 0 Addressing Modes (Continued)
11 5 DIRECT ADDRESSING
Direct addressing is the most straightforward way of ad-
dressing supplies a location in the memory space Direct
addressing 16-bits of memory address information in two
bytes of data as part of the instruction The memory address
could be either data source of destination or a location for
program execution as in program control instructions
Example
Instruction Jump to location X’0377
Mnemonic JP X’0377
Opcode
11000011
Defines jump opcode
( 0 1 1 1 0 1 1 1
00000011
Constant X’0377
This instruction loads the Program Counter (PC) is loaded
with the constant in the second and third bytes of the in-
struction The program counter contents are transferred via
direct addressing
11 6 REGISTER INDIRECT
Next to direct addressing register indirect addressing pro-
vides the second most straightforward means of addressing
memory In register indirect addressing a specified register
pair contains the address of the desired memory location
The instruction references the register pair and the register
contents define the memory location of the operand
Example
Instruction Add the contents of memory location X’0254 to
the A register The HL register contains X’0254
Mnemonic ADD A (HL)
Opcode
10000110
This instruction uses implied addressing of the A and HL
registers and register indirect addressing to access the data
pointed to by the HL register
11 7 INDEXED
The most flexible mode of memory addressing is the in-
dexed mode This is similar to the register indirect mode of
addressing because one of the two index registers (IX or IY)
contains the base memory address In addition a byte of
data included in the instruction acts as a displacement to
the address in the index register
Indexed addressing is particularly useful in dealing with lists
of data
Example
Instruction Increment the data in memory location X’1020
The IY register contains X’1000
Mnemonic INC (IYaX’20)
Opcode
TL C 5171 – 54
The indexed addressing mode uses the contents of index
registers IX or IY along with the displacement to form a
pointer to memory
11 8 RELATIVE
Certain instructions allow memory locations to be ad-
dressed as a position relative to the PC register These in-
structions allow jumps to memory locations which are off-
sets around the program counter The offset together with
the current program location is determined through a dis-
placement byte included in the instruction The formation of
this displacement byte is explained more fully in the ‘‘In-
structions Set’’ section
Example
Instruction Jump to a memory location 7 bytes beyond the
current location
Mnemonic JR $a7
Opcode
00011000
Defines relative jump
opcode
00000101
Displacement to be
applied to the PC
The program will continue at a location seven locations past
the current PC
26