0% found this document useful (0 votes)
115 views21 pages

Experiment:-1: AIM: - Introduction To 8086 Microprocessor

.

Uploaded by

Samarth Malik
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
115 views21 pages

Experiment:-1: AIM: - Introduction To 8086 Microprocessor

.

Uploaded by

Samarth Malik
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

EXPERIMENT :- 1

AIM :- Introduction to 8086 microprocessor.


Apparatus :- 8086 microprocessor , power supply .
Theory
 It is a 40 pin DIP chip based on n-channel, depletion load silicon gets technology(HNos).
 The term 16 bit means that it support 16 bit ALU. Its internal register and most of the
instructions are designed to work with 16 bit binary word.
 8086 is available at different clock speed via 5MHz(8086); 8MHz98086-2) and 10 MHz(8086-
1).
 8086 microprocessor has a 16 bit data bus and20 bit address bus. So, It can address any one
of the 2^20-1048576=1MB memory locations.
 The 8086 microprocessor can work in two modes of operation. They are minimum mode and
maximum mode. In the minimum mode of the operation of the microprocessor do not
associate with any co- processor and cannot be used for multiprocessor systems or co-
processor configuration. The minimum and maximum operation are decided by the pin
MN/MX(active low).when this pin is high 8086 operates in minimum mode otherwise it
operates in the maximum mode.
8086 Specifications
 It is a 16 bit microprocessor.
 It has a 20 bit address bus and can access up to 220 memory locations.
 It can support up to 64k input output ports.
 It provides 14, 16 bit registers.
 It has multiplexed address and data AD0-AD15 and A16-A19.\
 It requires single phase clock with 33% duty cycle to provide internal timing.
 It requires +5V supply.
 40 pin dual package.
 8086 supports 2 modes of operation.
1. Minimum mode
2. Maximum mode
To improve the performance by implementing the parallel processing concept the CPU of the
8086 is divided into two sections. They are:-
 Bus Interface Unit(BIU)
 Execution Unit(EU)
The BIU contains:
 The circuit for physical address calculations.
 The decoding instruction byte queue(6 byte long).
 Four 16-bit segment registers(ES,CS,SS,DS).
 16 bit instruction pointer(IP).
The EU contains:
 Control circuit for instruction decoder and ALU.
 16 bit flag register.
 Four 16 bit general purpose register(AX,BX,CX,DX).
 16 bit pointer register(SP,BP)
 16 bit index register(SI,DI).
