Bit Manipulation Instructions - Intel 80C188EC User Manual

Hide thumbs Also See for 80C188EC:
Table of Contents

Advertisement

Table 2-5. Arithmetic Interpretation of 8-Bit Numbers
Hex
Bit Pattern
07
0 0 0 0 0 1 1 1
89
1 0 0 0 1 0 0 1
C5
1 1 0 0 0 1 0 1
2.2.1.3

Bit Manipulation Instructions

There are three groups of instructions for manipulating bits within bytes and words. These three
groups are logical, shifts and rotates. Table 2-6 lists the bit manipulation instructions and their
functions.
NOT
AND
OR
XOR
TEST
SHL/SAL
SHR
SAR
ROL
ROR
RCL
RCR
Logical instructions include the Boolean operators NOT, AND, OR and exclusive OR (XOR), as
well as a TEST instruction. The TEST instruction sets the flags as a result of a Boolean AND op-
eration but does not alter either of its operands.
Individual bits in bytes and words can be shifted either arithmetically or logically. Up to 32 shifts
can be performed, according to the value of the count operand coded in the instruction. The count
can be specified as an immediate value or as a variable in the CL register. This allows the shift
count to be a supplied at execution time. Arithmetic shifts can be used to multiply and divide bi-
nary numbers by powers of two. Logical shifts can be used to isolate bits in bytes or words.
OVERVIEW OF THE 80C186 FAMILY ARCHITECTURE
Unsigned
Binary
7
137
197
Table 2-6. Bit Manipulation Instructions
Logicals
"Not" byte or word
"And" byte or word
"Inclusive or" byte or word
"Exclusive or" byte or word
"Test" byte or word
Shifts
Shift logical/arithmetic left byte or word
Shift logical right byte or word
Shift arithmetic right byte or word
Rotates
Rotate left byte or word
Rotate right byte or word
Rotate through carry left byte or word
Rotate through carry right byte or word
Signed
Unpacked
Binary
Decimal
+7
7
–119
invalid
–59
invalid
Packed
Decimal
7
89
invalid
2-21

Advertisement

Table of Contents
loading

This manual is also suitable for:

80c186ec

Table of Contents