| Electronic Components Datasheet Search |
|
UPD17P136ACT Datasheet(PDF) 56 Page - NEC |
|
|
|||||||||||||||||||||||||||||
UPD17P136ACT Datasheet(HTML) 56 Page - NEC |
|
56 / 292 page ![]() CHAPTER 6 STACK 37 6.5 STACK POINTER (SP) AND INTERRUPT STACK REGISTERS The stack pointer is a 3-bit binary counter that specifies the addresses of the five address stack registers as shown in Figure 6-1, and is assigned to address 01H of the register file. The value of the stack pointer is initialized to 5H at reset. • The value of SP is decremented by one when the CALL addr or CALL @AR instruction is executed, when the first instruction cycle of the “MOVT DBF, @AR” instruction is executed, or when an interrupt is accepted. • The value of SP is incremented by one when the RET or RETSK instruction is executed, when the second instruction cycle of the “MOVT DBF, @AR” instruction is executed, when the POP AR instruction is executed, or when the RETI instruction is executed. When an interrupt is accepted, the counter of the interrupt stack registers is also decremented by one in addition to the SP. The value of the counter of the interrupt stack registers is incremented by one only when the RETI instruction is executed. Table 6-1. Operation of Stack Pointer Instruction Value of stack pointer (SP) Counter of interrupt stack registers CALL addr CALL @AR –1 MOVT, DBF @AR (1st instruction cycle) PUSH AR Not affected RET RETSK +1 MOVT DBF, @AR (2nd instruction cycle) POP AR Accepting interrupt –1 –1 RETI +1 +1 Remark Two instruction cycles are required to execute the “MOVT DBF, @AR” instruction, but this is an exception. Because the stack pointer (SP) is a 3-bit binary counter, it can take a value 0H to 7H. If the value of the stack pointer is 6 or more, however, an internal reset signal is generated (to prevent a hang-up). This is because only five address stack registers are available. Because the stack pointer is located on the register file, its value can be directly read by manipulating the register file with the POKE instruction. The value of the stack pointer is also changed at this time, but the values of the address stack registers are not affected. Of course, the stack pointer can also be read by using the PEEK instruction. The value of the stack pointer is 5H at reset. |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |