Propeller Manual

Table Of Contents
3: Assembly Language Reference – INA, INB
INA, INB
Register: Input registers for 32-bit ports A and B.
DAT
Label Condition Instruction DestOperand, INA Effects
DAT
Label Condition Instruction DestOperand, INB Effects (Reserved for future use)
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. INA and INB are read-only registers and
thus should only be used in the instruction’s source operand.
DestOperand is a constant expression indicating the register that is operated on, and
optionally written to, using the value of the instruction’s source operand;
INA or INB.
Explanation
INA and INB are one of six special purpose registers (DIRA, DIRB, INA, INB, OUTA and OUTB) that
directly affect the I/O pins. The
INA and INB register’s bits indicate the current logical states
of each of the 32 I/O pins in Port A and Port B, respectively.
INB is reserved for future use;
the Propeller P8X32A does not include Port B I/O pins so only
INA is discussed below.
INA is a read-only pseudo-register; when used as an instruction’s source operand, it reads the
current logic state of the corresponding I/O pins. Do not use
INA as the destination operand;
that only results in reading and modifying the shadow register whose address
INA occupies.
In
INA, a low (0) bit indicates the corresponding I/O pin senses ground, and a high (1) bit
indicates it senses VDD (3.3 volts). The following code writes the current state of I/O pins
P0 through P31 into a register named
Temp.
mov Temp, ina
See Registers, page 338, and the Spin language INA, INB section, page 118, for more
information. Keep in mind that in Propeller Assembly, unlike in Spin, all 32 bits of
INA are
accessed at once unless the
MUXx instructions are used.
Propeller Manual v1.1 · Page 297