INA, INB

Register: Input registers for 32-bit ports A and B. 

DAT
Label > Condition Instruction > DestOperandINA Effects >


DAT
Label > < Condition > Instruction DestOperandINB Effects > (Reserved for future use)

  • Label is an optional statement label. See Common Syntax Elements.
  • Condition is an optional execution condition. See Common Syntax Elements.
  • 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 (DIRADIRBINAINBOUTA 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 , and the Spin language INA, INB section, 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.

Unless otherwise noted, content on this site is licensed under the
Creative Commons Attribution-ShareAlike 4.0 International License.