32-Bit Instruction Set

STS8s

Store 8-bit Data To Memory (Stack-Addressing Mode)

Operation:

 

 

 

 

bnMem32[align32(%sp + IMM10)] bnR0 where n = IMM10[1..0]

 

 

Assembler Syntax:

 

 

STS8s [%sp,IMM10],%r0

 

 

 

 

 

 

 

Example:

 

 

 

 

STS8s [%sp,13],%r0 ; can only be %sp and %r0

 

 

 

Description:

 

 

 

 

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

 

 

 

 

 

 

plus IMM10). The two least-significant bits of IMM10 selects which byte of %r0 is

 

 

 

 

 

 

stored (byte 3 is most significant).

 

 

 

 

 

 

 

 

 

 

 

 

 

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

 

 

 

 

 

 

 

operation to a byte-offset from the stack-pointer in a 1Kbyte range. Given a byte

 

 

 

 

 

 

held in bits 7..0 of any register %rX, the following sequence writes this byte to

 

 

 

 

 

 

memory at the byte-offset Y from %sp (%sp presumed to hold a word-aligned

 

 

 

 

 

 

address):

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

FILL8 %r0,%rX

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

STS8s [%sp,Y],%r0

 

 

 

 

 

 

 

Condition Codes:

 

 

Flags: Unaffected

 

 

 

 

 

 

 

 

 

 

 

 

 

 

N

 

V

Z

C

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Instruction Format:

 

 

i10

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Instruction Fields:

 

 

IMM10 = 10-bit immediate value

 

 

 

 

 

 

 

15

14

13

 

12

11

10

 

9

8

7

6

5

4

3

2

1

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0

1

1

 

0

0

0

 

 

 

 

 

 

 

IMM10

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

98

Altera Corporation

Page 110
Image 110
Excalibur electronic A-MNL-NIOSPROG-01.1 manual Store 8-bit Data To Memory Stack-Addressing Mode, STS8s %sp,IMM10,%r0