beautypg.com

Zilog Z80380 User Manual

Page 28

background image

4-3

Z380

U

SER

'

S

M

ANUAL

Z

ILOG

DC-8297-03

4.2.4 Direct Address (DA)

When Direct Address mode is used, the data processed is
at the location whose memory or I/O port address is in the
instruction.

Instruction

Memory or

OPERATION

I/O Port

ADDRESS

OPERAND

The operand value is the contents of the location whose
address is in the instruction.

Depending on the instruction, the operand specified by
DA mode is either in the I/O address space (I/O instruction)
or memory address space (all other instructions).

This mode is also used by Jump and Call instructions to
specify the address of the next instruction to be executed.
(The address serves as an immediate value that is loaded
into the program counter.)

Also, DDIR Immediate Data Directives are used to expand
the direct address to 24 or 32 bits. Operand width is
affected by LW bit status for the load and exchange
instructions.

Example of DA mode:
1.

Load BC register from memory location 00005E22H in Word mode

LD BC, (5E22H)

;Load BC with the data in address
;00005E22H

BC

Before instruction execution

1234

After instruction execution

0301

Memory location

00005E22

01

00005E23

03

2.

Load BC register from memory location 12345E22H in Word mode

DDIR IW

;extend direct address by one word

LD BC, (12345E22H)

;Load BC with the data in address
;12345E22H

BC

Before instruction execution

1234

After instruction execution

0301

Memory location

12345E22

01

12345E23

03

3.

Load BC register from memory location 12345E22H in Long Word mode

DDIR IW,LW

;extend direct address by one word,
;and operation in Long Word

LD BC, (12345E22H)

;Load BC with the data in address
;12345E22H

BCz

BC

Before instruction execution

1234

5678

After instruction execution

0705

0301

Memory location

12345E22

01

12345E23

03

12345E24

05

12345E25

07