21.08.2013 Views

AVR Instruction Set Nomenclature: Status Register (SREG ...

AVR Instruction Set Nomenclature: Status Register (SREG ...

AVR Instruction Set Nomenclature: Status Register (SREG ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

IN - Load an I/O Location to <strong>Register</strong><br />

Description:<br />

Loads data from the I/O Space (Ports, Timers, Configuration registers etc.) into register Rd in the register file.<br />

Operation:<br />

(i) Rd ← I/O(A)<br />

Syntax: Operands: Program Counter:<br />

(i) IN Rd,A 0 ≤ d ≤ 31, 0 ≤ A ≤ 63 PC ← PC + 1<br />

68<br />

16-bit Opcode:<br />

<strong>Status</strong> <strong>Register</strong> (<strong>SREG</strong>) and Boolean Formula:<br />

Example:<br />

1011 0AAd dddd AAAA<br />

I T H S V N Z C<br />

- - - - - - - -<br />

in r25,$16 ; Read Port B<br />

cpi r25,4 ; Compare read value to constant<br />

breq<br />

...<br />

exit ; Branch if r25=4<br />

exit: nop ; Branch destination (do nothing)<br />

Words: 1 (2 bytes)<br />

Cycles: 1<br />

<strong>Instruction</strong> <strong>Set</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!