Programable PPT
Programable PPT
Programable PPT
Registers
• Cortex-M3 and Cortex-M4 processors have a
number of registers inside the processor core
to perform data transfer, data processing and
control operations.
Word 3
Stack Pointer (SP)
• Used for accessing the stack memory via PUSH and POP
operations.
• Both MSP and PSP are 32-bit, but the lowest two bits of the
Stack Pointers are always zero, and writes to these two bits
are ignored.
Contd.
• The Cortex-M processors use a stack memory model
called Full-Descending Stack.
• The stack grows down through decreasing memory
addresses and the SP points to the lowest address
containing a valid item.
• For each PUSH operation, the processor first decrements
the SP, then stores the value in the memory location
pointed by SP.
• SP points to the memory location where the last data was
pushed to the stack.
Example
PUSH {R1-R3}
4.2.3 Special registers
• Besides the registers in the register bank, there are a
number of special registers.
0xFFFFFF00 Q-bit?`
The Q bit is a “sticky” bit and saturation arithmetic/adjustment
operations do not clear this bit. It can be cleared by writing to
APSR.
Example- USAT
Privileged level
Contd.
CONTROL register
0x2200007C
Contd.
• When the bit-band alias address is accessed, the address
is remapped into a bit-band address.
0x2200007C
Keil Example
• To set bit 2 in word data in address 0x20000000, instead
of using three instructions to read the data, set the bit, and
then write back the result, this task can be carried out by a
single instruction
Read Operation
• Similarly, bit-band support can simplify
application code if we need to read a bit in a
memory location. For example, if we need to
determine bit 2 of address 0x20000000.
Contd.