You are on page 1of 203

MICROPROCESSORS &MICROCONTROLLERS

LABMANUAL

SubjectCode : A60494

Regulations : R15–JNTUH

Class : IIIYearIISemester(ECE)
IVYearISemester(EEE)

Preparedby
Mr.N Papa Mrs.C.DeepthiA Mr.S.LakshmanaChari
RaoAssistantProfe ssistantProfessor AssistantProfessor
ssor

Mr.M.LakshmiRaviteja
AssistantProfessor
DepartmentofElectronics&CommunicationEngineering
INSTITUTEOFAERONAUTICALENGINEERING
(Autonomous)Dundiga
l–500043,Hyderabad
INSTITUTEOF AERONAUTICAL ENGINEERING
(Autonomous)
Dundigal-500043,Hyderabad
Electronics&CommunicationEngineering

Vision
ToproduceprofessionallycompetentElectronicsandCommunicationEngineerscapableof
effectivelyandefficientlyaddressingthetechnicalchallengeswithsocialresponsibility.

Mission
The mission of the Department is to provide an academic environment that will ensure
highqualityeducation, trainingandresearchbykeepingthestudentsabreastoflatestdevelopments
inthefieldofElectronicsandCommunicationEngineeringaimedatpromotingemployability,
leadershipqualitieswithhumanity, ethics, researchaptitudeandteamspirit.

QualityPolicy
Ourpolicyistonurtureandbuilddiligentanddedicatedcommunityofengineersprovidingaprofessionalandunprej
udicedenvironment,thusjustifyingthepurposeofteachingandsatisfyingthestakeholders.

Ateamofwellqualifiedandexperiencedprofessionalsensurequalityeducationwithitspracticalapplicationinallar
easof theInstitute.

Philosophy
The essence of learning lies in pursuing the truth that liberates one from the darkness of ignorance
andInstituteofAeronauticalEngineeringfirmlybelievesthateducationisforliberation.
Contained therein isthe notion thatengineeringeducation includesall fieldsof science thatplaysapivotal
rolein the developmentofworld-wide community contributing to the progressof civilization.This institute,
adhering to the above understanding, is committed to the development of science andtechnology in
congruence with the natural environs. It lays great emphasis on intensive research andeducation that
blends professional skills and high moral standards with a sense of individuality andhumanity. We thus
promote ties with local communities and encourage transnational interactions in orderto be socially
accountable. This accelerates the process of transfiguring the students into complete
humanbeingsmakingthelearningprocessrelevanttolife,instillinginthemasenseofcourtesyand

responsibility.
INSTITUTEOF AERONAUTICALENGINEERING
(Autonomous)
Dundigal, Hyderabad-500043

ELECTRONICSANDCOMMUNICATIONENGINEERING

ProgramOutcomes

PO1 Engineeringknowledge:Anabilitytoapplyknowledgeofbasicsciences,mathematicalskills,

engineeringandtechnologytosolvecomplexelectronicsandcommunicationengineeringproblems(Fun
damentalEngineeringAnalysisSkills).

PO2 Problemanalysis:Anabilitytoidentify,formulateandanalyzeengineeringproblemsusingknowledgeof
BasicMathematicsandEngineeringSciences.(EngineeringProblemSolving

Skills).

PO3 Design/developmentofsolutions:AnabilitytoprovidesolutionandtodesignElectronicsand

CommunicationSystemsaspersocialneeds(SocialAwareness)

PO4 Conductinvestigationsofcomplexproblems:Anabilitytoinvestigatetheproblemsin

ElectronicsandCommunicationfieldanddevelopsuitablesolutions (CreativeSkills).

PO5 ModerntoolusageAnabilitytouselatesthardwareandsoftwaretoolstosolvecomplex

engineeringproblems(SoftwareandHardwareInterface).

PO6 Theengineerandsociety:Anabilitytoapplyknowledgeofcontemporaryissueslikehealth,
Safetyandlegal whichinfluencesengineeringdesign(SocialAwareness).

PO7 EnvironmentandsustainabilityAnabilitytohaveawarenessonsocietyandenvironmentforsustainable
solutionstoElectronics&CommunicationEngineeringproblems(Socialawareness).

PO8 Ethics: An ability to demonstrate understanding of professional and ethical

responsibilities(Engineeringimpactassessmentskills).

PO9 Individualandteamwork:Anabilitytoworkefficientlyasanindividualandinmultidisciplinaryteams(
TeamWork).

PO10 Communication:Anabilitytocommunicateeffectivelyandefficientlyboth inverbaland


writtenform(CommunicationSkills).

PO11 Projectmanagementandfinance:Anabilitytodevelopconfidence
topursuehighereducationandforlife-longlearning(Continuingeducationawareness).
PO12 Life-longlearning:Anabilitytodesign,implementandmanagetheelectronicprojectsforreal
worldapplicationswithoptimumfinancialresources(Practicalengineeringanalysisskills).

ProgramSpecificOutcomes

PSO1 Professional Skills: An ability to understand the basic concepts in Electronics &
CommunicationEngineeringandtoapplythemtovariousareas,likeElectronics,Communications,Sign
alprocessing,VLSI,Embeddedsystemsetc.,inthedesignandimplementationofcomplex
systems.

PSO2 Problem-
solvingskills:AnabilitytosolvecomplexElectronicsandcommunicationEngineeringproblems,usingl
atesthardwareandsoftwaretools,alongwithanalyticalskillsto

arrivecosteffectiveandappropriatesolutions.

PSO3 Successful career and Entrepreneurship: Anunderstandingofsocial-


awareness&environmental-
wisdomalongwithethicalresponsibilitytohaveasuccessfulcareerandtosustain

passionandzealforreal-worldapplicationsusing optimalresourcesas anEntrepreneur.


ATTAINMENTOFPROGRAMOUTCOMES
&
PROGRAM SPECIFICOUTCOMES
Program
Program
SpecificO
Outcomes
S.No. Experiment utcomes
Attained
Attained

WriteanALPprogramusing8086&MASMandverifyfor :

Additionoftwo16-bitnumbersandmultibyteaddition PO1,PO2

1 Subtractionoftwo16bitnumbersand multibytesubtraction PSO1


Multiplicationoftwo16bitnumbers

Divisionoftwo16 bitnumbers

WriteanALPprogramusing8086 tosortthegiven numbers

2 programtosortthegivennumbers inascendingorder PO1,PO2 PSO1


programtosortthegivennumbersindescendingorder

WriteanALPprogramusing8086 &MASMprogramfor searchingfor anumber


PSO1,
orcharacterinastring
PSO2
3 PO1,PO2
a)Tosearchanumber or characterfromastring.

WriteanALPprogramusing8086 &MASMprogramfor stringmanipulations

Programfortransfer
blockofdatafromonememorylocationtoanothermemorylocation.

Programforreverseofagivenstring
4 PO1,PO2 PSO1
Programforinsert anewbyteinagivenstring

Programfordeleteabyteinagivenstring

WriteanALPprogramforcodeconversionsusing8086

Towriteaprogramforconversionofanalogdatato digitaloutput PO1, PSO1,


PO2,PO5 PSO2
5 Towriteaprogramfor conversionofdigitaldata toanalogoutput.theanalog
outputwillbeintheformoftriangularwave,sawtoothwave,
squarewave

WriteanALP programtointerfacesteppermotorwith8086androtatein PO1,


6 PSO1
clockwiseandaswellasanticlock wisedirection PO2,PO5
WriteanALPprogramusing8051andMASM&performarithmetic,logicaland
bitmanipulationinstructions
7 PO1,PO2 PSO1
Toperform8bitarithmetical operations byusing8051.

Logicaloperations

WriteanALPprogramusing8051andMASM&verifytimer/counterin8051
8 PO1,PO2 PSO1

PO1,
9 WriteanALPprogramusing8051andMASM &verifyinterrupthandling PSO1
PO2,PO5

WriteanALPprogramusing8051andMASM to performUART operation


PO1, PSO1,
Programformode-0-transmitter PO2,PO5 PSO2
10
Programformode-0-reciever:

PO1,PO2,
11 WriteanALPprogramtointerfaceLCDwith8051 PSO2
PO4,PO5

PO1,
12 WriteanALPprogramtointerfaceMATRIX/Keyboard with8051 PO2,PO5 PSO2
ATTAINMENTOFPROGRAMOUTCOMES
&
PROGRAM SPECIFICOUTCOMES
Program
Program
SpecificO
Outcomes
S.No. Experiment utcomes
Attained
Attained

ContentBeyondSyllabi

1 TowriteanassemblylanguageprogramtofindLCMofagivennumberusing8086
PO1,PO2 PSO1

2 Towriteanassemblylanguageprogramtofindsquareandcubeofanumberusing8086
PO1,PO2 PSO1

3 Towriteanalpforparallelcommunicationbetweentwomicroprocessorsbyusing8255 PSO1,
PO1,PO2
PSO2

4 To write an alp for serial communication between two microprocessors by PSO1,PS


using8255 PO1,PO2
O2

5 ToWriteanALPprogramtoInterfacean8051microcontrollertrainerkittopcandestabl PSO1,PS
ishacommunicationbetween themthroughRS232 PO1,PO5
O2
INSTITUTEOFAERONAUTICALENGINEERING
(Autonomous)

Dundigal- 500043, Hyderabad

MICROPROCESSORS&MICROCONTROLLERSLABORATORY

CourseOverview:

Thislabprovidesanin-
depthunderstandingoftheoperationofmicroprocessorsandmicrocontrollers,machinelanguageprogra
mming&interfacingtechniques.Thiscourseisdesignedtoimpartprofessional trainingtothe students
engineering,tointerface andbuildmicroprocessors and Microcontroller based applications
involving interfacing of 8255 with 8086and serial communication. The objective of this course is
to teach students design and interfacingofmicrocontroller-basedembeddedsystems

CourseOut Comes:

Designand analyzethetheassemblylevelprogramming
Identitytheassemblylevelprogrammingingivenproblem.
UnderstandtheapplicationsofMicroprocessorsandMicrocontrollers.
Choosetheappropriateprogramminglevelforaspecifiedapplication.
Understandthebasicprogrammingknowledgeonprocessorandcontroller
Understandanddevelopassemblylanguageprogrammingwithvariousapplications

Comparedifferentimplementationsanddesigningwithinterfacingcircuits
WritecomplexapplicationsusingAssemblylanguageprogrammingmethods.
INSTITUTEOFAERONAUTICALENGINEERING
(Autonomous)

Dundigal- 500043,Hyderabad

MICROPROCESSORS &
MICROCONTROLLERSLABSYLLABUS

S.No. Listof Experiments PageNo. Date Remarks

Studythearchitectureof8086&8051familiarizationwithitshardware 25
1 , commands & operation of microprocessor,

Programsfor 16bitarithmetic operationsfor 34


2 8086(usingVariousAddressingModes).

3 Programforsortinganarrayfor8086. 39

Programfor searchingfora number orcharacter 42


4 inastringfor8086

5 Programforstringmanipulations for8086 49

6 InterfacingADC andDACto8086 56

7 Interfacingto8086 andprogrammingtocontrolsteppermotor 60

Programmingusingarithmetic,logicalandbitmanipulation 67
8
instructionsof8051.

9 ProgramandverifyTimer/Counterin8051 71

10 ProgramandverifyInterrupthandlingin8051 76

11 UARTOperationin8051 80

12 InterfacingLCDto8051 91

13 Interfacing matrix/keyboardto8051 95

ContentBeyondSyllabi

1 Programto find LCMofa givennumberusing 8086 98


2 Arithmeticprogramstofindsquareandcubeusing8086 100

ProgramforParallelcommunicationbetweentwomi 103
3 croprocessorsusing8255

ProgramforSerialcommunicationbetweentwomicroprocessorsusin 107
4 g8255

5 Programforcommunicationbetween8051kitandPC

*Contentbeyondtheuniversityprescribedsyllabi
I. INTRODUCTION:

FeaturesoftheALS-SDA-868086MEL MicroprocessorTrainer

8086 CPUoperatingat5MHzMAXmode.

Provisionforon-board8087 coprocessor.

Provisionfor256KBofEPROM&256 KBofRAM onboard

Batterybackup facilityforRAM.

48 programmableI/O lines usingtwo8255‟s

Three16 bittimersusing8253A

PriorityInterruptController(PIC)foreightinputusing8259A

ComputercompatibleKeyboard.

Displayis16x 2lineLCD.

Designed&engineeredtointegrateuser‟sapplicationspecificinterface convenientlyataminimumcost.

Powerful&user-friendlykeyboard/
serialmonitor,supportindevelopmentofapplicationprograms.

Software support for development of programs on Computer, the RS-232C interface


cableconnecting to computer from the kit facilitates transferof files between the trainerkit
&computerfordevelopment&debuggingpurposes.

High quality reliable PCB with soldermask on both sides & clear legend prints
withmaximumdetailsprovidedfortheuser.

SPECIFICATIONS:

CPU: Intel 8086 operating at 5 MHz in MAX

mode.MEMORY:Total256KBofmemoryis

intheKitprovided.EPROM:

2JEDECcompatiblesocketsforEPROM

RAM:2JEDEC compatiblesocketsforRAM
PARALLELI/O:48 I/Olines usingtwo8255

SERIALI/O:OneRS-232CcompatibleinterfaceUsingUSART8251A

TIMER:Three16 bit counter/timers8253ACounter1 isusedforserialI/OBaudrategeneration.


PIC:ProgrammableInterruptcontrollerusing8253AprovidesinterruptsVectorsfor8jumpers‟selectableIntern
al/Externalsources.

KEYBOARD/ DISPLAY:

Keyboard: Computerkeyboardcanbehockedontothetrainer.

Display:LCD2x16display.

