INPUT sX, Operand — Set PORT_ID to Operand, Read value on IN_PORT into Register sX

R

INPUT sX, Operand — Set PORT_ID to Operand, Read value on IN_PORT into Register sX

The INPUT instruction sets the PORT_ID output port to either the value specified by register sY or by the immediate constant kk. The instruction then reads the value on the IN_PORT input port into register sX. Flags are not affected by this operation.

Interface logic decodes the PORT_ID address to provide the correct value on IN_PORT.

Examples

INPUT sX, sY ; Read the value on IN_PORT into register sX, set PORT_ID

;to the contents of sY

INPUT sX, kk ; Read the value on IN_PORT into register sX, set PORT_ID ; to the immediate constant kk

Pseudocode

PORT_ID Å Operand

sX Å IN_PORT

PC Å PC + 1

Registers/Flags Altered

Registers: sX, PC

Flags: None

Notes

pBlazIDE Equivalent: IN

The READ_STROBE output is asserted during the second CLK cycle of the two-cycle

INPUT operation.

PicoBlaze 8-bit Embedded Microcontroller

www.xilinx.com

99

UG129 (v1.1.2) June 24, 2008

Page 99
Image 99
Xilinx UG129 manual Portid Å Operand SX Å Inport PC Å PC +