Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
10 views2 pages

Assembly Language PYQs Solved All

The document outlines a program for a microcontroller that initializes Timer 0 and sets up an interrupt service routine (ISR) for handling timer interrupts. It includes assembly language instructions for configuring the timer, enabling interrupts, and toggling a port bit to create a square wave. The main program enters an infinite loop after setting up the timer and interrupts.

Uploaded by

jayitaroy117
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)
10 views2 pages

Assembly Language PYQs Solved All

The document outlines a program for a microcontroller that initializes Timer 0 and sets up an interrupt service routine (ISR) for handling timer interrupts. It includes assembly language instructions for configuring the timer, enabling interrupts, and toggling a port bit to create a square wave. The main program enters an infinite loop after setting up the timer and interrupts.

Uploaded by

jayitaroy117
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/ 2

rite

1
Solution

5 ORG ;reset ent ry point


O000
above interrupt vectors
0000 020030 LJMP MAIN :jump
vectOr
000B 7 ORG 000BH ;Timer 0 interrupt
000B B290 TOISR: CPL Pl.0
itoggle port bit
000D 32 9 RETI
0030 10 ORG O030H ;Main program entry point
O030 758902 11 TMOD,, #02H ;timer 0, mode 2
MAIN: MOV
0033 758CCE 12 MOV THO, #-50 ;50 us delay
0036 D28C 13 SETB TRO
;start t i mer
;enable timer 0 interrupt
0038 75A882 14 MOV IE,#82H
003B 80FE 15 SJMP $ ;do nothing
ORG 0 :stand alone
LAJMP MAIN operat.iorn
¡begin at. MAIN
ORG 000BH :Timer 0 lnterrupt entry
LJMP TOISR : (2) execute ISR
ORG 0030H : MA IN entry
MAIN: MOV TMOD, #0lH point
:Timer 0, 16-bit mode
SETB TFO ;force first interrupt
MOV IE, #82H ;enable Timer 0 interrpts
SJMP ; (2+2) now do nothing
TOISR: CPL Pl.7 i 1) Create square wave
CLR TRO ; (1) stop timer
MOV THO,#HIGH COUNT ; (2) initialize count
MOV TLO, #LOW COUNT : (2)
SETB TRO ; (1) start timer
RETI ; (2) return to main

You might also like