INTERRUPTS:

NIM:ProvisionforconnectingNMItoakeyswitch

INTR:ProgrammableInterruptcontrollerusing8259AprovidesInterruptvectorsfor8
jumpersselectableInternal/ExternalSources.
INTERFACEBUSSIGNALS:

CPU BUS: All address, data & control lines are TTL compatible & are terminated in berg strip

header.PARALLELI/O: AllsignalsareTTLcompatible&

TerminatedinbergstripheaderForPPIexpansion.SERIALI/O:SerialportsignalsareterminatedinStandard9-

pin„Dtypeconnector.

MONITORSOFTWARE:

128KBofserial/
KeyboardmonitorwithPowerfulcommandstoenterverifyandDebuguserprograms,includingonboardAssembleanddis
assemblecommands.
COMPUTERINTERFACE:

This can be interfaced to host computer System through the main serial port,
alsoFacilitatesuploading, downloadingofIntelHex filesbetweencomputerandthetrainer.

I/Odecoding:

ICU30isusedforoncardI/Odecoding.ThefollowingtablegivesthelistofoncardI/Odevicesandtheiraddressmap.

I/O device I/Oaddress I/Oregister usage

FFCO PORTA AVAILABLE


TOUSER
FFC2 PORTB

8255 I(U14) FFC4 PORTC

FFC6 CONTROLPORT

FFC1 PORTA AVAILABLE


TOUSER
8255 II(U15) FFC3 PORTB

FFC5 PORTC

FFC7 CONTROLPORT

FFC9 TIMER0 AVAILABLETO

USER

FFCB TIMER1 USEDFORBAUD

8253A(U28) RATE

FFCD TIMER2 AVAILABLETO

USER

FFCF CONTROL AVAILABLETO

USER

8251A(U13) FFD0 DATA


COMMANDPORT
FFD2
STATUS

INPUT PORT USEDASI/


TODIPSWITCH( PPORTTOREADS
SW1) W1

AND
CONFIGURE86ME

8259A(U12) FFD8TOFFDE PRIORITY

INTERRUPTC
ONTROLLER

POWERREQUIREMENTS:

+5VDCwith2.5 Amps currentrating(Max).

OPERATINGCONFIGURATION:

Twodifferentmodesofoperationtrainerarepossible.Theyare

Serialoperation

Keyboardoperation
ThefirstconfigurationrequiresacomputersystemwithanRS-232Cport,canbeusedasthecontrolling device.
When a computer system is interfaced to trainer, the driver program must be resident
inthecomputersystem.

The second mode of operation is achieved through Onboard KEYBOARD / DISPLAY. In


thismode, the trainer kit interacts with the user through a computer keyboard and 16x2 LCD Display.
Thisconfiguration eliminates the need for a computer and offers a convenient way for using the trainer
as astand–alonesystem.

EXECUTIONPROCEDUREFOR8086(forregisters):

Writingaalp
PROGRAMintoprocessor:SwitchOn
PowerSupply

Press
AA

SG
0(Zero)Pre
ssenter

DAstartingaddress
Pressenter

PressN

Then display shows @ here you have to write 1stMNEMONIC


OPERANDPressenter

N(displaydisplaysaddressop-codeMNEMONICOPERAND)N

Thendisplayshows @hereyouhaveto write2nd


MNEMONICOPERANDPressenter
Press
NPress
N

Thendisplayshows@up tolastMNEMONIC
OPERANDPressenter

N
N

!Pressenter
EXpressenter

ExecutionofPROGRAM(for registers):G
enterstartingaddress

Pressenter

Verifytheresult(forregisters):R

EthenitshowsAXregisterthenpress,symbolitshowsBXregisterthenpress,symbolitshowsCXregis
ter.

EXECUTIONPROCEDUREFOR8086(formemorylocations):

Writingaalp
PROGRAMintoprocessor:SwitchOn
PowerSupply

Press
AA

SG0

Pressenter

DAstartingaddress
Pressenter

Then display shows @ here you have to write 1stMNEMONIC


OPERANDPressenter

N(displaydisplaysaddressop-codeMNEMONICOPERAND)N

Thendisplayshows @hereyouhaveto write2nd


MNEMONICOPERANDPressenter

N
N

-
Thendisplayshows@up tolastMNEMONIC
OPERANDPressenter

N
N

! Press
enterEXpresse
nter
E(exambyte)

HereyouhavetotypeSIaddress,give1stdata,2nddata,---------------,nthdata,

Pressenter

ExecutionofPROGRAM(formemorylocations):G
enterstartingaddress

Pressenter

Verifytheresult (formemorylocations):E

Then give DI address press, then display shows the result of 1 st8 bit data For 2nd8
bitdataagainpress,------,nthdata

IntroductiontoMASM:

MASM:(Microsoftassembler)

RuncommandpromptandgotoMasmdirectory

i.e.C:\masm\

TypetheprogrambyopeninganeditorusingEditcommand

i.e.C:\masm\editfilename.asm

Aftertypingtheprogramassembletheprogramusingmasmcommand.

i.e.C:\masm\masmfilename.asm;

Afterassembling,linkthefileusinglinkcommand

i.e.C:\masm\linkfilename.obj;
Finallyusedebugcommandtoexecutetheprogram.

C:\masm\debugfilename.exe

-t;forsinglestepexecution

-g;foratatimeexecution

-I;forrestartingtheprogramexecution

-d;toseethedatasegment

-q;toquittheexecution

C:\masm\afdebugfilename.exe

F1;forsinglestepexecution
g;foratatimeexecution

Lfilename.exe; toreloadtheprogram

Quit;tocomeoutoftheexecutescreen

INTRODUCTIONOFALSSDA51-MEL:

The Intel‟s family of 8bit single chip microcontroller has become very popular because of
theirunique and powerful instruction set, architecture and over all philosophy. The 8051 family has
threemembers: 8031,8051 and 8751.the 8031 have no on-chip program memory execution is from
externalprogram memory. The 8051 has 4k bytes of factory masked ROM and has the 8751 has 4k bytes
ofEPROM.

The SDA 51-MEL is a System Design Aid for learning the operation of these
Microcontrollerdevices. It uses 8031/51 as the controller. It is designed to assist students and engineers in
learning aboutthearchitectureandprogrammingof 8031/51anddesigningaroundthisMicrocontroller.
The address and data bus controllers separate the 8051 microcontroller multiplexed
address/databus,creatinga16bitaddressbusand8bitdatabus.

The monitor program for the SDA 51-MEL is contained in 32kbytes EPROM. The monitor interacts
withthe user through a CRT terminal host computer system connected through serial I/O interface or
throughthePCKeyboard(AT) and16X2LCDdisplay.
SPECIFICTIONS

CPU:8051operatingat 11.0592MHZ

MEMORY:EPROM1-oneJEDECcompatible28pinsockettoprovideup to

32Kbytememoryusing27256withmonitorsoftware.

EPROM2-optional-canbeusedasprogrammemory,iframisconfiguredasdata
only.

RAM1-
oneJEDECcompatible28pinsockettoprovideupto32KbytesofDatame
moryusing62256.

RAM2-oneJEDECcompatible28
pinsockettoprovideupto32KbytesProgram/dataordata memory.

I/O PARALLEL:48I/Olines usingtwo8255,terminated intwo26 headers.

I/OSERAL:OneRS232compatibleinterface,using onechip UARTlines.Thelines

Areterminatedina9-pinD-typefemaleconnector.onchipUARTlinesarealsoterminatedina10pin

FRCconnector.

TIMER:Three16 bitcounter/timerusing8253programmabletimers
terminatedina20pinbergstick.

KEYBOARD:EXTERNALPC–ATkeyboard

DISPLAY:AlphanumericLCDmodule(2linex 16CHARS)

BUSSIGNALS:Alladdress dataandcontrolsignalsareterminatedina50
pinheaderConnector for user expansion. Controller specific lines like port lines T0,T1,
INT1 etcareterminatedinthisconnector.

MONITORSOFTWARE:32Kbytesofuserofuserfriendlymonitorsoftware

(27256)thatallowsProgramenter,verification,debuggingandexecutionfromthesystemkeyboardora
CRT
TerminaloraPCfunctioningasaterminal.Fileuploading/downloadingoptionisinserialmode

THE EXTERNAL PC: AT keyboard allows users to directly assemble


/disassemblemnemonics/instructionsfor8051usingthealphanumericLCDdisplay

OPERATINGCONFIGURATION

TwodifferentmodesofOperationSDA-51MELarepossible.Theyare

serialoperation

This configurationrequires anRS232compatibleterminalas thedisplayandcommandentry device.


DISPLAY RS232CCABLE
SDA-51-MEL
TERMINAL
A computer system is interfaced to SDA51-MEL, a driver program must be resident in the
computersystem.Driverprogram (b30drv forDOS,TALK setup forwindows) forinterfacing SDA-51 MEL
to aPChasbeendevelopedbyALSandisavailabletothe userasanoptionalaccessory.

KeyboardOperation

This mode of operation is achieved through on board KEYBOARD/DISPLAY. In this mode,SDA-


51MEL interacts with the user through an PC/AT Keyboard and a 16x2 alphanumeric LCD display.
Thiseliminates the need fora terminal / host computerand offers a convenient way forusing the SDA-
51MEL asa “STAND–ALONE” system.

SERIAL MODE:

SERIALCOMMUNICATIONANDSERIALUTILITIESO

PERATINGINSTRUCTIONS

To invoke this mode press < RES> and then the < ESLR> key on the KEYBOARD to
transfercontrolto the CRT terminal/HOST computer the prompt “SERIAL MODE” will be appearson
LCDDISPLAY > ALS 8051/31 MONITER V1.0 is displayed on the terminal to indicate that the
systeminterrogation mode and ready to accept the command. All command that be entered through
interrogationmodes.

SYSTEMMONITER

The SDA-51-MEL operation is controlled by monitor program stored in 32kbytes of


EPROM(U5,27256),located atSDA-51MELmemorymap(0000-7FFF).The system executesthe
monitorprogramwheneverpoweristurnON or whenRESETispressed.

Inserial mode,themonitorprogramallows theusertoperformfollowing operations,

CommunicatewiththeSDA-51-MELthroughtheCRTterminal/
HOSTcomputer,usingtheonboardserialI/Ointerface.

Executesuserprogrammersinrealtimeorsinglestep.
SETbreakpointsonprogram,

Examineandmodifymemorylocations,registersandbitsinSDA-51-MELonboardprogram/
datamemoryandinthe8051‟s onchipdataandregistermemories.

UploadanddownloadprogrammersfromhostcomputersystemlikePC/XT/
AT(inINTELHEXFORMATonly)
COMMANDS
AVAILABLEHELP

Syntax:H

Gives thedetails ofthecommands


usedinserialmodeofcommunication.DISPLAY COMMAND

Thecommandisusedtodisplaythecontentsofregister,bitmemory,internalmemory,programmemoryandextern
aldata memory

Syntax:D

Onenteringthiscommandat themonitorcommandprompt,thefollowingoptionsaredisplayed.

DISPLAY(R, B, M,P, D)

The options
are,RforRegister
s,Bforbitmemory

MforInternalmemoryP
for program
memoryDfordatamem
ory

Press„enter‟toterminatethecommand.

EDITCOMMANDS

Thiscommandisusedtoeditthecontentsofregister,bitmemory,internalmemory,programmemoryandthe
externaldatamemory.

Syntax:E

Onenteringthecommandletteratthemonitorcommandthefollowingoptions aredisplayed.

EDIT(R,B,M,PandD).

Theoptionsare,
Rforregisters

Pforprogrammemory

Bforbitmemory

Mforinternal memory
Dfordatamemory

During editing,thefollowingkeys canbeused.

P to display the previous location N or space bar to display the next location CR to update and display
thesamelocation.

Allotherkeysexpect0 to9andAtoFcanbeusedtoabortthecommand.
PROGRAMEXECUTIONCOMMANDS:

The following commands are used to control the execution of user programs. The B and
Ccommands set and clear breakpoint address. The GO and Step commands cause the system to
enterexecutionmodefrominterrogationmode.

Gcommand:

The G command initiates program execution at real time (12MHZ crystal, 1micro-second
cycle).The real-time execution mode allows the user to run the user code stored in program memory.
Executionbegins when the user enters a go command in interrogation mode. Real-time execution can be
controlledbybreakpointssetbytheuser.Ifprogramhaltsafterexecutingtheinstructionthatcontainedthebreakpoi
nts address, then it returns to the interrogation mode .if the breakpoints are not used, the
programrunsuntiltheuserterminatesexecutionwithacalltotheaddress0003H.

Thedifferentformantsofthiscommandandtheirfunctionsaredescribed
below.8051>G

Enterstartaddress:8000

This command begins real time execution of the user program beginning with the
instructioncurrentlyaddressedbytheprogramcounter.Duringprogramexecution,thefollowingmessageisdispl
ayedonthescreen:

PROGRAMEXECUTION:

Executioncontinuesuntiloneofthefollowingoccurs:

Abreakpointisencountered(applies onlywhenbreakpointsareenabled)

The program attempts to execute across location 0003H.this location is reserved for system
operation.Afterexecutionifbreakpointwerenotspecified,thenalltheregistercontentswillbedisplayedandthemo
nitorcomesbacktointerrogationmodewiththeprompt„8051>‟meaningthattheitisreadytoaacceptthe
nextcommand
Note:

Thesystemusesthecurrentprogramcounteraddressasthestartaddress.

Itprogrambreakpointordatabreakpointhavebeenenabledthentheprogramwillbeexecutedthecommandiste
rminatedwithoutexecutionof theprogram.
SINGLESTELCOMMAND:

This commandexecutesoneinstructionattheaddressintheprogramcounter8051>S

