SAM88RI INSTRUCTION SET

S3C9228/P9228

 

 

PUSH — Push To Stack

PUSHsrc

Operation: SP ¨ SP – 1

@SP ¨ src

A PUSH instruction decrements the stack pointer value and loads the contents of the source (src) into the location addressed by the decremented stack pointer. The operation then adds the new value to the top of the stack.

Flags: No flags are affected.

Format:

opc

src

 

 

Bytes

Cycles

Opcode

Addr Mode

 

 

(Hex)

dst

2

8

70

R

 

8

71

IR

Examples: Given: Register 40H = 4FH, register 4FH = 0AAH, SP = 0C0H:

PUSH

40H

Register 40H

= 4FH, stack register 0BFH = 4FH,

 

 

 

SP = 0BFH

 

PUSH

@40H

Register 40H

= 4FH, register 4FH = 0AAH, stack register

 

 

 

0BFH = 0AAH, SP = 0BFH

In the first example, if the stack pointer contains the value 0C0H, and general register 40H the value 4FH, the statement "PUSH 40H" decrements the stack pointer from 0C0 to 0BFH. It then loads the contents of register 40H into location 0BFH. Register 0BFH then contains the value 4FH and SP points to location 0BFH.

6-36

Page 352
Image 352
Samsung S3C9228/P9228, 8-Bit CMOS Microcontroller user manual Push Push To Stack