| Electronic Components Datasheet Search |
|
XMEGAD Datasheet(PDF) 9 Page - ATMEL Corporation |
|
|
|||||||||||||||||||||||||||||
XMEGAD Datasheet(HTML) 9 Page - ATMEL Corporation |
|
9 / 309 page ![]() 9 8210B–AVR–04/10 XMEGA D 3.7 Status Register The Status Register (SREG) contains information about the result of the most recently executed arithmetic or logic instruction. This information can be used for altering program flow in order to perform conditional operations. Note that the Status Register is updated after all ALU opera- tions, as specified in the instruction set reference. This will in many cases remove the need for using the dedicated compare instructions, resulting in faster and more compact code. The Status Register is not automatically stored when entering an interrupt routine nor restored when returning from an interrupt. This must be handled by software. The Status Register is accessible in the I/O Memory space. 3.8 Stack and Stack Pointer The Stack is used for storing return addresses after interrupts and subroutine calls. It can also be used for storing temporary data. The Stack Pointer (SP) register always points to the top of the Stack. It is implemented as two 8-bit registers that is accessible in the I/O Memory space. Data is pushed and popped from the Stack using the PUSH and POP instructions. The Stack is implemented as growing from higher memory locations to lower memory locations. This implies that a pushing data on the Stack decreases the SP, and popping data off the Stack increases the SP.The SP is automatically loaded after reset, and the initial value is the highest address of the internal SRAM. If the SP is changed, it must be set to point above address 0x2000 and it must be defined before any subroutine calls are executed or before interrupts are enabled. During interrupts or subroutine calls the return address is automatically pushed on the Stack. The return address can be two or three bytes, depending of the memory size of the device. For devices with 128K bytes or less of program memory the return address is two bytes, hence the Stack Pointer is decremented/incremented by two. For devices with more than 128K bytes of program memory, the return address is three bytes, hence the SP is decremented/incremented by three. The return address is popped of the Stack when returning from interrupts using the RETI instruction, and subroutine calls using the RET instruction. The SP is decremented by one when data is pushed onto the Stack with the PUSH instruction, and incremented by one when data is popped off the Stack using the POP instruction. To prevent corruption when updating the Stack Pointer from software, a write to SPL will auto- matically disable interrupts for up to 4 instructions or until the next I/O memory write. 3.9 Register File The Register File consists of 32 x 8-bit general purpose registers. In order to achieve the required performance and flexibility, the Register File supports the following input/output schemes: • One 8-bit output operand and one 8-bit result input • Two 8-bit output operands and one 8-bit result input • Two 8-bit output operands and one 16-bit result input • One 16-bit output operand and one 16-bit result input |
|
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 |