Result :-
We have studied 8086 microprocessor.
EXPERIMENT :- 2
AIM: To ADD two binary numbers each 8 bytes long.
ADDRESS OPCODE MNEMONIC COMMENTS
0200 F8 CLC Clear carry flag
0201 B9 04 00 MOV CX,2004 Load Counter register with no. of times
addition to be performed(i.e. Initialize the
counter register)
0204 BE 00 03 MOV SI,0300 Load source index Reg. with starting
address of 1st Binary no.(LSBs array)
0207 BF 08 03 MOV DI,0308 Load Destination Index Reg. with Dest.
Address (where the result add. Is to be
started storing).Also it’s the starting
address of MSBs of array.
020A 8B 04 MOV AX,[SI] Load data bytes (which are in location 0300
and 0301 in 16 bit ACC.
i.e.(0300) – Ah
(0301) – AL
020C 11 05 ADC [DI],AX Add the contents (MS Bytes) of 0308, 0309
with the contents (LS Bytes) of 0300+0301
and store the results in location 0308
onwards.
020E 46 INC SI Point at 0302 LOCN (Next relevant source
020F 46 INC SI LOCN)
0210 47 INC DI Point at next relevant location, i.e. 0304
0211 47 INC DI
0212 49 DEC CX Decrement the counter.
0213 75 F5 JNZ 020A If not zero (i.e. CX =0000) then continue
addition.
0215 F4 HLT Else, Halt.

Result:
AFTER EXECUTION
0300 : 01 0308 : 0A 0308 : 0B
0301 : 02 0309 : 0B 0309 : 0D
0302 : 03 030A: 0C 030A: 0F
0303 : 04 030B: 0E 030B: 12
0304 : 05 030C: 0F 030C: 14
0305 : 06 030D: 10 030D: 16
0306 : 07 030E: 11 030E: 18
0307 : 08 030F: 12 030F: 1A
EXPERIMENT :- 3
AIM : To find the maximum no. in a given string (16 byte long) and store it in location
0310.
ADDRESS OPCODE MNEMONICS COMMENTS
0200 BE 00 03 MOV SI,0307 Load SI registers with
starting address of
string .

0203 B9 10 00 MOV CX,0010 Initialize counter


register (with the
length of string i.e.
no. of bytes.)
0206 B4 00 MOV AH,00 Initialize the 8-bit Acc.
0208 3A 24 CMP AH[SI] The 1st data byte of
the string with ‘00’
020A 73 02 JAE 020E If both byte match
(above is equal )then
branch to (l).
020C 8A 24 MOV AH[SI] Else, move the
contents of (0300)
into 8-bit acc.,i.e., real
no. in AH.
020E 46 INC S1 Point at the next
address of string.
020F E0 F7 LOOP NZ[AH] Decrement the
counter value , if not
0, continue
processing(searching
to the max no.
continued).
0211 88 24 MOV[SI],AH Max no. in 0310
addresse
0213 F4 HLT HALT

Result:-
After execution
0300 : 01 0308 : 12 0310:15
0301 :02 0309 :08
0302:03 030A:09
0303:04 030B:0A
0304:05 030C:0B
0305:06 030D:0E
0306:15 030E:0C
0307:07 030F:0D
EXPERIMENT :- 4
AIM : To sort a string of a number of bytes in descending order
ADDRESS OPCODE MNEMONICS COMMENTS
0200 BE 00 03 MOV SI,0300 Initialize SI reg. with
memory location
0300.
0203 8B 1C MOV BX,[SI] BX has the number of
bytes (to use for
sorting) location 0300
and 0301
0205 4B DEC BX Decrement the
number of bytes by 1
0206 8B 0C MOV CX[SI] Also CX has the
number of bytes 0300
and 0301
0208 49 DEC CX Decrement the
number of bytes by 1
0209 BE 02 03 MOV SI,0302 Initialize SI reg. with
starting address of
string
020C 8A 04 MOV AL,[SI] Move the first data
byte into AL
020E 46 INC SI Point to the bytes of
the string
020F 3A 04 COMP AL,[SI] Compare the two
bytes of the string
0211 73 06 JAE 0219 If 2 bytes are equal or
first byte is above
branch to (1)
0213 86 04 XCHG AL,SI Else
0215 4E DEC SI Second byte is less
than first byte and
swap the two bytes
0216 88 04 MOV [SI], AL
0218 46 INC SI Point at the next
location of the string
0219 E2 F1 LOOP 020C Loop if CX is not zero
021B 4B DEC BX At this juncture first
021C BE 00 03 MOV SI, 0300 sorting will be over
i.e., first number is
logically compared
with rest of the
number
021F 75 E5 JNZ 0206
0221 F4 HLT Halt
Result:
After execution
0300 : 05 0302:28
0301 :00 0303:25
0302:20 0304:20
0303:25 0305:15
0304:28 0306:07
0305:15
0306:07
EXPERIMENT :- 5
AIM : To multiply an ASCII string of eight numbers by a single
ASCII digit. The result is a strig of unpacked BCD digits.
ADDRESS OP CODE MNEMONIC COMMENTS
0200 BE 00 03 MOV SL, 0300 Load SI reg. with starting address
of string
0203 BF 08 03 MOV DI, 0308 Load DI reg . with starting address
Of result LOCNS .
0206 B2 34 MOV DL ,34 Load DL with multiplier ASCII Digit .
0208 B9 08 00 MOV CX,0008 Load counter register with the number
of bytes in the string
020B C6 05 00 MOV[DI],00
020E B0 E2 0F ANDL ,0F MS nibble of multiplier is zeroed
0211 BA 04 MOV AL,[SI] First ASCII no. of string in AL
0213 46 INC SI Point at the next LOCN in string
( of ASCII Nos. )
0214 60 E0 0F AND AL,0F MS nibble at multiplier no gap
And is also zeroed
0217 F6 E2 MUI DL Perform the fn. AX=AL*DL
0219 D4 0A AAM Perform the fn. AH=AL/0A
AL = reminder
021B 02 05 ADD AL,[DI] The contents of AL ( remainder obtained
by
performing the above operation )
021D 37 AAA Added in 00 which are in 1st Dest . LOCN .
the content
Of AL unpacked decimal no. and are
stored in 1st desti.
LOCN {=0308}
021E 88 05 MOV[DI]
0220 47 INC DI Point at the next Dest. LOCN
0221 88 25 MOB [DI],AH Content of AH (Quotient got in AAM
operation ) are moved in next Dest.
(0309).
0223 49 DEC CX Decrement the counter register
0224 75 EB JNZ 0211 If not zero , continue multiply and storing
BCD digits . ELSE
0226 F4 HLT HALT.

Result :-

After execution
0300 : 31 0308 : 04
0301 :32 0309 :08
0302:33 030A:02
0303:34 030B:07
0304:35 030C:01
0305:36 030D:06
0306:31 030E:06
0307: 32 030F:08
EXPERIMENT :- 6
AIM : To divide a string of unpacked ASCII digit.
ADDRESS OPCODE MNEMONICS COMMENTS
0200 B2 36 MOV DL,36 DL having the divisor,
a single 8 bit ASCII
digit.
0202 BE 00 03 MOV SL, 0300 Load SI with the
starting address of
ASCII string.
0205 BF 08 03 MOV DI, 0308 Load DI with the
starting address of
the result LOCNS
0208 B9 08 00 MOV CX, 0008 Initialize the counter
register with the
number of bytes in
the string.
020B BO E2 0F AND DL, 0F MS nibble of DL
contents in zeroed.
020E 32 E4 XOR AM, AH Initialize the 8 bit
ACC(=00)
0210 AC LODS B Load AL with the
contents of address
accessed by SI
register and
increment SI register
i.e. point at the next
address LOCN
0211 80 E0 0F AND ALOF MS nibble of AL
contents is also
zeroed.
0214 B5 0A AAD Perform the fn.
AL=[(AH*0A)+AL],
AH=00
0216 F6 F2 DIV DL Perform the fn AD/DL
AL= quotient and AH=
remainder.
0218 AA STOS B The contents of AL
are stored in the
address pointed to by
the D1 register, and
next address LOCN in
D1 register is pointed
(i.e. current address
LOCN of D1 register is
incremented by one).
0219 E0 F5 LOOP NZ 0210 Continue dividing the
unpacked ASCII digits
if the contents of are
not zeroed else.
021B F4 HLT Halt

Result:
After execution
0300 : 31 0308 :00
0301 : 32 0309: 02
0302: 33 030A: 00
0303: 34 030B: 05
0304: 35 030C: 07
0305: 36 030D: 06
0306: 31 030E: 00
0307: 32 030F: 02
0308: 08
EXPERIMENT :- 7
AIM : To calculate the no of bytes in a string starting from 0302 up
to an identifier placed in AL register. The actual count will be in
location 0300 and 0301.
ADDRESS OPCODE MNEMONICS COMMENTS
0200 BE 00 03 MOV SI,0300 Load SI reg. with
starting address
where the result is to
be stored
0203 BE FF FF MOV CX,FFFF Initialize the counter
reg.
0206 BF 02 03 MOV DI,0302 Load DI reg. with the
starting address of
string.
0209 B0 03 MOV AL,03 Store the identifier in
ASL
020B F2 AE REPNZ Data byte accessed by
BI reg. compared with
identifier without
altering either of
contents .
020C AE SCASB
020D F7 B1 NOT CX ZX complemented CX
and move
020F 89 0C MOV SI,CX CX 89 0C MOV[SI], CX
020F Content into
0300.
0211 CC INT 3 Halt

Result:
After execution
0300 : 03 0301:00
EXPERIMENT :- 8
UNIVERSAL Board has on board
(a) ADC section.
(b) RTC & EEPROM section.
(c) DISPLAY (LCD, LED, & 7-SEG) section.
(d) INPUT SWITCHES (PUSH BUTTON & DIP SWITCH) section.
(f)RELAY section.
(e) BUZZER section

PERIPHERALS POWER SUPPLY REQUIREMENTS

Part No. Specifications Voltage Rating Current Rating

ADC0809CCN 8-BIT 8-CHANNEL, 100s. +/- 5 V 1A


DS1307 64X8, SERIAL I2C Real Time +/- 12V 1A
Clock.
24C04 4K serial EEPROM.
LCD 16 x 2 character LCD
BUZZER 5V
RELAY 5A/250V AC

PHILIPS (P89C51RD2BN) DAUGHTER BOARD

FEATURES
• 89C51 Central Processing Unit
• On-chip Flash Program Memory with In-System Programming (ISP) and In-Application Programming
(IAP) capability
• Boot ROM contains low level Flash programming routines for downloading via the UART
• Can be programmed by the end-user application (IAP)
• Parallel programming with 87C51 compatible hardware interface to programmer
• Supports 6-clock/12-clock mode via parallel programmer (default clock mode after ChipErase is 12-
clock)
• 6-clock/12-clock mode Flash bit erasable and programmable via ISP
• 6-clock/12-clock mode programmable “on-the-fly” by SFR bit
• Peripherals (PCA, timers, UART) may use either 6-clock or
12-clock mode while the CPU is in 6-clock mode
• Speed up to 20 MHz with 6-clock cycles per machine cycle (40 MHz equivalent performance); up to
33 MHz with 12 clocks per machine cycle
• Fully static operation
• RAM expandable externally to 64 kbytes
• Four interrupt priority levels
• Seven interrupt sources
• Four 8-bit I/O ports
• Full-duplex enhanced UART
– Framing error detection
– Automatic address recognition
• Power control modes
– Clock can be stopped and resumed
– Idle mode
– Power down mode
• Programmable clock-out pin
• Second DPTR register
• Asynchronous port reset
• Low EMI (inhibit ALE)
• Programmable Counter Array (PCA)
– PWM
– Capture/compare
UNIVERSAL BOARD
ANALOG TO DIGITAL CONVERTER (ADC0809)

Features:
 Easy interface to all microprocessors
 Operates ratio metrically or with 5 VDC or analog span
 adjusted voltage reference
 No zero or full-scale adjust required
 8-channel multiplexer with address logic
 0V to 5V input range with single 5V power supply
 Outputs meet TTL voltage level specifications
 ADC0808 equivalent to MM74C949
 ADC0809 equivalent to MM74C949-1
Key Specifications
 Resolution 8 Bits
 Total Unadjusted Error ±1⁄2 LSB and ±1 LSB
 Single Supply 5 VDC
 Low Power 15 mW
 Conversion Time 100

CIRCUIT DIAGRAM FOR ADC

CONTROL & CHANNEL SELECT


LINES

DIGITAL OUTPUT

CIRCUIT DIAGRAM FOR DISPLAY SECTION

CONTROL DATA
LED

CIRCUIT DIAGRAM FOR STEPPER MOTOR

Stepper motor

CIRCUIT DIAGRAM FOR RELAY SECTION

RL2

External 12 V
RL1 Supply

CIRCUIT DIAGRAM FOR RTC & E2PROM


3.6V Battery

32.768 Crystal Square wave


Connectors

RTC & E2PROM

RTC DS1307 FEATURES


 Real-time clock (RTC) counts seconds, minutes, hours, date of the month, month, day of the
week, and year with leap-year compensation valid up to 2100
 56-byte, battery-backed, nonvolatile (NV) RAM for data storage
 Two-wire serial interface
 Programmable square wave output signal
 Automatic power-fail detect and switch circuitry
 Consumes less than 500nA in battery backup mode with oscillator running
 Optional industrial temperature range: -40°C to +85°C
 Available in 8-pin DIP or SOIC
 Underwriters Laboratory (UL) recognized

E2PROM 24C04 FEATURES


 Low-voltage and Standard-voltage Operation
– 2.7 (VCC = 2.7V to 5.5V)
– 1.8 (VCC = 1.8V to 5.5V)
 Internally Organized 128 x 8 (1K), 256 x 8 (2K), 512 x 8 (4K), 1024 x 8 (8K) or 2048 x 8 (16K)
 2-wire Serial Interface
 Schmitt Trigger, Filtered Inputs for Noise Suppression
 Bi-directional Data Transfer Protocol
 100 kHz (1.8V) and 400 kHz (2.5V, 2.7V, 5V) Compatibility
 Write Protect Pin for Hardware Data Protection
 8-byte Page (1K, 2K), 16-byte Page (4K, 8K, 16K) Write Modes
 Partial Page Writes are Allowed
 Self-timed Write Cycle (5 ms max)
 High-reliability
– Endurance: 1 Million Write Cycles
– Data Retention: 100 Years
 Automotive Grade, Extended Temperature and Lead-Free Devices Available
PIC 16F877A DAUGHTER CARD

FEATURES:-
High-Performance RISC CPU:
• Only 35 single-word instructions to learn
• All single-cycle instructions except for program branches, which are two-cycle
• Operating speed: DC – 20 MHz clock input DC – 200 ns instruction cycle
• Up to 8K x 14 words of Flash Program Memory,
Up to 368 x 8 bytes of Data Memory (RAM),
Up to 256 x 8 bytes of EEPROM Data Memory
• Pinout compatible to other 28-pin or 40/44-pin PIC16CXXX and PIC16FXXX microcontrollers

Peripheral Features:
• Timer0: 8-bit timer/counter with 8-bit prescaler
• Timer1: 16-bit timer/counter with prescaler, can be incremented during Sleep via external
crystal/clock
• Timer2: 8-bit timer/counter with 8-bit period register, prescaler and postscaler
• Two Capture, Compare, PWM modules
- Capture is 16-bit, max. resolution is 12.5 ns
- Compare is 16-bit, max. resolution is 200 ns
- PWM max. resolution is 10-bit
• Synchronous Serial Port (SSP) with SPI™ (Master mode) and I2C™ (Master/Slave)
• Universal Synchronous Asynchronous Receiver Transmitter (USART/SCI) with 9-bit address
detection
• Parallel Slave Port (PSP) – 8 bits wide with external RD, WR and CS controls (40/44-pin only)
• Brown-out detection circuitry for Brown-out Reset (BOR)

Analog Features:
• 10-bit, up to 8-channel Analog-to-Digital Converter (A/D)
• Brown-out Reset (BOR)
• Analog Comparator module with:
- Two analog comparators
- Programmable on-chip voltage reference (VREF) module
- Programmable input multiplexing from device inputs and internal voltage reference
- Comparator outputs are externally accessible
Special Microcontroller Features:
• 100,000 erase/write cycle Enhanced Flash program memory typical
• 1,000,000 erase/write cycle Data EEPROM memory typical
• Data EEPROM Retention > 40 years
• Self-reprogrammable under software control
• In-Circuit Serial Programming™ (ICSP™) via two pins
• Single-supply 5V In-Circuit Serial Programming
• Watchdog Timer (WDT) with its own on-chip RC oscillator for reliable operation
• Programmable code protection
• Power saving Sleep mode
• Selectable oscillator options
• In-Circuit Debug (ICD) via two pins
CMOS Technology:
• Low-power, high-speed Flash/EEPROM technology
• Fully static design
• Wide operating voltage range (2.0V to 5.5V)
• Commercial and Industrial temperature ranges
• Low-power consumption

General Procedures for 8051 microcontrollers


1. Double Click on the icon KEIL uVISION 3 present on the desktop.
2. The following window will be popped-up showing uVISION 3.
3. Close the existing Project if exists.
4. Go to the project & click on new project.
5. Make a folder on desktop & give file name e.g (xyz.asm) or (xyz.c).
6. when you click on the save button ,following window opens showing ‘Select Device for Target 1’.
7. Select Philips & P89c51RD2xx microcontroller and then click OK.
8. Then select NO on the pop-up given below.
9. Then make a New File.
10. Write or copy your code there & save it with extension .c or .asm depending on your coding
(xyz.asm).
11. Go to target & then source group, right click on there & click on the option “Add Files to the
Group’Source Group 1’ ”.
12. Select your asm or c file which you want to add.(xyz.asm) and then add.
13. Right click Target 1. Go to the option for target, click on output &tick on create hex file option and
then OK.
14. Now click on “Translate current file”, “Build Target” and “Rebuilt all target files”.
15. It will show you 0 errors & 0 warning on Output Window.

After performing all these steps the chip will be configured through ECE FLASH .

How to use ECE flash

1. A window will be popped-up


2. Set baud rate 9600 ,select working comport of PC to hardware and software communication
3. Now select hex file to burn in chip through browse option and open.
4. Click on flash option reset hardware microcontroller will appear .
5. Now press reset switch on hardware board and flash will burn with 5-6 Seconds.
6. Again press reset switch on hardware board to run your program or to see output.

General Procedures for PIC 16F877A microcontrollers

1. Double Click on the icon SOURCE BOOST IDE present on the desktop.
2. Then a window will be popped-up
3. Now go to settings and select target. A dialog box will appear, in this dialog box select our
controller named PIC16F877A, then click ok.
4. Now go to settings and select toolsuit. A dialog box will again appear, in this dialog box select
C2C-plus, and then click ok
5. Now go to settings and select options. A dialog box will again appear with a display name C2C-
plus compiler option, now select tools, now go to assembler option and choose
6. Now go to projects and select new, now specify the path where you want to save your project
and name, click ok.
7. A pop up box will appear you may select “empty or with empty source file” and click ok.
8. Now write your program . After you had written your program go to build and first select
compilers then assembler then build. Any error or warning will be displayed in the dialog box.

After performing all these steps the chip will be configured through PPPv3 .
How to use PPPv3
1. Now after you had successfully created your .Hex file you would use an PIC programmer
called “PPPv3”. Double Click on the icon present on the desktop.
2. Now go to options and select options then select version 2 and click ok.
3. After that go to options and select configure PIC microcontroller and do the
following displayed settings.
4. After that choose your hex file and select send to PIC microcontroller.
EXPERIMENT :- 9
AIM : ALP to generate 10 KHz square wave without interrupts .

Program:
ORG 0000H
MOV TMOD, #10H ; timer 1, mode 1 (16-bit)
AGAIN: MOV TL1, #0D2H ; TL1=D2, low byte
MOV TH1, #0FFH ; TH1=FF, high byte
SETB TR1 ; start the timer 1
BACK: JNB TF1, BACK ; stay until timer rolls over
CLR TR1 ; stop timer 1
CPL P2.3 ;comp. P2.3 to get hi, lo
CLR TF1 ; clear timer flag1
SJMP AGAIN ; reload timer since mode1
; is not auto-reload
END
LOGIC: For generation of square wave, we firstly configure timer 1 to operate in mode 1, then
load 16 – bit value FFD2H in TL &TH register, after which the timer must be started by SETB
instruction. As the timer is started ,it counts up until it reaches its time limit of FFFFH , when over
flows , it sets high a flag bit called timer Flag (TF).By monitoring timer Flag. Timer can be stopped by
using CLR TR1. Then output on port 2 is complemented to generate square wave. Then timer flag is
complemented to generate square wave .Then timer flag is cleared and loop is rotated to continue
generation of square wave.
EXPERIMENT :- 10

AIM : ALP to generate a square wave of 10 KHz frequency using


Interrupts.
Program:
ORG 0000H
LJMP MAIN ; by-pass interrupt vector table

;ISR for Timer 0 to generate square wave


ORG 000BH ; Timer 0 interrupt vector table
CPL P2.3 ; toggle P2.3 pin
MOV TL0,# 0D2H ; TL0=D2, low byte of timer
MOV TH0,# 0FFH ; TL0=FF, Hi byte
RETI ; return from ISR

The main program for initialization


ORG 0030H ; after vector table space
MAIN: MOV TMOD, # 01H ; Timer 0, mode 1
MOV TL0,#0D2H ; TL0=D2, low byte of timer
MOV TH0,#0FFH ; TH0=FF, High byte of timer
MOV IE, #82H ; IE= 10000010 (bin) enable Timer 0
SETB TR0 ; Start timer 0
HERE: SJMP HERE
END

LOGIC : For generation of 10 KHz square wave we firstly make our program execute at MAIN
which starts beyond INT vector space .MAIN initializes timer 0 and sets it for the mode1,timer
operation MAIN then enables timer 0 interrupted by initializing IE to 10000010 then it just it just
waits around letting the interrupt routine to do the work. Timer 0 is loaded with value FFD2 H to
generate square wave of 10khz.If the timer INT in IE register is enabled, whenever TF is raised. The
microcontroller is interrupted and jumps to interrupt vector table to service ISR .The 8051
microcontroller will check for the condition automatically and when condition is satisfied, will jump
to a subroutine, execute the code, then return.
In this case subroutine will complement the output at port 1.2, then RET1 instruction else 8051
microcontroller that interrupt routine has finished.

NOTE 1: When using ORG 0000H in the very first line then microcontroller upon wake up go to MAIN,
where ORG 0000H entry address for 8051 RESET.
NOTE 2: When using SJMP 000BH which is replaced by ORG 000BH, it is a start of ISR for timer 0 to
generate square wave.
NOTE 3: When using SJMP 0030BH which is replaced by ORG 0030BH, it is a start of main program for
initialization.

You might also like