Infineon Technologies C166S V2 User Manual page 245

16-bit microcontroller
Table of Contents

Advertisement

DIV
Group
Syntax
Source Operand(s)
Destination Operand(s)
Operation
(MDL) ← (MDL) / (op1)
(MDH) ← (MDL) mod (op1)
Description
Performs a signed 16-bit by 16-bit division of the low order word stored in the MD
register by the source word operand op1. The signed quotient is then stored in the low
order word of the MD register (MDL) and the remainder is stored in the high order word
of the MD register (MDH).
CPU Flags
E
Always cleared.
Z
Set if quotient, stored in the MDL register, equals zero. Cleared
otherwise. Undefined if the V flag is set.
V
Set if an arithmetic overflow occurred, i.e. the quotient cannot be
represented in a word data type (only in case of 8000
divisor op1 was zero. Cleared otherwise.
C
Always cleared.
N
Set if the most significant bit of the quotient, stored in the MDL register, is
set. Cleared otherwise. Undefined if the V flag is set.
Encoding
Mnemonic
DIV
Rw
User Manual
16-by-16 Signed Division
Arithmetic Instructions
DIV op1
op1 → WORD
MDL → WORD
MD → DOUBLEWORD
E
Z
0
*
n
Detailed Instruction Description
V
C
*
0
Format
4B nn
8-245
User Manual
C166S V2
N
*
/FFFE
), or if the
H
H
Bytes
2
V 1.7, 2001-01
DIV

Advertisement

Table of Contents
loading

Table of Contents