8051>enterstaraddress=8000<CR>

Aftereachinstruction,thesystemdisplaysthevaluesoftheupdatedprogramcounter,accumulator, data,
pointer register, and stack pointer. To terminate this command press ESC or
SPACEBAR.Theactualformat&theoutputofeachoftheinstructionisgiveninthesectionserialcommunicationd
emo

BREAKCOMMAND

SETBREAKCOMMAND:

SYNTAX8051<B>

Set breakpoint: up to eight breaks can be set in the user program. After giving the command „B‟ at
theprompted with the break number, enter the break no between 1 to 8.press <CR> after the break no.
Andenter the break address and press <CR>to go to conform the address and press another<CR>to go to
thenextbreakaddressselectionor<SP><SP>toterminatethecommand.

CLEARBREAKPOINTS

SYNTAX:>C

This command prompts the user for the break no, which has to be cleared. To clear all break points,
enterthebreaknumberhastobecleared.

FILE UPLOADFROMSDA-MELTOPC

This option allows the user to save any program in memory as file inIntel hex format. Onentering
the command „F10‟ and select option 4 on following this, the driver program prompts for
thenameofthefileinwhichthedataistobestoredandentertheSTART&ENDaddressandpress,<CR>.the
program assumes a default extension of HEX for the file. This system then receives
thedataandstoresitinthespecifiedfileandoncompletionthemainmenuwillbe displayed.
Ex:F10

Selectoption4

Enterthefilenameinwhichthedataistobestored.EnterSTA
RTaddress=8000<CR>

ENTERENDaddress=805F<CR>
FILE DOWNLOADFROMPCTOSDA-EL-MEL

This option allows the user to transfer an Intel hex file on a floppy diskette to
program/datamemory.Onprocessing„:‟key,thefollowingmessageisdisplayed.

Gotothemainmenu bypressingF10andselectoption3

On following this, the driver program prompts for the name of the file to be downloading. Enter the
filename and press <CR>. While the transfer operation in progress, the system displays the number record
betransferred.

At the end of the transfer the main menu is displayed. Go to terminal mode press <CR>, the
followingmessage

FilereceivedO.K.willbedisplayedEx
:‟:‟

GotothemainmenubypressingF10andselectoption3

KEYBOARD MODEOFOPERATION

At the power on the monitor automatically goes into keyboard mode, at power on the sign
onmessageSDA51/31/-STA<E>HELPappearsontheLCDdisplay.

THEFUNCTIONOFSOMESPECIALKEYSONTHEPC/ATKEYBOARDARELISTEDBELOW

KEYL
DESCRIPTION
ABEL

RESET Transferscontroltothemonitoratlocation0000H

NXT Themonitorinterruptsthiskeyas adelimiter.Differentcommandsare


explainedlater.

ENTER Themonitorcommandterminator

BMOVE Selectsthemonitorblock movecommand

GO Selectsthemonitorgocommand(programexecution)

PREV Amonitordelimiter key,andinthenextcomingsectionitsusage‟sare

explained

STEP Selectsthemonitorsinglestepfunction
EREG Selectsthemonitorexamine/modifycpuregisterfunction

EDM Incombinationwithsubstitutememorycommandthiskeyallowstheusingto

examineand modifyexternaldatamemory

IDM Incombinationwithsubstitutememorycommandthiskeyallowstheusingto

examineandmodifyinternaldatamemory

IBM Incombinationwithsubstitutememorycommandthiskeyallowstheusingto
examineandmodifyinternalbitmemory

EPM Incombinationwithsubstitutememorycommandthiskeyallowstheusingto

examineexternalprogrammemory
EPGM UsedtoprogramEPROM‟susingEPROMprogrammerI/F(NIFC03)

EPRD Used toreadtheEPROmcontentsusingEPROMprogrammerI/F(NIFC03)

ESRL Keytoinvokeserialmode

ASM Keytoinvokeassemblermode

DSM Keytoinvokediassemblermode

BS Providesbackfacilityinassemblermode
SUBSTITUTEMEMORYCOMMAND

Thiscommandisusedtoexamine/modifythememoryfunctions.Thiscommandwillssupportexamine/modificationof
followingmemories.

Externaldatamemory(EDM)

Externalprogrammemory(EPM)

internaldata memory(IDM)

internalbitmemory(IBM)

This command isinvoked using „SMEM‟ key in the ASCII key board the message
“SUBSITUTEMEMORY”appearsonthe display.

Then user can select any one of above mention four memories, and enter the location address to
beExamine/modify and press <NXT> to display the data present in that memory location, now user
canmodify that data byte if required then again he has to press <NXT>, now PC is incremented to show
thecontents of the next memory location. If the user wants to see the content of previous location i.e.
if9005HisthecurrentPCcontent&hewantstoseethe9004locationcontentthenhehastopress<PREV>key.

EXTERNALDATAMEMORY

<SMEM><EDM><address of memory location><NXT><new byte if


required><NXT>…..<ENTER>.Thiscommandisusedtoenterthedataindatamemory(0300Hto1FFFH,4000H
to7FFFH) ordata/codeintodata/programmemory(8000HtoFFFFH).

INTERNALDATAMEMORY

<SMEM><IDM><Address of the memory location><NXT><new byte


..................................ifrequired><NXT>… <ENTER>

Internal datamemoryranges from00Hto7FH(128bytes)

INTERNALBITMEMORY
<SMEM><IBM><Address of the memory location><NXT><new byte ifrequired><NXT>…
<ENTER>

Internalbit memoryrangesfrom00to7F(128bits)valuesenteredmust be1or0 only.

EXTERNALPROGRAMMEMORY

<SMEM><EPM><Addressofthememorylocation><NXT<NXT>…<ENTER>

Iftheuserattemptstoeditdatainthis regionanERRORmessagewillbedisplayed.
EXAMINE/MODIFYCPUREGISTERSCOMMAND

The examine/modify register command allows the user to examine/modify the contents of
CPUregisters.Thiscommand isinvokedusing EREGkeyin theASCIIkeyboard,themessage
“whichregister?”appears on the first line of LCD display then the user can select theCPU register which
hewants to examine/modify through akey designator (for the key designators see the table given
below)then if <NXT> pressed the register name in the registers sequence and its content will be
displayed, theregisters displaysequenceifA,B,R0,R1,R2,R3,R4,R5,R6,R7,PCL,PCH,PSW,SP,DPH,DPL.
DESIGNATOR(KEY) CPUREGISTERS DESIGNATIOR(KEY) CPUREGSITERS

0 RO 8 PCL

1 R1 9 PCH

2 R2 A A

3 R3 B B

4 R4 C SP

5 R5 D DPH

6 R6 E DPL

7 R7 F PSW

EXECUTEUSERPROGRAMCOMMAND

Theexecuteuserprogramcommandallowsusertoexecuteaprogramthathehasentered/downloaded. To
invoke this execute user program command press <GO> now the current PC
anditsdataaredisplayedontheLCDdisplayandthenthecommandiscompletedwhentheuserpress<ENTER>the
message“PROGRAMEXECUTED” willbedisplayedontheLCDdisplay.

SYNTAX:Go<Programstartingaddress><ENTER>

EX:Toexecuteaprogramwhichishavingthestartingaddressat8000H<GO>8000<ENTER>

SINGLESTEPCOMMAND
Thesinglestepcommandallowstheuserto„instructionstep‟throughhisprogram, thiscommandis
invoked through <STEP> key when the user press<STEP> the current PC content and data of thatlocation
are displayed on the LCD module. The user can now change the address, if required and thenpress
<ENTER >,the instruction at that address isexecutedand its contents are displayed,now bypressing
<NXT>key the display updates to next logical address and its contents. To examine register ormemory
contents at this stages press<ENTER>then <EREG>/<SMEM> orany command provided touser in
keyboard mode and again to enter single step press <ENTER>and to continue the stepping
processpress<NXT><NXT>….

Inthissinglestepmode,weuseINT0with itsprioritybitset.Asuch theother interruptsarenotfunctional.

SYNTAX:
<STEP><Startingaddressofuserprogram><ENTER><NXT><NXT>…..
EX:Tosinglestepaprogramwithstartingaddress9000H,andinthethirdstepexamregistercommandhastobeinvokedtoseeth
econtentofregisters A,B,R0,thenagaincomebackforsinglestepping.

<STEP>8000<ENTER><NXT><NXT><NXT><ENTER>

<EREG><A><NXT><NXT><NXT><ENTER><STEP><ENTER><NXT>

<NXT>………….

TALKsoftwareProcedure:

FirstidentifyLocation ofTALKsoftware.Ifitisin
DdrivethenchooserunpromptandselectCMDthenfollowbelowprocedure.

D:\
>ENTE
R

D:\>cdcomm_pack86

ENTER

D:\
cdcomm_pack86>cdcomm_pack86Ente
r

D:\
cdcomm_pack86>cdcomm_pack86>cdx8086Enter

D:\cdcomm_pack86
>cdcomm_pack86>cdx8086>editfilenameEnter

Entertheprogram

Gotofileandsave&gotofile
exitPressx8086

Enter

Listing
destination :dEnter

Generatecrossreference(Y/
N):yEnter
Inputfilename:GIVEINPUTFILENAME.ASMEn
ter

Outputfilename:

Enter

Linkassembled: Assembled
Errors:Enter

Inputfilename:GIVEfilename.objE
nter

Enteroffsetfor„cseg‟:0(Zero)E
nter
Input filename:

Enter

Output file
name :Options<D,S,A,M,X,H,E,T,1,2,3,<CR>=Default>:h

Enter
Exit
Enter

Next selected go to
talkGoingtooptions
insettingsComport-com1

Bit per seconds -


9600Databit-8

Parity –
noneStop
bit-1

Flow control-
noneTransfer mode-
ASCII
keyNEXTPRESSOK

Selectedoptionsinthat selectedtarget
board8086kitPressok

1stselectedinm.pkit askeep1and5pinsON

Thengotooptions
disconnectedandconnected,pressresetbuttoninkitDisplay–als-86monitor

GofileselecteddownloadIntelhex.File<comm._pack86>,<openx8086>,<filename>openEnter

Display#

Nextselectedinkit1&7pinskeepsONandpressreset
buttoninkitSelectedinG
Givetheaddressandpressenter
EXPERIMENTNo1
16BITARITHMETICOPERATIONSFOR8086(U
SINGVARIOUSADDRESSINGMODES)

AIM: -

TowriteanassemblylanguagePROGRAMforAdditionoftwo16-bitnumbers.

COMPONENTS&EQUIPMENTREQUIRED:-

Quantity
S.No Device Range/Rating
(inNo’s)

1 8086microprocessorkit/ 1
MASMwithPC

2 Keyboard 1

3 RPS +5v 1

PROGRAM:

Software

Assume cs:
codeCodesegme
nt

Start:

Code endsEndstart
Hardware

MOV AX,
4343HMOVBX,1111HADDAX,BXINT03
H

MEMORY LOCATION OP-CODE LABEL MNEMONICOPERAND

MOV
AX,4343MOV
BX,1111ADD
AX,BXINT3

ObservationTable

Input Output

Register Data Register Data

AX 4343 AX 5454

BX 1111
MULTIBYTEADDITION

AIM: -

Programtoperformmulti byteaddition

COMPONENTS &EQUIPMENT REQUIRED:-

Quantity
S.No Device Range/Rating
(inNo’s)

1 8086microprocessorkit/ 1
MASMwithPC

2 Keyboard 1

3 RPS +5v 1

PROGRAM:

Software

Assume cs:
codeCodesegme
nt

Start: MOV
AX,0000HMOV
SI,2000HMOV
DI,3000HMOV
BX,2008HMOV
CL,04H

UP: MOV AL,


[SI]ADD AL,
[BX]MOV
[DI],ALINCSI
INC
BXINC
DIDEC
CLJNZ
UPINT0
3H

CodeendsEn
dstart
Hardware:

MEMORY LOCATION OP-CODE LABEL MNEMONICOPERAND

MOV
AX,0000MOV
SI,2000

MOVDI,3000

MOVBX,2008

MOVCL,04M
OV AL,
UP [SI]ADDAL,
[BX]MOV
[DI], ALINCSI

INC
BXINC
DIDEC
CLJNZ
UP

INT3

ObservationTable:

Input Output

MEMORY MEMORY MEMORY


LOCATION LOCATION LOCATION
Data Data Data
2000 2008 3000

2001 2009 3001

2002 200A 3002

2003 200B 3003

2004

2005

2006

2007
SUBTRACTION:

16 bitsubtraction

AIM: -

TowriteanassemblylanguagePROGRAMforsubtraction oftwo16-bitnumbers.

COMPONENTS&EQUIPMENT REQUIRED:-

Quantity
S.No Device Range/Rating
(inNo’s)

1 8086microprocessorkit/MASM 1

withPC

2 Keyboard 1

3 RPS +5v 1

PROGRAM:

Software

Assume cs:
codeCodesegme
nt

Start: MOV AX,


4343HMOVBX,1
111HSUBAX,BX
INT03H

Code
endsEndst
art
Hardware

MEMORY OP-CODE LABEL MNEMONICOPERAND

LOCATION

MOV
AX,4343MOV
BX,1111SUB
AX,BX

INT03

ObservationTable

Input Output

Register Data Register Data

AX 4343 AX 3232

BX 1111
MULTIBYTESUBTRACTION

AIM:-PROGRAMtoperformmultibytesubtraction.

COMPONENTS &EQUIPMENTREQUIRED:-

S.No Device Range/Rating Quantity(inNo’s)

1 8086microprocessorkit/MASM 1
withPC

2 Keyboard 1

3 RPS +5v 1

PROGRAM:

SoftwareAssume cs:
codeCodesegme
nt

