Propeller Manual

Table Of Contents
3: Assembly Language Reference – DIRA, DIRB
DIRA, DIRB
Register: Direction registers for 32-bit ports A and B.
DAT
Label Condition Instruction DIRA, SrcOperand Effects
DAT
Label Condition Instruction DestOperand, DIRA Effects
DAT
Label Condition Instruction DIRB, SrcOperand Effects (Reserved for future use)
DAT
Label Condition Instruction DestOperand, DIRB Effects (Reserved for future use)
Result: Optionally, the direction register is updated.
Label is an optional statement label. See Common Syntax Elements, page 250.
Condition is an optional execution condition. See Common Syntax Elements, page 250.
Instruction is the desired assembly instruction. DIRA or DIRB may be used in either the
assembly instruction’s DestOperand
or SrcOperand fields.
SrcOperand is a constant expression used by Instruction to operate on, and optionally
write to, the
DIRA or DIRB register in DestOperand.
DestOperand is a constant expression indicating the register that is operated on, and
optionally written to, using the value of
DIRA or DIRB in SrcOperand.
Explanation
DIRA and DIRB are one of six special purpose registers (DIRA, DIRB, INA, INB, OUTA and OUTB)
that directly affect the I/O pins. The
DIRA and DIRB register’s bits indicate the direction states
for each of the 32 I/O pins in Port A and Port B, respectively.
DIRB is reserved for future use;
the Propeller P8X32A does not include Port B I/O pins so only
DIRA is discussed below.
DIRA is a read/write register and can be used in either the DestOperand or SrcOperand fields
of an assembly instruction. A low (0) bit sets the corresponding I/O pin to an input direction,
and a high (1) bit sets it to an output direction. The following code sets I/O pins P0 through
P3 to outputs.
mov dira, #$0F
See Registers, page 338, and the Spin language DIRA, DIRB section, page 104, for more
information. Keep in mind that in Propeller Assembly, unlike in Spin, all 32 bits of
DIRA are
accessed at once unless the
MUXx instructions are used.
Propeller Manual v1.1 · Page 289