beautypg.com

Extsw extend sign (word) – Zilog Z80380 User Manual

Page 92

background image

5-58

Z380

U

SER

'

S

M

ANUAL

DC-8297-03

Z

ILOG

EXTSW
EXTEND SIGN (WORD)

EXTSW [HL]

Operation:

If (HL(15)=0) then begin

HL(31-16)

0000h

end

else begin

HL(31-16)

FFFFh

end

The contents of the low word of the HL register, considered as a signed, two's complement
integer, are sign-extended to 32 bits in the HL register. This instruction is useful for
conversion of 16-bit signed operands into 32-bit signed operands.

Flags:

S: Unaffected
Z: Unaffected
H: Unaffected
V: Unaffected
N: Unaffected
C: Unaffected

Addressing

Execute

Mode

Syntax

Instruction Format

Time

Note

EXTSW [HL]

11101101 01110101

3