beautypg.com

Zilog Z80380 User Manual

Page 33

background image

4-8

Z380

U

SER

'

S

M

ANUAL

DC-8297-03

Z

ILOG

4.2.7 Stack Pointer Relative Mode (SR)

(Continued)

2.

Load HL from location (SP – 4) in Extended mode, Long Word mode

SETC

XM

;In Extended mode

DDIR LW

;operate next instruction in Long Word mode

LD HL, (SP–4)

;Load into the HL from the
;contents of the memory location
;whose address is four less than
;the contents of SP.

HLz

HL

SPz

SP

Before instruction execution

1234

5678

07FF

7F00

After instruction execution

EFCD

AB89

07FF

7F00

Memory location

07FF7EFC

89

07FF7EFD

AB

07FF7EFE

CD

07FF7EFF

EF

Address calculation: In Extended mode, FCH (–4 in Deci-
mal) encoding in the instruction is sign extended to a 32-
bit value before the address calculation, and calculation is
done in modulo 2

32

.

07FF7F00

+

FFFFFFFC
07FF7EFC

3.

Load HL from location (SP + 10000H) in Extended mode, Long Word mode

SETC

XM

;In Extended mode,

DDIR

IW,LW

;operate next instruction in Long Word mode
;with a word immediate data.

LD HL, (SP+10000)

;Load into the HL from the
;contents of the memory location
;whose address is 10000H more than
;the contents of SP.

HLz

HL

SPz

SP

Before instruction execution

1234

5678

07FF

7F00

After instruction execution

EFCD

AB89

07FF

7F00

Memory location

08007F00

89

08007F01

AB

08007F02

CD

08007F03

EF

Address calculation: In Extended mode, 010000H encod-
ing in the instruction is sign extended to a 32-bit value
before the address calculation, and calculation is done in
modulo 2

32

.

07FF7F00

+

00010000
08007F00