Start: MOV
AX,0000HMOV
SI,2000HMOV
DI,3000HMOV
BX,2008HMOV
CL,04H

UP: MOV AL,


[SI]SUB AL,
[BX]MOV
[DI],ALINCS
I

INC
BXINC
DIDEC
CLJNZ
UPINT0
3H

CodeendsEnd
start
Hardware
MEMORY OP-CODE LABEL MNEMONICOPERAND

LOCATION

MOV
AX,0000MOV
SI, 2000

MOVDI,3000

MOVBX,2008

MOVCL,04M
OV AL,
UP [SI]SUB AL,
[BX]MOV[DI]
,ALINCSI

INC
BXINC
DIDEC
CLJNZ
UP

INT03
ObservationTable:

Input Output

MEMORYL Data MEMORYL Data MEMORYL Data


OCATION OCATION OCATION

2000 2008 3000

2001 2009 3001

2002 200A 3002

2003 200B 3003

2004

2005

2006

2007

MULTIPLICATION

16bitmultiplication

AIM: -

TowriteanassemblylanguagePROGRAMformultiplicationoftwo16-bitnumbers.

COMPONENTS &EQUIPMENTREQUIRED:-

Quantity
S.No Device Range/Rating
(inNo’s)

1 8086microprocessorkit/ 1
MASMwithPC
2 Keyboard 1

3 RPS +5v 1

PROGRAM:

SoftwareAssume cs:
codeCodesegme
nt

Start: MOV AX,


4343HMOV BX,
1111HMULBX

INT03H

Code
endsEndst
art
Hardware

MEMORY OP-CODE LABEL MNEMONICOPERAND

LOCATION

MOV
AX,4343MOV
BX,1111MUL
BX

INT3

ObservationTable

Input Output

Register Data Register Data

AX 4343 AX EA73

BX 1111 DX 047B

16bitmultiplication(signed numbers)

AIM: -

TowriteanassemblylanguagePROGRAMformultiplicationoftwo16-bitsigned numbers.

COMPONENTS &EQUIPMENTREQUIRED:-

Quantity
S.No Device Range/Rating
(inNo’s)

1 8086microprocessor kit/MASM 1

withPC

2 Keyboard 1

3 RPS +5v 1
PROGRAM

Software

Assume cs:
codeCodesegme
nt

Start: MOV
SI,2000HMOV
DI,3000HMOV
AX,[SI]ADD
SI,02HMOV
BX,
[SI]IMULBXM
OV
[DI],AXADD
DI,02HMOV
[DI],DXINT03
H

Code
endsEndst
art
Hardware

MEMORY
OP-CODE LABEL MNEMONICOPERAND
LOCATION

MOV
SI,2000MOV
DI,3000MOV
AX,[SI]ADD
SI,02MOV
BX,
[SI]IMULBX
MOV[DI],AX
ADD DI,02

MOV
[DI],DXINT3

ObservationTable

Input Output

MEMORY LOCATION Data MEMORYL Data


OCATION

2000 3000

2001 3001

2002 3002

2003 3003

DIVISION

16bitdivision

AIM:-

TowriteanassemblylanguagePROGRAMformultiplicationoftwo16-bitnumbers.

COMPONENTS &EQUIPMENTREQUIRED:-
Quantity
S.No Device Range/Rating
(inNo’s)

1 8086microprocessorkit/MASM 1
withPC

2 Keyboard 1

3 RPS +5v 1

PROGRAM

Software

Assume cs:
codeCodesegme
nt

Start: MOVAX,4343H

MOV BX,
1111HDIVBX

INT03H

Code
endsEndst
art
Hardware

MEMORY OP-CODE LABEL MNEMONICOPERAND

LOCATION

MOV
AX,4343MOV
BX,1111DIVB
X

INT3

ObservationTable

Input Output

Register Data Register Data

AX 4343 AX 0003

BX 1111 DX 03F2

RESULT:

PRELABQUESTIONS:

Howmanybit8086microprocessoris?

Whatis thesizeofdatabusof 8086?

What is thesizeofaddressbusof8086?

Whatisthemax memoryaddressingcapacityof8086?

Whicharethebasic partsof 8086?

LABASSIGNMENT:

Writeanalpprogramforadditionandsubtractionoftwo16bitnumbers?
1)A278

2)B634

Writeanalpprogramformultiplicationanddivisionoftwo16bitnumbers?

1)0012

2)0006

POSTLABQUESTIONS:

Howto movedatafromoneregistertoother

Toswappingthedatawhattyperegisterused

What aretheadvantages ofmaximummode


EXPERIMENTNo2

ASCENDINGORDER

AIM:-

Programtosortthegivennumbersinascendingorder

COMPONENTS &EQUIPMENTREQUIRED:-

Quantity
S.No Device Range/Rating
(inNo’s)

1 8086microprocessorkit/MASM 1

withPC

2 Keyboard 1

3 RPS +5v 1

PROGRAM:

Software

ASSUME CS:
CODECODESEGME
NT

START: MOV
AX,0000HMOV
CH,0004HDECC
H

UP1 : MOV CL,


CHMOVSI,200
0H

UP: MOV AL,


[SI]INCSI
CMP AL,
[SI]JCDOWN
XCHG AL,
[SI]DECSI

MOV[SI],ALI
NCSI

DOWN: DEC
CLJNZ UP

DEC
CHJNZ
UP1INT
3

CODEENDSE
ND START
Hardware

MEMORY OP-CODE LABEL MNEMONICOPERAND

LOCATION
MOVAX,0000

MOVCH,0004

UP1: DECCH
MOVCL,CH

UP: MOVSI,2000
MOVAL,[SI]

INCSI

CMPAL,[SI]

JCDOWN

XCHGAL,[SI]

DECSI

MOV[SI],AL

INCSI

DOWN: DECCL
JNZUP

DECCH

JNZUP1

INT03

ObservationTable:

Input Output

MEMORY LOCATION Data MEMORYL Data


OCATION

2000 2000

2001 2001

2002 2002

2003 2003
2.2DESCENDINGORDER

AIM:-

Programtosortthegivennumbersin descendingorder

COMPONENTS&EQUIPMENTREQUIRED:-

Quantity
S.No Device Range/Rating
(inNo’s)

2 8086microprocessorkit/MASM 1

withPC

Keyboard 1

3 RPS +5v 1

PROGRAM:

Software

ASSUME CS:
CODECODESEGM
ENT

START: MOV
AX,0000HMOV
CH,0004HDEC
CH

UP1: MOV CL,


CHMOVSI,200
0H

UP: MOV AL,


[SI]INCSI
CMP AL,
[SI]JNCDOW
NXCHGAL,
[SI]DECSI

MOV
[SI],ALINCSI

DOWN: DEC
CLJNZ UP

DECCH
JNZUP1

I NT 3

CODEENDSE
ND START
Hardware

MEMORY LOCATION OP-CODE LABEL MNEMONICOPERAND

MOVAX, 0000

MOV CH,0004

UP1: DECCH

MOVCL,CH

UP: MOV SI,2000

MOV AL,[SI]

INCSI

CMPAL,[SI]

JNC DOWN

XCHGAL,[SI]

DECSI

MOV[SI],AL

INCSI

DOWN: DECCL

JNZUP

DECCH

JNZUP1

INT3

ObservationTable

Input Output

MEMORY LOCATION Data MEMORY LOCATION Data

2000 2000
2001 2001

2002 2002

2003 2003

RESULT:

PRE LABQUESTIONS:

Whatarethefunctions ofBIU?

Whatarethefunctions ofEU?

HowmanypinIC8086is?

WhatIC8086is?

Whatisthesizeofinstructionqueuein8086?
LABASSIGNMENT:

Writeanalpprogramtosortthegivennumbersinascendingorder?

1)14
2)A2
3)85
4)54
Writeanalpprogramfortosortthegivennumber indescendingorder?
1E
2A
3)56
4)98

POSTLABQUESTIONS:

Howclocksignalisgeneratedin8086

Whatis themaximuminternalclockfrequencyof8086?

WhatistheneedforPort
EXPERIMENTNo3
PROGRAMFORSEARCHINGFORANUMBERORCHARACTERINAST
RINGFOR8086

AIM:-

ToWriteanALPprogramtosearchanumberorcharacterfromastring.

COMPONENTS &EQUIPMENTREQUIRED:-

Quantity
S.No Device Range/Rating
(inNo’s)

2 8086microprocessorkit/MASM 1
withPC

Keyboard 1

3 RPS +5v 1

Software

ASSUME CS: CODE, DS:


DATACODESEGMENT

START:MOVCX,0004H

MOV
AX,0000HMOV
SI,2000HMOVB
X,3000H

UP: MOVAL,[SI]

CMP AL,
[BX]JZDOW
NINCSI
DEC
CLJNZ
UP

MOV
AH,00HJMPL
3

DOWN:

DECCLMOV
AH,01H

MOV[DI],AH

L3: INT
3HCODEENDS

ENDSTART
Hardware

MEMORY OP-CODE LABEL MNEMONICOPERAND


LOCATION
MOVCX,0004

MOVAX,0000

MOVSI,2000

MOVBX,3000

UP: MOVAL,[SI]
CMPAL,[BX]

JZ DOWN

INCSI

DECCL

JNZUP

MOVAH,00

JMPL3

DOWN: DECCL
MOVAH,01

MOV[DI],AH

L3: INT03

OBSERVATIONTABLE:
Input Output

MEMORY LOCATION Data MEMORY LOCATION Data

2000 3000

2001
2002

2003

RESULT:

PRELABQUESTIONS:

What isthesizeofinstructionqueuein8086?

Whicharetheregisterspresent in8086?

Whatdoyoumeanbypipeliningin8086?

Howmany16 bitregistersareavailablein8086?

Specifyaddressingmodesforanyinstruction?
LABASSIGNMENT:

Writeanalpprogramtosearchanumber05fromagivenarray?

1) 02

2) 06

3) 05

4) 08

Writeanalpprogramtosearchanumber45fromagivenarray?

1) 09

2) 45

3) 22

4) A2

POSTLABQUESTIONS:

Whycrystalisapreferredclocksource

What isTri-statelogic?

What happens whenHLTinstructionisexecutedinprocessor?


EXPERIMENTNo4

PROGRAMFORSTRINGMANIPULATIONSFOR8086

AIM:-

Towriteaalpfortransferblockofdatafromonememorylocationtoanothermemorylocation.

COMPONENTS &EQUIPMENT REQUIRED:-

Quantity
S.No Device Range/Rating
(inNo’s)

2 8086microprocessorkit/MASM 1

withPC

Keyboard 1

3 RPS +5v 1

PROGRAM:

Software

ASSUME CS:
CODECODESEGME
NT

START:

MOVSI,2000HM
OVDI,2008HMO
V CX,
0008HREP
MOVSBINT03H
CODE
ENDSENDS
TART

Hardware

MEMORY LOCATION OP-CODE LABEL MNEMONICOPERAND

MOV
SI,2000MOV
DI,2008MOV
CX,0008REP

MOVSB
INT3
ObservationTable

Input Output

MEMORY Data MEMORY LOCATION Data


LOCATION

2000 2008

2001 2009

2002 200A

2003 200B

2004 200C

2005 200D

2006 200E

2007 200F

REVERSEOFA DATA

AIM:-

TowriteaALPforreverse ofagivenstring

COMPONENTS&EQUIPMENT REQUIRED: -

Quantity
S.No Device Range/Rating
(inNo’s)

2 8086microprocessorkit/MASM 1
withPC

Keyboard 1

3 RPS +5v 1

1
PROGRAM:

Software

ASSUME CS:
CODECODESEGME
NT

START:

MOVSI,2000HM
OVDI,2008HMO
V CX,
0008HADD
SI,07H

UP: MOV AL,


[SI]MOV[DI],
ALDECSI

INCDID
EC
CXJNZ
UPINT0
3H

CODE
ENDSENDS
TART
Hardware

MEMORY
OP-CODE LABEL MNEMONICOPERAND
LOCATION

MOV
SI,2000MOV
DI,2008MOV
CX,0008ADD
SI,07MOV AL,
[SI]MOV
UP:
[DI],ALDECSI

INCDID
ECCX

JNZ
UPINT
3

ObservationTable

Input Output

MEMORY LOCATION Data MEMORY LOCATION Data

2000 2008

2001 2009

2002 200A

2003 200B

2004 200C

2005 200D

2006 200E

2007 200F

INSERTABYTEINAGIVENSTRING
AIM:-

TowriteaALPforinsertanewbyteinagivenstring

COMPONENTS&EQUIPMENTREQUIRED:-

Quantity
S.No Device Range/Rating
(inNo’s)

8086microprocessorkit/MASM 1
1
withPC

2 Keyboard 1

RPS +5v 1
3
1
PROGRAM:

Software

ASSUME CS:
CODECODESEGME
NT

START: MOV
SI,2000HMOV
DI,3000HMOV
BX,5000HMOV
CX,0005HCLD

L1: MOV AL,


[SI]CMP AL,
[BX]JZL2MO
VSBLOOPL1
JMPL3

L2: MOVSB

MOV
BX,7000HMOV
AL,[BX]MOV
[DI],ALDECCX

INCDI

REPMOVSB

L3: INT
3CODEENDS

ENDSTART

Hardware

MEMORY OP-CODE LABEL MNEMONICOPERAND

LOCATION
MOVSI,2000

MOVDI,3000

MOVBX,5000

MOVCX,0005
CLD

L1: MOVAL,[SI]
CMPAL,[BX]

JZL2

MOVSB

LOOPL1

JMPL3

L2: MOVSB
MOVBX,7000

MOVAL,[BX]

MOV[DI],AL

DECCX

INCDI

REP

MOVSB

L3: INT3
ObservationTable

Input Output

