Sonic Alert msm80154s MSM80C154S/83C154S/85C154HVS Stack, Stack storage layout, PC5, PC1, PC9

Models: msm83c154s msm85c154hvs msm80154s

1 378
Download 378 pages 26.51 Kb
Page 67
Image 67

MSM80C154S/83C154S/85C154HVS

4.2.3 Stack

The stack data save (storage) area is in the internal data memory (RAM), and is specified by stack pointer (SP 81H).

Although 07H data is automatically set in the stack pointer when the CPU is reset, any desired data can be set by software to enable the data memory to be used as stack from any address. Two bytes of data memory are used when the stack is used by interrupt or CALL instruction, and a single byte of data memory is used when the PUSH instruction is used. The status where an interrupt is generated and the program counter contents are saved in the stack when the stack pointer contents are 7FH, and the status where accumulator contents are pushed during interrupt routine and are subsequently saved in the stack are shown in Table 4-2. The stack status up to completion of interrupt processing upon execution of POP and RETI instructions is also included.

Table 4-2 Stack storage layout

Stack processing

Stack

 

 

 

RAM data bit

 

 

 

pointer

7

6

5

4

3

2

1

0

 

 

 

 

 

 

 

 

 

 

 

Before execution

7FH

D7

D6

D5

D4

D3

D2

D1

D0

 

 

 

 

 

 

 

 

 

 

Interrupt process

80H

PC7

PC6

PC5

PC4

PC3

PC2

PC1

PC0

 

 

 

 

 

 

 

 

 

 

(push PC)

81H

PC15

PC14

PC13

PC12

PC11

PC10

PC9

PC8

 

 

 

 

 

 

 

 

 

 

PUSH process (ACC)

82H

A7

A6

A5

A4

A3

A2

A1

A0

 

 

 

 

 

 

 

 

 

 

POP process (ACC)

82H

A7

A6

A5

A4

A3

A2

A1

A0

 

 

 

 

 

 

 

 

 

 

RETI process (pop PC)

81H

PC15

PC14

PC13

PC12

PC11

PC10

PC9

PC8

 

 

 

 

 

 

 

 

 

80H

PC7

PC6

PC5

PC4

PC3

PC2

PC1

PC0

 

 

 

 

 

 

 

 

 

 

 

After execution

7FH

D7

D6

D5

D4

D3

D2

D1

D0

 

 

 

 

 

 

 

 

 

 

60

Page 67
Image 67
Sonic Alert msm80154s, msm83c154s, msm85c154hvs MSM80C154S/83C154S/85C154HVS Stack, Stack storage layout, PC5, PC1, PC9