Electronic Circuits - Electronic Tutorials - Electronic Hobby Projects - A Complete Electronic Resource Centre

MICROCONTROLLER TUTORIALS - 8051

Videos

Products

Sitemap

Circuits

Tutorials

8051

Introduction

Chapter 1
Types of Memory

Chapter 2
Special Function Registers

Chapter 3
Basic Registers

Chapter 4
Addressing Modes

Chapter 5
Program Flow

Chapter 6
Low Level Information

Chapter 7
Timers

Chapter 8
Serial Port Operations

Chapter 9
Interrupts

Additional Features in 8052

8052 Instruction Set

8051 Microcontroller
Register Protection

Author : Craig Steiner

Source : 8052.com

Important Interrupt Consideration: Register Protection

One very important rule applies to all interrupt handlers: Interrupts must leave the processor in the same state as it was in when the interrupt initiated.

Remember, the idea behind interrupts is that the main program isn’t aware that they are executing in the "background." However, consider the following code:

CLR C ;Clear carry
MOV A,#25h ;Load the accumulator with 25h
ADDC A,#10h ;Add 10h, with carry

After the above three instructions are executed, the accumulator will contain a value of 35h.

>>> Enter here for detail on "Register Protection" <<<

<<< Click here to come back on (8051 - Interrupts)

<<<<  Back to 8051 / 52  Microcontroller Tutorial