Doc Bot

Download | Tutorials | Instruction Set | Hardware Reference
Introduction | About Doc Bot | Site Map | Search | Use License | Contact Us
Download
Screenshots
Table Of Contents | Addressing Modes | Memory Model | External Ports | Instruction Set | Hardware Reference | Turn Cycles | File format
Table Of Contents | Introduction | Types Of Memory | Special Function Registers | Basic Registers | Addressing Modes | Program Flow | Timers | External Ports | Interrupts | Power Control Modes | Hardware Components
Table Of Contents | Calculate Square Roots | Safe Division

Documentation

small logo

Special function registers (SFRs)

List of special function registers (SFRs)
RegisterAddressExplanation of function
PC0x0089Program Counter - Not addressable - Points to the memory address of the next instruction to be executed.
SP0x0081Stack Pointer - Points to the current top-most internal memory position of the stack (i.e. the next value to be removed from the stack). It is initialized at 0x0028.
B0x00F0B Register - Used by MUL and DIV to store the higher bytes and remainder of the operations, respectively.
CMP0x0086Comparison Register - Used by CJNE to make comparisions for conditional branching.
IR0x00A1Instruction Register - Not addressable - Register where the current instruction is read for execution.
O1R0x00A2Operand 1 Register - Not addressable - Register where the first operand of the current instruction is read for execution.
O2R0x00A3Operand 2 Register - Not addressable - Register where the second operand of the current instruction is read for execution.
EA1R0x00A4Effective Address 1 Register - Not addressable - Register where the memory address of the first operand of the current instruction is read for execution.
EA2R0x00A5Effective Address 2 Register - Not addressable - Register where the memory address of the second operand of the current instruction is read for execution.
PSW*0x00D0Program Status Word - Bit-addressable - Contains several bits used internally by some instructions, including the carry flag and the overflow flag. This register should be preserved during interrupt handlers.
ISW*0x00C0Interrupt Status Word - Bit-addressable - Contains several bits used internally by the microcontroller to handle interrupts. This register should not be preserved during interrupt handlers.
PCON*0x0087Power Control - Bit-addressable - Controls the CPU's power control modes, to make it go into sleep.
TCON*0x0088Timer Control - Bit-addressable - Controls the timers' mode of operation and whether the timers are running.
XCON*0x00E0External Port Control - Bit-addressable - Controls the external ports' mode of operation and contains several bits that are set or cleared by the external gates.
IE*0x00A8Interrupt Enable - Bit-addressable - Enables and disables the specific interrupts, with one bit for each interrupt.
IP*0x00B8Interrupt Priority - Bit-addressable - Specifies the priority of each interrupt, with one bit for each interrupt.
TIM00x008ATimer 0 - A 2 byte value that is incremented by one at each machine cyle.
TRE00x008CTimer 0 Reload - Initialized to 0x0000, when timer 0 overflows it resets to the value stored at TRE0.
TIM10x008BTimer 1 - A 2 byte value that is incremented by one at each machine cyle.
TRE10x008DTimer 1 Reload - Initialized to 0x0000, when timer 1 overflows it resets to the value stored at TRE1.
TIM20x0082Timer 2 - A 2 byte value that is incremented by one at each machine cyle.
TRE20x0084Timer 2 Reload - Initialized to 0x0000, when timer 2 overflows it resets to the value stored at TRE2.
TIM30x0083Timer 3 - A 2 byte value that is incremented by one at each machine cyle.
TRE30x0085Timer 3 Reload - Initialized to 0x0000, when timer 3 overflows it resets to the value stored at TRE3.
P00x0080Port 0 Input Register - Data from external port 0 is read here.
P10x0090Port 1 Input Register - Data from external port 1 is read here.
P20x00A0Port 2 Input Register - Data from external port 2 is read here.
P30x00B0Port 3 Input Register - Data from external port 3 is read here.
P40x00C8Port 4 Input Register - Data from external port 4 is read here.
P50x00D8Port 5 Input Register - Data from external port 5 is read here.
P60x00E8Port 6 Input Register - Data from external port 6 is read here.
P70x00F8Port 7 Input Register - Data from external port 7 is read here.
ISRP00x0091Interrupt Service Routine Port 0 - Memory address of the interrupt handler for External Port 0 interrupts.
ISRT00x0092Interrupt Service Routine Timer 0 - Memory address of the interrupt handler for Timer 0 interrupts.
ISRP10x0093Interrupt Service Routine Port 1 - Memory address of the interrupt handler for External Port 1 interrupts.
ISRT10x0094Interrupt Service Routine Timer 1 - Memory address of the interrupt handler for Timer 1 interrupts.
ISRP20x0095Interrupt Service Routine Port 2 - Memory address of the interrupt handler for External Port 2 interrupts.
ISRT20x0096Interrupt Service Routine Timer 2 - Memory address of the interrupt handler for Timer 2 interrupts.
ISRP30x0099Interrupt Service Routine Port 3 - Memory address of the interrupt handler for External Port 3 interrupts.
ISRT30x009AInterrupt Service Routine Timer 3 - Memory address of the interrupt handler for Timer 3 interrupts.
ISRP40x009BInterrupt Service Routine Port 4 - Memory address of the interrupt handler for External Port 4 interrupts.
ISRP50x009CInterrupt Service Routine Port 5 - Memory address of the interrupt handler for External Port 5 interrupts.
ISRP60x009DInterrupt Service Routine Port 6 - Memory address of the interrupt handler for External Port 6 interrupts.
ISRP70x009EInterrupt Service Routine Port 7 - Memory address of the interrupt handler for External Port 7 interrupts.
R00–R1F0x0000–0x001FAuxiliary Registers - 32 registers that can be used by the program freely.

Special Function Registers (SFRs)
 01234567 
 89ABCDEF 
0080P0SPTIM2TIM3TRE2TRE3CMPPCON0087
0088TCONPCTIM0TIM1TRE0TRE1  008F
0090P1ISRP0ISRT0ISRP1ISRT1ISRP2ISRT2 0097
0098 ISRP3ISRT3ISRP4ISRP5ISRP6ISRP7 009F
00A0P2IRO1RO2REA1REA2R  00A7
00A8IE       00AF
00B0P3       00B7
00B8IP       00BF
00C0ISW       00C7
00C8P4       00CF
00D0PSW       00D7
00D8P5       00DF
00E0XCON       00E7
00E8P6       00EF
00F0B       00F7
00F8P7       00FF
 Red SFRs are bit-addressable
 Yellow Background are control SFRs
 Blue Background are I/O port SFRs
 Orange Background are Timer SFRs
 Pink Background are Interrupt Handler SFRs
 Green Background are other SFRs
Introduction | About Doc Bot | Site Map | Search | Use License | Contact Us
©2009 Daniel Julivert