MEMORY Data MEMORY LOCATION Data


LOCATION

2000 3000

2001 3001

2002 3002

2003 3003

2004 3004

5000 3005

7000

DELETEABYTEINAGIVENSTRING

AIM:-

Towriteaalpfordeleteabyteinagivenstring

COMPONENTS &EQUIPMENT REQUIRED:-

S.No Device Range/Rating Quantity


(inNo’s)

2 8086microprocessorkit/ 1
MASMwithPC

Keyboard 1

3 RPS +5v 1
1

PROGRAM:

Software
ASSUMECS:CODE
CODESEGMENT

START: MOV
SI,2000HMOV
DI,3000HMOV
BX,5000HMOV
CX,0005HCLD

L1: MOV AL,


[SI]CMP AL,
[BX]JZL2MO
VSBLOOPL1
JMPL3

L2:

INCSID
ECCX

REPMOVSB

L3: INT
03HCODEENDS

ENDSTART
Hardware

MEMORY OP-CODE LABEL MNEMONICOPERAND

LOCATION
MOVSI,2000

MOVDI,3000

MOVBX,5000

MOVCX,0005

CLD

L1: MOVAL,[SI]
CMPAL,[BX]

JZL2

MOVSB

LOOPL1

JMPL3

L2: INCSI
DECCX

REP

MOVSB

L3: INT3

ObservationTable:

Input output

MEMORY Data MEMORY LOCATION Data

LOCATION

2000 3000

2001 3001
2002 3002

2003 3003

2004

5000

RESULT:

PRELABQUESTIONS:

Whatdoyoumeanbyassembler directives?

What.modelsmallstandsfor?

Whatisthesupplyrequirement of8086?

Whatistherelationbetween8086processorfrequency&crystalFrequency?

FunctionsofAccumulatororAXregister?
LABASSIGNMENT:

WriteanalpforinsertordeleteabyteinagivenstringwithSImemorylocationis4000andDIlocati
onis 6000?

Writeanalpfor movingorreversing thegivenstringwiththelengthofthestringis12?

POST LABQUESTIONS:

Whichinterruptsaregenerallyusedforcriticalevents?

WhichStackisusedin8086?

Whatis SIMandRIM instructions


AIM:-

EXPERIMENTNO5INTERFACINGA
DCANDDACTO8086

TowriteaPROGRAMforconversionofanalogdatatodigitaloutput.

To write a PROGRAM for conversion of digital data to analog output. The analogOutput will
be in the form of triangular wave, saw tooth wave, squareWave/rectangularwave.

COMPONENTS &EQUIPMENTREQUIRED:-

Quantity
S.No Device Range/Rating
(inNo’s)

1 8086microprocessorkit/TALK 1

withPC

2 Keyboard 1

3 RPS +5v 1

4 A/D,D/AInterfacingmodules 1

5 Powermateconnector 1

6 FRCConnector,RS-232cable 1

7 CRO 1

THEORY:

The A/D converter is treated as an input device by the microprocessor that sends an initializing signal
tothe ADC to start the analog to digital data conversion process. The start of conversion signal is a pulse
ofspecificduration.Aftertheconversionisover,ADCsendsendofconversionsignaltoinformthemicroprocessorabo
utitandresultisreadyattheoutputbufferofthe ADC.
PROCEDURE:

Connect the26coreFRCconnectortothe8086 traineratconnectornoCN4andtheinterfacemodule.

ConnectthepowermateconnectortotheinterfacemoduleandtheothersideoftheConnectortothepowersupply.Thec
onnectionstothepowersupplyaregivenbelowConnections:(powersupply)

Black:Gnd
Blue:
+5VRed:
+12V

Green:-12V

AfterthecompletionofthePROGRAMandconnectionsenterthePROGRAMasgiveninthelistingbelow.

G0< STARTINGADDRESS<ENTER(onthekeyboardoftrainer).
D/ACONVERTER:

PROGRAMTOGENERATESQUAREWAVE:

Software

.output
2500adcsegseg
ment

org
0000:4000hAss
umecs:cseg

Start:

Cseg endsend
Hardware

MOV AL,80HMOV
DX,0FFC6HOUTDX,ALMOV
DX,0FFC2HA0:MOV
AL,00HOUTDX,ALCALL DELAY 1MOV
AL,0FFHOUTDX,ALCALL
DELAY2JMPA0

Delay1:MOV CX,0020HA1:LOOPA1

RET

Delay2: MOV CX,0020HA1:LOOPA1

RET

MEMORY LOCATION OPCODE LABEL MNEMONICOPERAND

MOV
AL,80MOV
DX,0FFC6OUT
DX

MOV
DX,0FFC2MOV
AL,00OUTDX

CALLDELAY1
MOV
AL,0FFOUTDX

CALL
DELAY2JMPA
0
DELAYPROGRAM1

ADDRESS OPCODE LABEL MNEMONICOPERAND

MOV

A1: CX,0020LOOP
A1

RET

DELAYPROGRAM2

ADDRESS OPCODE LABEL MNEMONICOPERAND

MOV

A2: CX,0020LOOP
A2

RET

PROGRAMTO GENERATESAWTOOTHWAVE:

Software

.output 2500adcsegsegment

Start:
Cseg endsend

org 0000:4000hAssumecs:cseg

MOV AL,80HMOV DX,0FFC6HOUT,DX

MOV DX,0FFC2HL2:MOV AL,00HL1:OUTDX

INCAL

CMP AL,0FFHJBL1

OUT DXJMPL2

Hardware
ADDRESS OPCODE LABEL MNEMONICOPERAND

MOV
AL,80MOV
DX,0FFC6OUT,
DX

MOV
DX,0FFC2MOV
AL,00OUTDX
L2:
INCALCMP
L1: AL,0FFJBL1

OUT
DXJMP
L2
PROGRAMTOGENERATETRAINGULARWAVE:

Software

.output 2500adcsegsegment

Start:

Cseg endsEnd

org 0000:4000hAssumecs:cseg

MOV AL,80HMOV DX,0FFC6HOUTDX,ALMOVAL,00H


L3:MOV DX,0FFC2HL1:OUTDX,AL

INCAL

CMP AL,0FFHJCA2

L2:OUT DX,ALDECAL

CMP AL,00HJNBEA1JMPA0

Hardware

ADDRESS OPCODE LABEL MNEMONICOPERAND


MOVAL,80

MOVDX,0FFC6

OUTDX

MOVAL,00

L3: MOV
DX,0FFC2OUT
L1: DX
INCAL
CMP AL,0FF

JCL1

OUTDX
L2
DECAL
CMPAL,00

JNBEL2

JMPL3
A/DCONVERTER

PROGRAM:

Software

.output 2500adcsegsegment

org 0000:4000hAssumecs:cseg

Start:

MOV AL,90HMOV
DX,0FFC6HOUTDX,ALA0:MOV AL,07HMOV
DX,0FFC4HOUTDX,ALMOV AL,0FHMOV
DX,0FFC6HOUTDX,ALMOV
CX,3FFFHD1:LOOPD1MOV AL,0EHMOV
DX,0FFC6HOUTDX,ALMOV AL,0CHMOV
DX,0FFC6HOUTDX,ALMOV
DX,0FFC0HA1:INAL,DXANDAL,80HCMP AL,80H

JNZA1

MOV AL,0DHMOV DX,0FFC6HOUTDX,ALMOV


DX,0FFC0HINAL,DX

MOV DX,0FFC2HOUTDX

JMPA0

Cseg
endsend
Hardware

MEMORY LOCATION OPCODE LABEL MNEMONICOPERAND

MOVAL,90

MOVDX,0FFC6

OUTDX

D3: MOVAL,07

MOVDX,FFC4

OUTDX

MOVAL,0F

MOVDX,0FFC6

OUTDX

MOVCX,3FFF

LOOPD1

D1: MOVAL,0E

MOVDX,0FFC6

OUTDX

MOVAL,0C

MOVDX,0FFC6

OUTDX

MOVDX,0FFC0

IN DX
D2:
ANDAL,80

CMPAL,80

JNZD2

MOVAL,0D
MOVDX,0FFC6

OUTDX

MOVDX,0FFC0

IN DX

MOVDX,0FFC2

OUTDX

JMPD3
ObservationTable:

INPUT OUTPUT

RESULT:

PRE LABQUESTIONS

WhichisbydefaultpointerforCS/ES?

Howmanysegmentspresentinit?

Whatisthesizeofeachsegment?

Basicdifferencebetween8085and8086?

Whichoperationsarenot availablein8085?

LABASSIGNMENT:

Usingtheprogramgenerateawaveformandidentifythat

Usingtheprogramgenerateawaveformandidentifythat

POST LABQUESTIONS:
Whichisthetoolusedtoconnecttheuserandthecomputer

What isthepositionoftheStackPointerafterthePUSH instruction

Logiccalculationsaredoneinwhichtypeof registers
AIM:-

EXPERIMENTNO6INTERFACINGTO8086
ANDPROGRAMMING

TOCONTROLSTEPPERMOTOR

WriteanAssemblyLanguagePROGRAMtorotatetheStepperMotorinclockwiseaswellasanti-clockwisedirection.

COMPONENTS&EQUIPMENT REQUIRED:-

Quantity
S.No Device Range/Rating
(inNo’s)

1 8086microprocessorkit/TALK 1
withPC

2 Keyboard 1

3 RPS +5v 1

4 Steppermotorinterfacingcard,RS- 1
232

5 Steppermotor 1

6 FRCConnector,RS-232cable 1

THEORY:

A stepper motor is a device used to obtain an accurate position control of rotating shafts.
Itemploys rotation of its shaft in terms of steps, rather than continuous rotation as in case of AC or
DCmotors. To rotate the shaft of the stepper motor, a sequence of pulses is needed to be applied to
thewindings of the stepper motor, in a proper sequence. The number of pulses required for one
completerotationoftheshaftofthesteppermotorareequaltoitsnumberofinternalteethonitsrotor.

PROCEDURE:

Connect the 26 core FRC connector to the 8086 trainer at connector no CN4 and the interfacemodule.

Connect the power mate connector to the interface module and the other side of the connector
tothepowersupply.Theconnectionstothepowersupplyaregivenbelow.

Connections:(powersupply)

Black & Red:


Gnd.Blue&Green:
+5V.

5- Way power mate is wired to the motor. This power mate is to be inserted into the male
socketprovided on the interface. Care should be taken such that, below given code for the
particularcoloredwirecoincideswiththecode ontheinterface.
A-GREEN

C-RED&WHITE

B- GREEN &
WHITED-RED

VDD-BLACK&WHITE.

AfterthecompletionofthePROGRAMandconnectionsenterthePROGRAMasgiveninthelistingbelow.

G0< STARTINGADDRESS<ENTER(onthekeyboardoftrainer).

PROGRAMTO ROTATE INCLOCKWISE DIRECTION:

Software

.output 2500adcsegsegment

org 0000:4000hAssumecs:cseg

Start: MOV
AL,80HMOV
DX,0FFC6HOUT
DX,ALMOVBX,0
2H

A2:MOV
CX,00FFHA1:MOV
AL,77H

MOV
DX,0FFC4HOUTD
X,ALCALL
DELAYMOV
AL,0BBHMOV
DX,0FFC4HOUTD
X,ALCALL
DELAYMOV
AL,0DDHMOV
DX,0FFC4HOUTD
X,ALCALL
DELAYMOV
AL,0EEHMOV
DX,
0FFC4HOUTDX,A
LCALL
DELAYLOOPA1

DEC
BXJNZ
A2

Delay: MOV
AX,0500HA3:NOP

NOPDE
CAXJN
Z
A3RET

Cseg
endsEnd
Hardware

MEMORY LOCATION OPCODE LABEL MNEMONICOPERAND

MOVAL,80

MOVDX,0FFC6

OUTDX

MOVBX,02

MOVCX,00FF
A2:

A1: MOVAL,77

MOVDX,0FFC4

OUTDX

CALLDELAY

MOVAL,0BB

MOVDX,0FFC4

OUTDX

CALLDELAY

MOVAL,0DD

MOVDX,0FFC4

OUTDX

CALLDELAY

MOVAL,0EE

MOVDX,0FFC4
OUTDX

CALLDELAY

LOOPA1

DECBX
MEMORY LOCATION OPCODE LABEL MNEMONICOPERAND

JNZA2

DELAYPROGRAM:

MEMORY LOCATION OPCODE LABEL MNEMONICOPERAND

MOV

AX,0500NOP
A3:
NOPDE

CAXJN

ZA3

RET

RESULT:

PRELABQUESTIONS:

FunctionsofBXregister?

FunctionsofCXregister?

FunctionsofDXregister?

HowPhysicaladdressisgenerated?

Whicharepointers present inthis8086?

LABASSIGNMENT:

Writeanalp programtofindtheunpackedBCDtothegivenBCDnumber56 using8086trainerkit?


Writeanalp programtofindtheASCIInumbertothegivenBCDnumber56using8086trainerkit?

POSTLABQUESTIONS:

Instringoperationswhichisbydefaultstringsourcepointer

What isthesizeofflagregister

Canyouperform32bitoperationwith8086? How
EXPERIMENTNO7
PROGRAMMINGUSINGARITHMETIC,LOGICALANDB
ITMANIPULATION INSTRUCTIONSOF8051

AIM:-

WriteanALPprogramtoperform8bitarithmeticaloperationsbyusing8051.

COMPONENTS&EQUIPMENT REQUIRED:-

S.No Device Range/Rating Quantity


(inNo’s)

1 8051trainer kitwithkeyboard 1
2 TalkwithPC 1

3 RPS +5v 1

PROGRAMFORADDITION:

Software

Org
9000hMOV
A,#02MOV
B,#02ADD
A,BLCALL
03

