32-Bit Instruction Set

ST8s

Store 8-bit Data To Memory (Static Byte-Offset Address)

Operation:

 

 

 

 

Not preceded by PFX:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

bnMem32[align32(RA)] bnR0 where n = IMM2

 

 

 

 

 

 

 

 

 

 

 

Preceded by PFX:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

bnMem32[align32(RA + (σ(K) × 4))] bnR0 where n = IMM2

 

 

 

Assembler Syntax:

 

 

ST8s [%rA],%r0,IMM2

 

 

 

 

 

 

 

 

 

 

Example:

 

 

 

 

Not preceded by PFX:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

MOVI %g4,12

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

ST8s [%g4],%r0,3 ; store high byte of %r0 to mem[15]

 

 

 

 

 

 

 

Preceded by PFX:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PFX 9

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

ST8s [%g4],%r0,2 ; store byte 2 of %r0 to

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

; mem[%g4 + 36 + 2]

 

 

 

 

Description:

 

 

 

 

Not preceded by PFX:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Stores one of the four bytes of %r0 to memory at the byte-address given by

 

 

 

 

 

 

 

(RA[31..2] plus IMM2). The two bits RA[1..0] are ignored. IMM2 selects which

 

 

 

 

 

 

byte of %r0 is stored (byte 3 is most significant).

 

 

 

 

 

 

 

 

 

 

 

ST8s may be used in combination with FILL8 to implement a byte-store operation

 

 

 

 

 

 

to a byte-offset from a word-aligned base pointer. Given a byte held in bits 7..0 of

 

 

 

 

 

 

any register %rX, the following sequence writes this byte to memory at the byte-

 

 

 

 

 

 

address given by (RA + Y )

(RA presumed to hold a word-aligned pointer):

 

 

 

 

 

 

 

 

 

 

FILL8 %r0,%rX

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PFX Y >> 2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

ST8s [%rA],%r0,Y & 3

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Preceded by PFX:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

A 13-bit signed, byte-scaled offset is formed by concatenating K with IMM2. This

 

 

 

 

 

 

offset (K : IMM2) is sign-extended to 32 bits and used as the byte-offset for the

 

 

 

 

 

 

ST-operation.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Condition Codes:

 

 

Flags: Unaffected

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

N

V

Z

C

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Instruction Format:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Ri2u

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Instruction Fields:

 

 

A = Register index of operand RA

 

 

 

 

 

 

 

 

 

 

 

 

 

 

IMM2 = 2-bit immediate value

 

 

 

 

 

 

 

 

15

14

13

 

12

11

 

 

10

 

9

8

 

7

 

6

5

 

4

3

2

1

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0

1

1

 

1

0

 

 

1

 

1

 

0

 

0

 

 

IMM2

 

 

 

A

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

94

Altera Corporation

Page 106
Image 106
Excalibur electronic A-MNL-NIOSPROG-01.1 manual ST8s, Store 8-bit Data To Memory Static Byte-Offset Address, Movi %g4,12