Vault 7: Projects
This publication series is about specific projects related to the Vault 7 main publication.
16-bit MCU and DSC Programmer’s Reference Manual
DS70157F-page 442 © 2005-2011 Microchip Technology Inc.
ZE
Zero-Extend Ws
Implemented in: PIC24F PIC24H PIC24E dsPIC30F dsPIC33F dsPIC33E
X X X X X X
Syntax: {label:} ZE Ws, Wnd
[Ws],
[Ws++],
[Ws--],
[++Ws],
[--Ws],
Operands: Ws ∈ [W0 ... W15]
Wnd ∈ [W0 ... W15]
Operation: Ws<7:0> → Wnd<7:0>
0 → Wnd<15:8>
Status Affected: N, Z, C
Encoding: 1111 1011 1000 0ddd dppp ssss
Description: Zero-extend the Least Significant Byte in source working register Ws to
a 16-bit value and store the result in the destination working register
Wnd. Either register direct or indirect addressing may be used for Ws,
and register direct addressing must be used for Wnd. The N flag is
cleared and the C flag is set, because the zero-extended word is always
positive.
The ‘d’ bits select the destination register.
The ‘p’ bits select the source Address mode.
The ‘s’ bits select the source register.
Note 1: This operation converts a byte to a word, and it uses no .B or
.W extension.
2: The source Ws is addressed as a byte operand, so any
address modification is by ‘1’.
Words: 1
Cycles:
1
(1)
Note 1:
In dsPIC33E and PIC24E devices, the listed cycle count does not apply to read and
read-modify-write operations on non-CPU Special Function Registers. For more
details, see
Note 3
in
Section 3.2.1 “Multi-Cycle Instructions”
.
Example 1:
ZE W3, W4 ; zero-extend W3
; Store result to W4
Before
Instruction
After
Instruction
W3 7839 W3 7839
W4 1005 W4 0039
SR 0000 SR 0001 (C = 1)
Protego_Release_01_05-Related-OEM-Documentation-PIC24FJ64GA004-Programmers_Reference_Manual.pdf