Hardware

MEMORY LOCATION OPCODE LABEL MNEMONICOPERAND

MOV

A,#02MOV
B,#02ADD

A,B

LCALL03

OBSERVATIONTABLE:

Input output

REGISTER Data REGISTER Data

A 02 A 04

B 02
PROGRAMFORSUBTRACTION:

Software

Org
9000hMOV
A,#02MOV
B,#02SUBB
A,BLCALL
03

Hardware

MEMORY LOCATION OPCODE LABEL MNEMONICOPERAND

8000 MOV

A,#04MOV

B,#02SUBB

A,B

LCALL03

OBSERVATIONTABLE

Input output

REGISTER Data REGISTER Data

A 04 A 02

B 02

PROGRAMFORMULTIPLICATION:

Software

Org9000h
MOV
DPTR,#9000HMOV
XA,@DPTRMOVF0
,A

INCDPTRMOVX
A,@DPTRMULA
B

LCALL03
Hardware

MEMORY LOCATION OPCODE LABEL MNEMONICOPERAND

8000 MOV

DPTR,#9000MOV

A,@DPTRMOVF0

,A

INCDPTRMOVX

A,@DPTRMULA

LCALL03

ObservationTable

Input output

MEMORY LOCATION Data REGISTER Data

9000 03 A 06

9001 02

PROGRAMFORDIVISION:

Software

Org9000h

MOV
DPTR,#9000HMOV
XA,@DPTRMOVR0
,A

INCDPTRMOVX
A,@DPTRMOVF
0,A

MOV
A,R0DIV
ABINCDP
TR

MOV
@DPTR,ALCAL
L 03
Hardware

MEMORY LOCATION OPCODE LABE MNEMONICOPERAND

MOV

DPTR,#9000MOV

A,@DPTRMOVR0

,A

INCDPTRMOVX

A,@DPTRMOVF0

,A

MOV

A,R0DIV

ABINCDP

TR

MOV@DPTR,A

LCALL03

OBSERVATIONTABLE:

Input Output

MEMORY LOCATION Data REGISTER Data


9000 03 A 06

9001 02
LOGICALOPERATIONS:

AIM:-

Toperformlogicaloperationsbyusing8051.

COMPONENTS &EQUIPMENTREQUIRED:-

S.No Device Range/Rating Quantity


(inNo’s)

1 8051trainerkit withkeyboard 1

2 TalkwithPC 1

3 RPS +5v 1

4 RS-232 1

PROGRAMFORANDOPERATION:

i) Software

i) Hardware

Org9000h

MOVR0,#DATA1

MOVA,#DATA2ANLA,R0

MOV R1,ALCALL03
MEMORY LOCATION OPCODE LABEL MNEMONICOPERAND

MOV R0,#DATA1
MOVA,#DATA2
ANLA,R0
MOVR1,A
LCALL03

OBSERVATIONTABLE:

Input Output

Register Data Register Data

R0 R1

PROGRAMFOROROPERATION:

Software

Org9000h

MOVR0,#DATA1

MOVA,#DATA2
ORLA,R0

MOV
R1,ALCAL
L03
Hardware

MEMORY LOCATION OPCODE LABEL MEMONICOPERAND

MOVR0,#DATA1

MOVA,#DATA2

ORLA,R0

MOVR1,A

LCALL03

OBSERVATIONTABLE:

Input Output

REGISTER Data REGISTER Data

R0 R1

PROGRAMFORXOROPERATION:

Software

Org9000h

MOVR0,#DATA1

MOVA,#DATA2
XRLA,R0

MOV
R1,ALCAL
L03
Hardware

MEMORY LOCATION OPCODE LABEL MEMONICOPERAND

MOVR0,#DATA1

MOVA,#DATA2

XRLA,R0

MOVR1,A

LCALL03
OBSERVATIONTABLE:

Input output

REGISTER Data REGISTER Data

R0 R1

RESULT:

PRELABQUESTIONS:

Whatisthefunctionof01hofInt21h?

Whatisthefunctionof02hofInt21h?

Whatisthefunctionof09hofInt21h?

Whatisthefunctionof0AhofInt21h?

Whatisthefunctionof4chofInt21h?

LABASSIGNMENT:

WriteanalpprogramtoperformORoperationusing8051microcontrollertrainer Kit?

Writeanalpprogramtoperformadditionandsubtraction
operationusing8051microcontrollertrainerKit

56

12

POSTLABQUESTIONS:

Whatdo umeanbyemulator
Whatisthesizeofflagregister
WhatareASCIIcodesfornos.0toF
Whichno.representationsystemyou haveused
EXPERIMENTNO8

PROGRAMANDVERIFYTIMER/COUNTERIN8051

AIM:-

WriteanALPprogramtoPerformTimer0andTimer1inCounterModeandGatedMode

operation.

COMPONENTS &EQUIPMENTREQUIRED:-

S.No Device Range/Rating Quantity


(inNo’s)

1 8051trainerkit withkeyboard 1

2 TalkwithPC 1

3 RPS +5v 1

4 RS-232 1

5 FRCcables 1

THEORY:

The8051hastwo16bittimer/
counters.Theycanbeusedeitherasatimeroreventcount.Each16bittimeraccessedastwoseparateregistersasTL0,
TL1andTH0,TH1bytes.

PROGRAMTO VERIFYTIMER ‘0’-COUNTERMODE:

Software

Org8000h
MOV A,TMOD
(TMOD=89)ORLA,#05H

MOV
TMOD,ASETB TRO
(TRO=8C)LCALL68E
AH

Loop: MOV
DPTR,#0194HMOV
A,TLO(TLO=8A)MOVX@
DPTR,A

INCDPTR

MOV
A,THO(THO=8C)MOVX
@DPTR,ALCALL6748H

SJMPLOOP
Hardware

MEMORY OPCODE LABEL MNEMONICOPERANDS

LOCATION

MOV A,TMOD

(TMOD=89)ORLA,#05H

MOV

TMOD,ASETB TRO

(TRO=8C)LCALL

68EAHMOVDPTR,#0

194H

LOOP: MOVA,TLO(TLO=8A)

MOVX@DPTR,A

INCDPTR

MOV

A,THO(THO=8C)MOVX

@DPTR,ALCALL6748H

SJMPLOOP

EXECUTION:

Short jp1of1&2pinsandpresssw1formanualincrement

Shortjp1 of2&3pinsfor autoincrement

PROGRAMTOVERIFYTIMER‘1’-COUNTERMODE:
Software

Org8000h

MOV A,TMOD
(TMOD=89)ORLA,#50H

MOVTMOD,ASETB
TR1
(TR1=8E)LCALL68
EAH

Loop: MOV
DPTR,#0194HMOVA,TL1
(TL1=8B)MOVX@DPTR,
A

INCDPTR

MOV
A,TH1(TH1=8D)MOVX
@DPTR,ALCALL6748H

SJMPLOOP
Hardware

Memory OPCODE LABEL MNEMONICOPERANDS


location

MOVA,

TMOD(TMOD=89)ORLA,#50H

MOV

TMOD,ASETBTR1(T

R1=8E)LCALL68EA

MOVDPTR,#0194HMOV

A,TL1(TL1=8B)MOVX@

DPTR,A

INCDPTR

LOOP:
MOV

A,TH1(TH1=8D)MOVX

@DPTR,ALCALL6748H

SJMPLOOP

EXECUTION:

Short jp1of5&6pinsandpresssw2formanualincrement

Shortjp2of4&5pinsforautoincrement
RESULT:

PRE LABQUESTIONS:

Whatisthereset address of8086?

Whatisthesizeofflagregisterin8086?Explainall.

Whatisthedifferencebetween08Hand01Hfunctions ofINT21H?

Whichisfaster-
Readingwordsizedatawhosestartingaddressisatevenoratoddaddressofmemoryin8086?

Whichisthedefaultsegment base:offsetpairs?
LABASSIGNMENT:

1.writeanALPprogramtostudytimer-1 gatedmode

POST LABQUESTIONS:

WhyweindicateFFas0FFinprogram?

Whatisatype of queuein8086

Whileacceptingno.fromuserwhyuneedtosubtract30fromthat?
EXPERIMENTNo9
PROGRAMANDVERIFYINTERRUPTHANDLINGIN8051

AIM:-

WriteALPprogramtoallowtheexternalinterrupt1using8051

COMPONENTS &EQUIPMENTREQUIRED:-

S.No Device Range/Rating Quantity


(inNo’s)

1 8051trainerkit withkeyboard 1

2 TalkwithPC 1

3 RPS +5v 1

4 RS-232 1

5 FRCcables 1

6 Timermodulekit

THEORY:

8051hasfiveinterruptswhichareavailabletouser.Theyaretwofromthetimer/counteroverflow flags,
one for timer 0and one for timer 1, two interrupts from external interrupts and one
fromserialport.Toenable ordisablethecorrespondinginterruptitusesIEregister.

PROCEDURE:

Makethepowersupplyconnectionsfrom4-waypowermate connectorontheALS-NIFC-09board.
+5V...........bluewire

Ground......blackwire

Connect26-pinflatcablefrominterfacemoduletoP1ofthetrainerkit.

EntertheprogramintheRAMlocationin9000andexecutetheprogramGO<STARTING
ADDRESS><EXEC>

PROGRAM:

Software

ORG

E000HLCALL
68EAH

MOV

A,TMODORL

TMOD,#10HMOV
TH1,#00H
MOV

TL1,#FFHSETBI
T1

SETB
ET1SETBEX1SE
TB TR1SETB
PX1MOV

R6,#26HSETBE
A

HERE:AJMPHERE

ORG

8028HLJMP8
500HORG

8500HMOV

A,R6SWAPA
MOV R6,A

LCALL677DH
MOV
R0,#FFHMOV
R1,#FFHLCALL
6850HMOV
R0,#FFHMOV
R1,#FFHLCALL
6850H
MOV TH1,#00H
MOV TL1,#FFH
SETB TR1
RETI

ORG 8010H
SETB RS0
MOV R5,#3H
LJMP 8600H
ORG 8600H
MOV R6,#0
MOV R7,#0
LOOP_B:
LCALL675FHLCA
LL6850HDJNZR5,I
NCRE

MOV
R6,#0MOV

R7,#0LCALL67
5FH

CLR RS0
RETI
INCRE:
INC R6

SJMP LOOP_B
END
END
Hardware

MEMORY OPCODE LABEL MNEMONICOPERAND


LOCATION

ORGE000H

LCALL68EAH

MOV A,TMOD

ORL TMOD,#10H

MOV TH1,#00H

MOV TL1,#FFH

SETBIT1

SETBET1

SETBEX1

SETBTR1

SETBPX1

MOV R6,#26H

SETBEA

HERE AJMPHERE

ORG 8028H

LJMP8500H

ORG 8500H

MOV A,R6
ORG 8028H

LJMP8500H

ORG 8500H
MOV

A,R6SWAPA

MOV R6,A

LCALL677DHM

OV

R0,#FFHMOV

R1,#FFHLCALL6

850HMOV

R0,#FFHMOV

R1,#FFHLCALL6

850HMOV

TH1,#00HMOV

TL1,#FFHSETBT

R1

RETI

ORG

8010HSETB

RS0MOV
R5,#3HLJMP86

00HORG

8600HMOV

R6,#0MOV

R7,#0LCALL67

5FHLCALL685
LOOP_B
0H

DJNZR5,INCRE
MOV

R6,#0MOV

R7,#0LCALL67

5FHCLR

INCRE RS0RETI

INC

R6SJMPLOOP_

RESULT:

PRE LABQUESTIONS:

CanweuseSPasoffsetaddressholderwithCS?

Whichis thebaseregistersin8086?

Whichistheindexregistersin8086?

Whatdoyoumeanbysegment overrideprefix?

Whethermicroreducesmemoryrequirements?

LABASSIGNMENT:
Writeanalpprogramtofindthelength of thegivenarrayusing masmsoftware.

Writeanalpprogramtofindthesumof„n‟numbersusingmasmsoftware

POSTLABQUESTIONS:

What isthedifferencebetweendirectandindirect IOinterfacing?

Whatdoyoumeanbysegmentoverrideprefix?

Whethermicroreducesmemoryrequirements?
EXPERIMENTNo10UAR
TOPERATIONIN8051

AIM:-

WriteanALPprogramOfUARToperationin8051.

COMPONENTS&EQUIPMENTREQUIRED:-

S.No Device Range/Rating Quantity


(inNo’s)

1 8051trainerkit withkeyboard 1

2 TalkwithPC 1

3 RPS +5v 1

4 RS–232 1

5 FRCcables 1

6 UART Module 1

PROGRAMFORMODE-0-TRANSMITTER:-

Software

Org9000h

MOV SCON,#00H
(SCOON=98)UP1:MOVR7,#8H

MOVA,#80H

(SBUF=99)Up:CLRTi

(Ti=99)MOV
SBUF,AXX:JNBTi,XX
CLR
P1.0SETB
P1.0

LCALL
DELAYRRA

DJNZ
R7,UPJMPU
P1

Delay: MOV
R0,#0FFHUp3:MOV
R1,#0FFHUp2:DJNZ
R1,UP2DJNZ R0,UP3

RET
Hardware

MEMORY OPCODE LABEL MNEMONICOPERAND


LOCATION

MOV SCON,#00H

(SCOON=98)MOVR7,#8H
UP1:
MOVA,#80H

(SBUF=99)CLR Ti
UP:

(Ti=99)MOVSBUF,A

JNB

XX: Ti,XXCLR

P1.0SETB

P1.0

LCALLDELAY

RRA

DJNZR7,UP

JMPUP1

DELAYPROGRAM:

MEMORY LOCATION OPCODE LABEL MNEMONICOPERAND


MOV

R0,#0FFHMOV
UP3:
R1,#0FFHDJNZ
UP2:
R1,UP2DJNZ

R0,UP3

RET
PROGRAMFORMODE-0-RECIEVER:

Software

ORG9000h

MOV SCON,#11H
(SCOON=98)Up1:CLRP1.0

(P1.0=90)CLRP3.1 (P3.1=B1)

SETB ri

(Ri=99)SETBP1.0

CLRRi

(SBUF=99)XX:JNBRi,XX

MOV
A,SBUFMOV
R6,ALCALL
DELAYSJMPU
P

Hardware

MEMORY OPCODE LABEL MNEMONICOPERAND


LOCATION

ORG

MOVSCON,#11H(SCOON=98)

UP1: CLRP1.0 (P1.0=90)

CLRP3.1 (P3.1=B1)

SETB ri (Ri=99)
SETBP1.0

CLRRi (SBUF=99)

JNBRi,XX
XX:

MOVA,SUBF

MOVR6,A

LCALLDELAY

SJMPUP
RESULT:

PRE LABQUESTIONS:

Whatdoyoumeanbymacro?

Whatisdiffbetweenmacroandprocedure?

Typesofprocedure?

WhatTASMis?

WhatTLINKis?

LABASSIGNMENT:

Writeanalpprogramtoperformanoperationtofindthesumofsquaresofagivenarrayusingmasmsoftware
.

Writeanalpprogramtoperformanoperationtofindthecubesofsquaresofagivenarrayusingmasmso
ftware

POST LABQUESTIONS:

Instringoperationswhichisbydefaultstringsourcepointer

Instringoperations whichis bydefaultstringdestinationpointer

Whendivideoverflowerroroccurs
EXPERIMENTNo11INTE
RFACINGLCDTO8051

AIM:-

Writean ALPprogramtoInterfaceanLCD with8051microcontroller.

COMPONENTS &EQUIPMENTREQUIRED:-

S.No Device Range/Rating Quantity


(inNo’s)

1 8051trainerkit withkeyboard 1

2 LCDModule 1

3 RPS +5v 1

4 FRCcables 1

THEORY:

LCD display is an inevitable part in almost allembedded projects and this article is
aboutinterfacing 16×2 LCD with 8051 microcontroller. Microprocessors use different types of displays
todisplay the dataforuser.Forlarge amount ofdataCRTis used but forsmall amountofdataLCDs(Liquid
Crystal Display) or 7 segments LED displays will be used. Alphanumeric liquid Crystal displays(LCDs)
allow a better user interface, with text messages to enter the instructions and get the response inthe form
of text and know in a better manner what the machine is doing, including its diagnosticsinformation. The
main advantages of LCD displays are there low power consumption and the speed withwhichthe
displayedinformationisupdated.

PROGRAM:
CNTRL EQU 2043H ;8255 control port
addressPORTC EQU 2042H
;8255portCaddressPORTB EQU
2041H ;8255 portBaddressPORTA
EQU 2040H
;8255portAaddressFUNCTION_SET
EQU 38H ;displaycommands

DIS_ON_OFFEQU

0EHRETURN_HOME EQU
02HMODE_SET
EQU
06HCLEAR_DIS
EQU

01HDDRAM_ADDEQU 80H

CNTEQU
40HCNT1 EQU
41HCNT2EQU4
2H
MemoryLocation OPCODE LABEL MNEMONICOPERANDS

MOV SP,#50H

MOV PSW,#00H

MOV

CNT2,#10HMOV
R0,#14H

MOV

R1,#FFHLCALL

DELAY

MOV

DPTR,#CNTRLMOV

A,#80H

MOVX@DPTR,ALCALLSET_

CON_LINESMOV

BACK

R2,#03HLCALLSET_WR_CO

N_LINESMOV A,#00H

MOVX@DPTR,AMOV
DPTR,#PORTA

MOV

A,#FUNCTION_SETMOVX

@DPTR,A

MOV

DPTR,#CNTRLMOV

A,#05H

MOVX

@DPTR,ANOP

NOP

MOV A,#04H
MOVX@DPTR,AM

OV

R0,#06HMOV

R1,#E4HLCALLDEL

AYDJNZR2,BACKL

CALLCHK_BUSY

LCALLSET_WR_CON_LINES

MOV A,#00H

MOVX@DPTR,AMOV

DPTR,#PORTA

MOV

A,#DIS_ON_OFFMOVX

@DPTR,A

MOV

DPTR,#CNTRLMOV

A,#05H

MOVX@DPTR,AN

OP
NOP

MOV

A,#04HMOVX@DP

TR,ALCALLCHK_B

USY

LCALLSET_WR_CON_LINES

MOV A,#00H

MOV DPTR,#PORTA

MOV A,#RETURN_HOME
MOVX@DPTR,AMOV

DPTR,#CNTRLMOV

A,#05H

MOVX@DPTR,AN

OP

NOP

MOV

A,#04HMOVX@DP

TR,ALCALLCHK_B

USY

LCALLSET_WR_CON_LINES

MOV A,#00H

MOVX@DPTR,AMOV

DPTR,#PORTAMOV

A,#MODE_SETMOVX

@DPTR,AMOV
DPTR,#CNTRLMOV

A,#05H

MOVX@DPTR,AN

OP

NOP

MOV

A,#04HMOVX@DP

TR,ALCALLCHK_

BUSY

LCALLSET_WR_CON_LINES
MOV

A,#00HMOVX@D

PTR,A

MOV

DPTR,#PORTAMOV

A,#CLEAR_DISMOVX

@DPTR,AMOV

DPTR,#CNTRLMOV

A,#05H

MOVX@DPTR,AN

OP

NOP

MOV

A,#04HMOVX@DP

TR,AMOV

CNT1,#02HMOV
CNT,#08H

MOV

R0,#DDRAM_ADDLCALL

CHK_BUSY

LCALLSET_WR_CON_LINES

MOV A,#00H

MOV

DPTR,#PORTAMOV

A,R0

MOVX@DPTR,AMOV

DPTR,#CNTRLMOV

A,#05H

MOVX@DPTR,A
NOP

NOP

MOV

A,#04HMOVX@D

PTR,ACLR A

MOV

DPTR,#MSGMOVX

@DPTR,AMOV

R1,A

INC

DPTRPUSHD

PHPUSHDPL

LCALLCHK_BUSY

LCALLSET_WR_CON_LINES

MOV A,#01H

BACK3:
A,R1

MOVX@DPTR,AMOV

DPTR,#CNTRLMOV

A,#05H

MOVX@DPTR,AN

OP

NOP

MOV A,#04H
MOVX@DPTR,AP

OP DPL

POP DPH

CLR

APUSHR0

PUSHR1

MOVR0,#7FHM

OVR1,#FFHLCA

LLDELAYPOPR

POP R0

DJNZ

CNT,BACK3DJNZ

CNT1,F1DJNZ

CNT2,FORW1LJMPF

ORW

MOV

CNT,#08HPUSH
DPHPUSHDPL

LCALLCHK_BUSY

LCALLSET_WR_CON_LINES

MOV A,#00H

MOVX@DPTR,AMOV

DPTR,#PORTA

MOV A,#C0H

F1:
MOVX@DPTR,AMOV

DPTR,#CNTRLMOV

A,#05H

MOVX@DPTR,AN

OP

NOP

MOV

A,#04HMOVX@D

PTR,APOP DPL

POP DPH

CLR

ALJMPBACK3

PUSH

DPHPUSHDPL

MOV
R0,#DDRAM_ADDLCALLCH

K_BUSYLCALLSET_WR_CO

N_LINESMOV A,#00H

MOVX@DPTR,AMOV

DPTR,#PORTAMOV

A,R0

MOVX@DPTR,AMOV

DPTR,#CNTRL

FORW1: MOV A,#05H


MOVX@DPTR,AN

OP

NOP

MOV

A,#04HMOVX@D

PTR,AMOV

CNT,#08HMOV

CNT1,#02HPOP

DPL

POP DPH

CLR

ALJMPBACK3

:LCALL0003H

MOV

DPTR,#CNTRLMOV
A,#01H

MOVX@DPTR,A

MOV

A,#03HMOVX@D

PTR,AMOV

A,#04HMOVX@D

PTR,ARET

MOV
FORW:

DPTR,#CNTRLMOV
SET_CO
N_LINE
S: A,#90H

MOVX@DPTR,A

MOV A,#04H
MOVX@DPTR,A

MOV

A,#00HMOVX@D

PTR,AMOV

A,#03HMOVX@D

PTR,AMOV

A,#05HMOVX@D

PTR,A

MOV
CHK_B
USY:

DPTR,#PORTAMOVX

@DPTR,AMOV

B,A

MOV

DPTR,#CNTRLMOV

A,#04H

MOVX@DPTR,A

MOV A,B

JNB
A.7,F2LJMPB

ACK2

MOV

BACK2:

DPTR,#CNTRLMOV

A,#80H

MOVX@DPTR,AR

ET

MOV

DPTR,#CNTRLMOV

A,#04H

MOVX@DPTR,A

MOV A,#02H
MOVX@DPTR,AR

ET

PUSHR1

NOPDJN

F2: ZR1,LOOPPOP

R1

DJNZR0,LOOP1RE

SET_WR

_CON_L
I:NES:

DELAY:

LOOP1:

LOOP:

RESULT:

PRELABQUESTIONS:

Whatdoyoumeanbyemulator?

Stackrelatedinstruction?

Stack100means?

What doyoumeanby20 dup (0)?


Whichflags of8086 arenot presentin8085?

LABASSIGNMENT:

Writeanalpprogramtoperformanoperationtofindthecubesofagivennumberusingmasmsoftwar
e

WriteanalpprogramtoperformanoperationtofindthecubesofagivennumbersusingMPtrainerkit

POST LABQUESTIONS:

Explainthelogicoffindingoutnegativenos.fromanarrayofsignednos.

Explainthelogicofnonoverlap andoverlap blocktransferprogram

Explainthelogicofstringrelatedprograms.
EXPERIMENTNo
12INTERFACINGMATRIX/KEYBOARDTO805
1

AIM:-

Interfacea Keyboardto8051microcontroller.

COMPONENTS &EQUIPMENTREQUIRED:-

S.No Device Range/Rating Quantity


(inNo’s)

1 8051trainerkit withkeyboard 1

2 Keyboardmodule 1

3 RPS +5v 1

4 FRCcables 1

5 RS-232 cable

THEORY:

8255 is a general purpose Programmable peripheral interface device. It can be used to


interfacekeyboard with 8051 microcontroller. All the I/O devices require up to 3 I/O ports (Port A, Port B
and PortC)whichisprovidedby8255.Interfacecircuitalsowillbesimple.

PortAisconfiguresasaninputporttoreceivetherow-columncode.Port Bis
configures as anoutputport todisplaythekey(s)pressed.

PortCis configuresas anoutput porttooutput zeros totherows todetectakey.

PROGRAM:
CNTRL EQU 2043H ;CONTROLPORT ADDRESSOF8255
PORTA EQU 2040H ;PORTAADDRESSOF8255
PORTB EQU 2041H ;PORTBADDRESSOF8255
PORTC EQU 2042H ;PORTCADDRESSOF8255

Software

Org
9000hMOVA
,#90H

MOV
DPTR,#CNTRLMOV
X @DPTR,AMOV
B,#20H

Blink
2:MOVDPTR,#PORTB
MOV A,#FFH

MOVX
@DPTR,AMOV

DPTR,#PORTCMOV
A,#00H
MOVX
@DPTR,AMOV

A,#F0HMOVX
@DPTR,ADJNZ
B,BLNK2

Back: MOV A,#FEH

MOV B,#21H

Blink1:MOV

DPTR,#PORTBMOVX
@DPTR,AMOV

DPTR,#PORTCMOV

A,#00HMOVX@DPTR,
A

MOV

A,#F0HMOVX
@DPTR,ALCALL
DELAYRL
A

DJNZB,BLNK1S
JMP BACK

Delay: MOV

R0,#F7HOloop:MOV
R1,#FFHIloop:
DJNZ R1,ILOOP

DJNZR0,OLOOPRE
T

Hardware

MemoryLocation OPCODE LABEL MNEMONICOPERANDS


MOVA,#90H

MOV
DPTR,#CNTRLMOV
X @DPTR,AMOV
B,#20H

MOVDPTR,#PORTBM
OV A,#FFHMOVX
BLINK2:
@DPTR,AMOV

DPTR,#PORTCMOV
A,#00H

MOVX
@DPTR,AMOV

A,#F0HMOVX
@DPTR,ADJNZ

B,BLNK2MOV

A,#FEHMOV
BACK:
B,#21H

MOV DPTR,#PORTB
BLINK1: MOVX
@DPTR,AMOV

DPTR,#PORTCMOV

A,#00HMOVX@DPTR
,AMOV
A,#F0HMOVX
@DPTR,ALCALLDEL
AY

RL A

DJNZB,BLNK1SJ
MP

BACKMOV

R0,#F7HMOV

R1,#FFHDJNZ
DELAY:
OLOOP:
R1,ILOOPDJNZR0
ILOOP:
,OLOOPRET

RESULT:

PRE LABQUESTIONS:

Whatisthesizeofflagregister?

Canyouperform32bitoperationwith8086?How?

Whether 8086iscompatiblewithPentiumprocessor?

Whatis8087?Howitisdifferent from8086?

Whileacceptingno.fromuserwhyu needtosubtract30 fromthat?


LABASSIGNMENT:

Writeanalpprogramforadditionofmultibytenumbers.

Writeanalpprogramfor multiplicationofgivennumber
inlocationmodea)0060

b)0002

POST LABQUESTIONS:

ComparememoryinterfacingandIOinterfacing

howthe evenoddaddressareassignedthrough8086

howthecs:ipisworkingduringinterrupt
CONTENTBEYOND SYLLABI
AIM:-

EXPERIMENT No1
PROGRAMTOFINDLCM OFAGIVENNUMBER
TowriteanassemblylanguageprogramtofindLCMofagivennumberusing8086

COMPONENTS &EQUIPMENTREQUIRED:-

S.No Device Range/Rating Quantity


(inNo’s)

1 8086trainerkit withkeyboard 1

2 RPS +5v 1

3 RS-232 cable

PROGRAM:

Software

Assumecs:codeCodesegment

Start:

mov ax,datamovds,axmovdx,0hmov
ax,nummov bx,num+2up:pushaxpushdx

div bxcmp dx,0je exitpop dxpopax


add ax,numjnc downincdx

down:jmpupexit:poplcm+2poplcm

mov ah,4chint03h

Code
endsEndsta
rt
Hardware:

ADDRESS OPCODE MNEMONICS COMMENTS

4500 START:MOV LoadtheDatatoAX.


AX,DATA MovetheDataAXtoDS.
MOVDS,AX InitializetheDX.
MOVDX,0H MovethefirstnumbertoAX.
MOVAX,NUM Movethesecondnumber toBX.
MOVBX,NUM+2 Storethequotient/firstnumberinAX.
UP:PUSHAX StoretheremaindervalueinDX.
PUSHDX Dividethefirst numberbysecondnumber.
DIV BX Comparetheremainder.
CMPDX,0 Ifremainderiszero,gotoEXITlabel.
JEEXIT Ifremainder isnon-zero,
POPDX Retrievetheremainder.
POPAX Retrievethequotient.
ADDAX,NUM Addfirst numberwithAX.
JNCDOWN Ifno carryjumptoDOWN label.
INC DX IncrementDX.
DOWN:JMP UP JumptoUplabel.
EXIT:POPLCM+2 Ifremainderiszero,storethevalueat
POPLCM LCM+2.
MOVAH,4CH

INT 21H
CODEENDS

ENDSTART
ObservationTable:

Input Output
0A,04 02

Result:

ThustheprogramtofindLCMofagivennumberusing8086successfully

PRE LABQUESTIONS:

Types ofprocedure

What does meanbylinker

What is diffbetween macroandprocedure

Whichflagsof8086arenotpresentin 8085?

WhatisLEA?
LABASSIGNMENT:

WriteanALPprogramtoconvertunpackedbcdtopackedbcdusing8051

WriteanALPprogramtoconvertunpackedbcdtoAsciibyusing8051

POST LABQUESTIONS:

What is @dataindicates ininstruction-MOVax,@data?

Explainthelogicofstringrelatedprograms.

Whichassemblerdirectivesareusedwithfarprocedure?
EXPERIMENTNo2
PROGRAMTOFINDSQUAREANDCUBEOFANUMBER

AIM:-

Towriteanassemblylanguageprogramtofindsquareandcubeofanumberusing8086

COMPONENTS &EQUIPMENTREQUIRED:-

S.No Device Range/Rating Quantity


(inNo’s)

1 8086trainerkit withkeyboard 1

2 RPS +5v 1

3 RS-232 cable

PROGRAM:

Software

Assume cs:
codeCodesegme
nt

Start:
Int 03h

Code
endsEndsta
rt

Hardware:
ADDRESS OPCODE MNEMONICS COMMENTS

4500 MOVAX,DATA LoadtheDatato AX.


MOVDS,AX MovetheDataAXtoDS.
MOVAX,X MovetheXnumber DatatoAX.
MOVBX,X MovetheXnumberDatatoBX.
MULBX PerformthemultiplicationbyBX.
MOVSQUARE,AX StorevalueinSQUARE.
MULBX PerformthemultiplicationbyBX.
MOVCUBE,AX StorevalueinCUBE.
MOVAH,4CH
INT 21H
ObservationTable:

Input Output
Square 4h 10h

Cube 4h 40h

Result:

Thustheprogramtofindsquareandcubeof agivennumberusing8086successfully

PRE LABQUESTIONS:

Whiledisplayingno.fromuserwhyuneedtoadd30 tothat?

What areASCIIcodes fornos.0toF?

HowdoesUdifferentiatebetweenpositiveandnegativenumbers?

Whatisrangeforthesenumbers?

Whichno. representationsystemyouhaveused?

LABASSIGNMENT:

Writeanalpprogramtodivide32bitbythe16bit.

Writeanalp programformedianofanarray.

POST LABQUESTIONS:

80386 is howmanybitprocessors?

HowmanypinIC80836is?

Mentionthepriorityofinterrupts in8086
EXPERIMENTNo3
PARALLELCOMMUNICATIONBETWEENTWOMICROPROCESSORSU
SING8255

AIM:-

Towrite analpforparallelcommunicationbetweentwomicroprocessorsbyusing8255

COMPONENTS &EQUIPMENTREQUIRED:-

S.No Device Range/Rating Quantity


(inNo’s)

1 8086trainerkit withkeyboard 1

2 RPS +5v 1

3 8255 1

PROCEDURE:

Connectthe26coreFRCconnectortothe8086traineratconnectornoCN4andtheinterfacemodu
le.

Connectthepowermateconnectortotheinterfacemoduleandtheothersideoftheconnector
to the power supply. The connections to the power supply aregivenbelow.

Connections:(powersupply)

Black&Red:
Gnd. Blue
&Green:
+5V

5- Way power mate is wired to the motor. This power mate is to be inserted into
themalesocket provided on the interface. Care should be taken such that, below
givencodefortheparticularcoloredwirecoincideswiththe codeonthe interface.
A- GREEN
C-
RED&WHITEB-
GREEN&WHITE
D-RED

VDD-BLACK&WHITE.

Afterthecompletionof theprogram andconnectionsentertheprogram


asgiveninthelistingbelow.

G0<STARTINGADDRESS<ENTER(onthekeyboardoftrainer).
PROGRAM:

MEMORY
OPCODE LABEL MNEMONICS
LOCATIO

MOVAL,90MOV
DX,3006
4000
OUT
DXMOVDX,3000I
LOOP1 NAL,DXNOTAL

MOVDX,3002OUTD
XMOV
AL,02MOVDX,3006
OUTDX

CALL
DELAYMOVAL,03M
OVDX,3006OUT
DXCALLDELAYMO
VAL,0AMOV
DX,3006OUTDXCAL
L DELAYMOV
AL,0BMOVDX,3006
OUT DXCALL
DELAYMOVAL,0E
MOVDX,3006OUT
DXCALLDELAYMO
V AL,0FMOV
DX,3006OUTDXCAL
L
DELAYJMPLOOP1

DelayProgram:

MEMORYLOCATION OPCODE LABEL MNEMONICS


MOV
4500 NEXT CX,7FFFLOOP
NEXT

RET

Result:

Programforparallelcommunicationbetweentwomicroprocessorsbyusing8255performed.
PRELABQUESTIONS:

Whatisthedifferencebetweenminmodeandmaxmodeof8086?

Whatisthedifferencebetweennear andfar procedure?

WhatisthedifferencebetweenMacroandprocedure?

WhatisthedifferencebetweeninstructionsRET &IRET?

WhatisthedifferencebetweeninstructionsMUL&IMUL?

LABASSIGNMENT:

16-BitAdditioninLocationmodeusing8086microprocessorKit.

16-BitsubtractioninLocationmodeusing8086MicroprocessorKit.

POSTLABQUESTIONS:

What is thesizeofIVT

Whichsteps8086followstohandleanyinterrupt?

roleofpointers
EXPERIMENTNo4
SERIALCOMMUNICATIONBETWEENTWOMICROPROCESSORKITSUSIN
G8251

AIM:-

Towrite analpforserialcommunicationbetweentwomicroprocessorsbyusing8255

COMPONENTS &EQUIPMENTREQUIRED:-

S.No Device Range/Rating Quantity


(inNo’s)

1 8086trainerkit withkeyboard 1

2 RPS +5v 1

3 8255 1

PROCEDURE:

Connectthe26coreFRCconnector tothe8086
traineratconnectornoCN4andtheinterfacemodule.

Connectthepowermateconnectortotheinterfacemoduleandtheothersideoftheconnectorto
the power supply. The connections to the power supply are givenbelow.

Connections:(powersupply)

Black & Red:


Gnd.Blue&Green:
+5V
5- Way power mate is wired to the motor. This power mate is to be inserted into
themalesocketprovided on theinterface.Care shouldbe taken such that, below
givencodefortheparticularcoloredwire coincideswiththecodeonthe interface.

A-GREEN
C-
RED&WHITEB-
GREEN&WHITE
D-RED

VDD-BLACK&WHITE.

Afterthecompletionoftheprogramandconnectionsentertheprogramasgiveninthelistingbelo
w.

G0<STARTINGADDRESS<ENTER(onthekeyboardoftrainer).
PROGRAM:

MEMORY OPCODE LABEL MNEMONICS


LOCATION

4000 MOV
AL,36MOV
DX,0086HOUT
DX,ALMOV
DX,0080HMOV
AL,0AOUTDX,
ALMOV
AL,00OUTDX,
ALMOV
SP,3000MOV
DX,0092OUTD
X,ALOUTDX,A
LOUTDX,ALO
UTDX,ALCALL
DELAYMOV
AL,40OUTDX,
ALCALL
DELAYMOV
AL,CEOUTDX,
ALCALL
DELAYMOVA
L,27

OUTDX,AL
CMPAL,1B

JEL1

MOVDX,0090

INAL,DX

ANDAL,81

CMPBL,AL

JEL3

L2 MOVDX,0092

INAL,DX

ANDAL,81

CMPAL,81

JNEL2

MOVAL,BL

MOVDX,0090

OUTDX,AL

OUTDX,AL

MOV[SI],AL

INCSI

JMPL1

OUTDX,AL

INCSI

JMPL2

L3 INT03
DelayProgram:

MEMORYLOCATION OPCODE LABEL MNEMONIC


4500 MOVCX,0002
A3 LOOPA3

RET
Result:
Programforserialcommunicationbetweentwo microprocessorsbyusing8251Performed

PRE LABQUESTIONS:

WhatisthedifferencebetweeninstructionsDIV&IDIV?

Whatisdifferencebetweenshiftsandrotateinstructions?

Whicharestringsrelatedinstructions?

Whichareaddressingmodes andtheirexamplesin8086?

Whatdoesumeanbydirectives?

LABASSIGNMENT:

Writeanalp programtofindthesmallestnumberinanarrayusingmasmsoftware.

Writeanalpprogramtofindthelargestnumberinanarrayusing masmsoftware.

POST LABQUESTIONS:

Howaninterruptisacknowledged?

Howthe evenoddaddressesareassignedthrough8086?

How16bitprocessorgenerates20bitaddresses
EXPERIMENTNo5COMMUNICAT
IONBETWEEN8051KITANDPC

AIM:-

Interfacean8051microcontrollertrainerkittopcandestablishacommunication
betweenthemthrough RS232

COMPONENTS &EQUIPMENTREQUIRED:-

S.No Device Range/Rating Quantity


(inNo’s)

1 8051trainerkit withkeyboard 1

2 RPS +5v 1

3 8251UART 1

4 PC 1

PROCEDURE:

Makethepower supplyconnectionsfrom4-waypowermateconnectorontheALS-
NIFC-09board.

+5V...............bluewire
Ground.............blackwire
Connect26-pinflatcablefrominterfacemoduletoP1ofthetrainerkit.
EntertheprogramintheRAMlocationin9000andexecutetheprogramG
O<STARTINGADDRESS><EXEC>

PROGRAM:

ADDRESS OPCODE LABEL MNEMONICS

MOV
A,#36MOV
DPTR,#2043MOV
X
@DPTR,AMOVD
PTR,#2040

MOVA,#0AMOV
X
@DPTR,AMOVA,
#00MOVX
@DPTR,AMOVR
1,#3000
MOVDPTR,#0092

MOVX@DPTR,A

MOVX@DPTR,A

MOVX@DPTR,A

MOVX@DPTR,A

CALLDELAY

MOVA,#40

MOVX@DPTR,A

CALLDELAY

MOVA,#CE

MOVX@DPTR,A

CALLDELAY

MOVA,#27

MOVX@DPTR,A

CALLDELAY

MOVDPTR,9000

MOVDPTR,#0092

UP MOVX@DPTR,A

CMPA,1B

JEUP

MOVDPTR,#0090

MOVX@DPTR,A

ANLA,81

CJNEB,A.DOWN
MOVDPTR,#0092

UP1 MOVX@DPTR,A

ANLA,81

CJNEAL,81.UP1

MOVA,B

MOVDPTR,#0090

MOVX@DPTR,A
MOVX@DPTR,A

MOV R3,9700

MOV R3,A

INCR3

JMPUP

MOVX@DPTR,A

INCR3

JMPUP

INT03

DOWN MOV CX,0002

DELAY LOOPHERE

HERE RET

RESULT:

Thus, the 8251 USART can be used to establish communication between two
processors by
receivingthecharactersfromtheUSARTanddisplayingthesecharactersontheconsole.

PRE LABQUESTIONS

WhatTDis?

Whatdou meanbyassembler?

Whatdou meanbylinker?

Whatdou meanbyloader?

Whatdoumeanbycompiler?

LABASSIGNMENT:
Writeanalpprogramtoperformanoperationtofindthesquaresof a
givennumberusingmasmsoftware.

Write an alpprogram toperform anoperation to find


thesquaresofagivennumberusingMPtrainerkit

POSTLABQUESTIONS

Specifyaddressingmodesforanyinstruction

Whatistherelationbetween8086processorfrequency& crystalfrequency?

HowPhysicaladdressis generated?

You might also like