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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

ST - Store Indirect From <strong>Register</strong> to data space using Index X<br />

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

Description:<br />

Stores one byte indirect from a register to data space. For parts with SRAM, the data space consists of the register file, I/O<br />

memory and internal SRAM (and external SRAM if applicable). For parts without SRAM, the data space consists of the register<br />

file only. The EEPROM has a separate address space.<br />

The data location is pointed to by the X (16 bits) pointer register in the register file. Memory access is limited to the current<br />

data segment of 64K bytes. To access another data segment in devices with more than 64K bytes data space, the RAMPX<br />

in register in the I/O area has to be changed.<br />

The X pointer register can either be left unchanged by the operation, or it can be post-incremented or pre-decremented.<br />

These features are especially suited for accessing arrays, tables, and stack pointer usage of the X pointer register. Note<br />

that only the low byte of the X pointer is updated in devices with no more than 256 bytes data space. For such devices, the<br />

high byte of the pointer is not used by this instruction and can be used for other purposes. The RAMPX register in the I/O<br />

area is updated in parts with more than 64K bytes data space.<br />

The result of these combinations is undefined:<br />

ST X+, r26<br />

ST X+, r27<br />

ST -X, r26<br />

ST -X, r27<br />

Using the X pointer:<br />

Operation: Comment:<br />

(i) (X) ← Rr X: Unchanged<br />

(ii) (X) ← Rr X ← X+1 X: Post incremented<br />

(iii) X ← X - 1 (X) ← Rr X: Pre decremented<br />

Syntax: Operands: Program Counter:<br />

(i) ST X, Rr 0 ≤ r ≤ 31 PC ← PC + 1<br />

(ii) ST X+, Rr 0 ≤ r ≤ 31 PC ← PC + 1<br />

(iii) ST -X, Rr 0 ≤ r ≤ 31 PC ← PC + 1<br />

16-bit Opcode :<br />

(i) 1001 001r rrrr 1100<br />

(ii) 1001 001r rrrr 1101<br />

(iii) 1001 001r rrrr 1110<br />

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

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

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

121

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

Saved successfully!

Ooh no, something went wrong!