Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
101
Добавлен:
01.03.2016
Размер:
921.07 Кб
Скачать

PM0044 STM8 instruction set

POPW

 

Pop word from stack

POPW

Syntax

POPW dst

e.g. POPW X

 

Operation

dstH <= (++SP)

 

 

 

dstL <= (++SP)

 

 

Description Restore from the stack a data value which will be placed in dst location (index register). The stack pointer is incremented by two. This instruction is used to restore an index register value.

Instruction overview

mnem

dst

 

 

Affected condition flags

 

 

 

 

 

 

 

 

 

V

I1

H

I0

N

Z

C

 

 

 

 

 

 

 

 

 

 

 

POPW

X

-

-

-

-

-

-

-

 

 

 

 

 

 

 

 

 

POPW

Y

-

-

-

-

-

-

-

 

 

 

 

 

 

 

 

 

Detailed description

dst

Asm

 

 

X

POPW X

 

 

Y

POPW Y

 

 

See also: PUSHW, POP

cy

lgth

 

 

2

1

 

 

2

2

 

 

 

Op-code(s)

 

ST7

 

 

 

 

 

 

 

85

 

 

 

 

 

 

 

 

 

 

90

85

 

 

 

 

 

 

 

 

 

 

Doc ID 13590 Rev 3

127/162

STM8 instruction set

PM0044

 

 

PUSH

 

Push into the Stack

PUSH

Syntax

PUSH src

e.g.:PUSH A

 

Operation

(SP--) <= dst

 

 

Description

Save into the stack the dst byte location. The stack pointer is decremented

 

by one. Used to save a register value and a memory byte on to the stack.

Instruction overview

mnem

dst

 

 

Affected condition flags

 

 

 

 

 

 

 

 

 

V

I1

H

I0

N

Z

C

 

 

 

 

 

 

 

 

 

 

 

PUSH

A

-

-

-

-

-

-

-

 

 

 

 

 

 

 

 

 

PUSH

CC

-

-

-

-

-

-

-

 

 

 

 

 

 

 

 

 

PUSH

Imm

-

-

-

-

-

-

-

 

 

 

 

 

 

 

 

 

PUSH

Mem

-

-

-

-

-

-

-

 

 

 

 

 

 

 

 

 

Detailed description

dst

Asm

 

cy

lgth

 

 

 

Op-code(s)

 

ST7

 

 

 

 

 

 

 

 

 

 

 

 

A

PUSH A

 

1

1

 

 

88

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

CC

PUSH CC

 

1

1

 

 

8A

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

#byte

PUSH #$10

 

1

2

 

 

4B

 

XX

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

longmem

PUSH $1000

 

1

3

 

 

3B

 

MS

LS

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

See also: POP, PUSHW

128/162

Doc ID 13590 Rev 3

PM0044 STM8 instruction set

PUSHW

Push word onto the Stack

PUSHW

Syntax

PUSHW src

e.g. PUSHW X

 

Operation

(SP--) <= dstL

 

 

 

(SP--) <= dstH

 

 

Description Save the dst index register onto the stack. The stack pointer is decremented by two. Used to save an index register value onto the stack.

Instruction overview

mnem

 

dst

 

 

 

 

 

Affected condition flags

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

V

 

I1

 

 

H

 

 

I0

 

N

Z

C

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PUSHW

 

X

-

 

-

 

-

 

-

-

-

-

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PUSHW

 

Y

-

 

-

 

-

 

-

-

-

-

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Detailed description

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

dst

 

Asm

 

 

cy

lgth

 

 

 

 

 

Op-code(s)

 

ST7

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

X

 

PUSHW X

 

 

2

1

 

 

 

 

89

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Y

 

PUSHW Y

 

 

2

2

 

90

 

89

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

See also: POPW, PUSH

Doc ID 13590 Rev 3

129/162

STM8 instruction set

PM0044

 

 

RCF

Reset Carry Flag

RCF

Syntax

RCF

 

Operation

C = 0

 

Description

Clear the carry flag of the Condition Code (CC) register. May be used as a

 

boolean user controlled flags.

 

Instruction overview

mnem

 

 

Affected condition flags

 

 

 

 

 

 

 

 

 

V

I1

H

I0

N

Z

C

 

 

 

 

 

 

 

 

 

RCF

-

-

-

-

-

-

0

 

 

 

 

 

 

 

 

C: 0

Cleared.

Detailed description

Addressing

Asm

 

cy

lgth

 

 

Op-code(s)

 

ST7

mode

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Inherent

RCF

 

1

1

 

 

98

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

See also: SCF, RVF

130/162

Doc ID 13590 Rev 3

PM0044

STM8 instruction set

 

 

RET

Return from subroutine

Syntax

RET

Operation

MSB (PC) = (++SP)

 

LSB (PC) = (++SP)

RET

 

Description

Restore the PC from the stack. The stack pointer is incremented twice. This

 

 

 

instruction, is the last instruction of a subroutine in same section.

 

 

Instruction overview

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

mnem

 

 

 

 

 

 

 

 

 

Affected condition flags

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

V

 

 

 

I1

 

 

H

I0

 

N

 

Z

 

C

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

RET

 

-

 

 

 

-

-

 

-

 

-

 

-

 

 

-

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Detailed description

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Addressing

 

Asm

 

cy

 

lgth

 

 

 

 

Op-code(s)

 

 

 

ST7

 

 

 

mode

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Inherent

 

 

RET

 

4

 

1

 

 

 

 

81

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

See also: CALL, CALLR

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Note:

Please note that the RET should be in the same section as the corresponding CALL.

 

Doc ID 13590 Rev 3

131/162

Соседние файлы в папке Минимум документации STM8