Bit Field Operations - Motorola MC68030 User Manual

Enhanced 32-bit microprocessor
Hide thumbs Also See for MC68030:
Table of Contents

Advertisement

Instruction
Operand Syntax
BCHG
Dn,〈ea〉
#〈data〉,ea
BCLR
Dn,〈ea〉
#〈data〉,ea
BSET
Dn,〈ea〉
#〈data〉,〈ea〉
BTST
Dn,〈ea〉
#〈data〉,ea

3.2.6 Bit Field Operations

The MC68030 supports variable-length bit field operations on fields of up to 32 bits. The bit
field insert (BFINS) instruction inserts a value into a bit field. Bit field extract unsigned
(BFEXTU) and bit field extract signed (BFEXTS) extract a value from the field. Bit field find
first one (BFFFO) finds the first bit that is set in a bit field. Also included are instructions that
are analogous to the bit manipulation operations; bit field test (BFTST), bit field test and set
(BFSET), bit field test and clear (BFCLR), and bit field test and change (BFCHG). Table 3–
6 is a summary of the bit field operations.
Instruction
Operand Syntax
〈ea〉 {offset:width}
BFCHG
〈ea〉 {offset:width}
BFCLR
〈ea〉 {offset:width},Dn
BFEXTS
〈ea〉 {offset:width},Dn
BFEXTU
〈ea〉 {offset:width},Dn
BFFFO
BFINS
Dn,〈ea〉 {offset:width}
〈ea〉 {offset:width}
BFSET
〈ea〉 {offset:width}
BFTST
NOTE: All bit field instructions set the N and Z bits as shown for BFTST before performing the specified operation.
MOTOROLA
Table 3-5. Bit Manipulation Operations
Operand Size
∼ (〈bit number〉 of destination) → Z → bit of destination
8, 32
8, 32
∼ (〈bit number〉 of destination) → Z;
8, 32
— 0 → bit of destination
8, 32
∼ (〈bit number〉 of destination) → Z;
8, 32
— 1 → bit of destination
8, 32
∼ (〈bit number〉 of destination) → Z
8, 32
8, 32
Table 3-6. Bit Field Operations
Operand Size
1 — 32
1 — 32
1—32
1 — 32
1 — 32
1 — 32
1 — 32
1 — 32
MC68030 USER'S MANUAL
Operation
Operation
∼ Field → Field
0's → Field
Field → Dn; Sign Extended
Field → Dn; Zero Extended
Scan for first bit set in field; offset → Dn
Dn → Field
1's → Field
Field MSB → N; ∼ (OR of all bits in field) → Z
Instruction Set Summary
3-9

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents