0% found this document useful (0 votes)
26 views35 pages

Imgtopdf 2708241436018

Image formed by measuring the

Uploaded by

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

Imgtopdf 2708241436018

Image formed by measuring the

Uploaded by

kprakhar253
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 35
LABO RATORY MANUAL Microprocessor and Microcontroller (104505P) B. Tech V-SEM OGdsdddddddddddéidde DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING LIST OF EXPERIMENTS 1. Introduction to 8085 Microprocessor kit 2, Write a program to add two 8-bit data stored in successive memory locations with and without cary. 3. White a program to subtract two 8-bit data stored in successive memory locations with and ‘without borrow 4. Write a program to add two 16-bit data stored in successive memory lacations with c 3. Write a program to subtract two 16-bit data stored in successive memory locations with carry. 6, Write a program to niultiply two 8-bit data stored in successive memary locations, ‘T. Write a program to divide wo 8-bit data stored in successive memory locations. 8, Write a program to deterthine larger number of two 8-bit numbers stored in successive memory locations. 9. Writea program to determine smaller number af two $-bit numbers stored in successive ‘memory locations 10, Write a program to determine largest number among amy of §-bit numbers stored in __ successive memory Iecations. _— Te wwe Microprocessor Lab 1. INTRODUCTION TO MICROPROCESSOR 8085 Aim To study the microprocessor 885 Architecture of 8085 Microprocessor a) General purpose registers cis an 8 bit register Le. B, C, D, E, H, and L. The combination of & bit register is known as register pair, which can hold 16 bit data, The HL pair is used to aet as memory pointer is accessible to program. by Accumulator Itis an & bit register which hold one of the data to be processed hy ALU and stored ‘the result of the operation. €) Program counters (PC) Itis a 16 bit pointer which maintains the address of a byte entered to line stack ~ dy Stack pointer (Sp) : Itis a 16 bit special purpose register which is used to hold line memory address for ‘ext instruction to be executed. tic and logical unit i carries out arithmetic and logival operation by 8 bit addeess it uses the aecumulator as input the ALU result is stored back into accumulator register of fire, individual flip flops line content of line flag register BRE ariel pid onions. Tue neste ups ue Microprocessor Lab IT’ can be enabled or disabled by using Whenever the microprocessor receives i It has to be acknowledged. RST 5.5, 65,75 1. These are nothing but the restart interrupts, 2. They insert an internal restart junction automatically. Microprocessor Lab only non-maskable interrupt be enabled (or) disabled using program. Timer: 3 channels -16 bit programmable units, fate. Clock generator. Channel “I” is used for: Display: 6 digits ~ 7 segments LED display with filter 4 for data display. Key board: 21 keys, soft keyboard including common keys RES: Reset keys allow terminating any present activity initialize state. icroprocessor Lab Experiment No.02 ‘numbers without considering any earry. ratus required: oproeessor kit, Power supply, Microprocessor Lab Flow chart: - Load H-L pair with address of first operand’s memory location. Move the first operand from memory 0 accumulator. Increment H-L pair to point to next memory = Move the second operand from memory to register B. ‘Add B with A. Microprocessor Lab Mnemonics | Operand — Opcode Remark ox H,3000H | 21 Load H-L pair with address 3000H, 0 Lower order of 30008, 30 Higher order of 3000H. AM TE | Move the Ist operand from memory to reg. A. u 2B Increment HAL pair. BM 46 | Move the 2nd operand from memory to reg. B. B 80 Add B with A. H B Increment H-L pair. MA 1 Move the result from reg. A to memory. 16 Halt, Microprocessor Lab SUBTRACTION OF TWO 8 BIT NUMBERS 2 bit (8) numbers by embly language program for subtracting kit. Start the microprocessor -Intialize the carry as “Zero” Load the first & bit data into the accumulator Copy the contents of contents into the register “B” the second 8 bit data into the accumulator. the 2 8 bit datas and check for borrow. on if no borrow ent borrow if there is jliment of accumulator is found out ore the result in the accumulator ¢ the borrow value from ‘c’ to accumulator Initialize the borrow as zero. ‘Transfer the 1st number to register ‘ Load the 2" §-bit number. Subtract the two values. 1's compliment of 2™ number. ‘compliment for 2's complement. Microprocessor Lab rm Microprocessor Lab Mnemonies [Hex Code ‘Comments MViC,00 [OF 00 [initialize the carry as ero EDA2300- | 3A, (00, 23) | Loud the first & bit data into the faveumulator MOV, B.A 47 Copy the value into register BY LDA 2301 | 3A,(O1, 28) |Loadthe 2 8 bit data into the accumulator SUBB 90 [Subtract both the values. INC D2, OE, 21_[Jump on ifn borrow INRC OC |i borrow is there, increment by lone CMA RE [Compliment of 2 data I ADI, O1 G6, 01 [Add one o 1's compliment of 2 ; data. " STA 2302, 32,0223 [Store the result in accumulator | MOV A,C 79 |Moul the value of borrow into the accumulator STA 2303 _[ 32,0523 | Store the result in accumulaior HLT 16 ‘Stop Program execution Input Address Value 2300, 1S 2301 oF ‘Duiput Address Vaine 2302 7 | 2303 00 (borrow) | Taput Address T Value | 72300, 7 2301 m ‘Output Address Value on 01 (borrow) bit numbers was executed Microprocessor Lab |. ADDITION OF TWO 16~ BIT NUMBERS To write an assembly language program for adding two 16 bit numbers using $5 micro processor kit. Start the microprocessor : Get the 1°°& bitin ‘C* register (LSB) and 2” 8 bit in “H” register (MSB) of 16 bit number. + Savethe 1 16bit in DE register pair + Similarly get the 2°” 16 bit number and store it in “HL register 5 Getthe lower byte of 1 _mumber into “L? register ‘Ada it with ower byte of 2" number tore the result nL" register Getthe higher byte of | number into accumulator {Addit with higher byte of 2" number and carry ofthe lower bit addition Store the result in ‘H’ register Store 16 bit addition value in HL" register pair Stop program execution Microprocessor Lab 100 + Load HL? with Data { es ‘Transfer Hi = DE Load ‘He’ with ga Data DET HL= HL. f CRC Microprocessor Lab Comments. Je= oo HL=1_No. HL — DE HL=2 No. ‘Double addition DE + HL If Cy =0, G0 to 450E [C=C+ 01 HL — 4804 (sum) [Gy=A Cy = 4806 ‘Stop exeution EE Microprocessor Lab Tnput Address Value 2800 FF (addend) 2801 DE (addend) 2802 96 (augend) 2803 DF (augend) ‘Output Address Value 2804 95 (suit 2805 BE (sum) 2806 O1 (carry) Wo1ii0 141 11011111 1001 0101 1001 0101 9 5 ge program for addition of two 16 bit numbers was executed TTS SLT RL A Microprocessor Lab 5 SUBTRACTION OF TWO 16~ BIT NUMBERS. o write an assembly language program for subtracting two 16 bit numbers $5 microprocessor kit. Start the microprocessor Get the | 16 bit in “HL’ register pair Save the 1 16 bitin “DE" register pair Get the 2.16 bit number in “HL’ register pair Get the lower byte of |_ number Get the subtracted value of 2. number of lower byte by subtracting it with lower byte of 1" number Store the result in “L’ register Get the higher byte of 2» number Subtract the higher byte of 1°" number from 2" number with borrow Store the result in ‘HL’ register Stop the program execution Load ‘He’ with "4 Data Transfer E= A(LSBY i A= A-L (SB) { Store ‘A’ in memory (LSB) Microprocessor Lab Microprocessor Lab iress_ | Label Mnemonics Hex Code Comments ~ 2500, MVI ‘C00 OE [e= 00H 2501 00 2502 LHLD 2800 2A |L=1 No. 00 28 XLHG EB [HL—DE. LHLD 2802 2A___|HL—2_No. 92 28 MOV AE 3B LSB of ‘I’ to “A” SUB 95 ‘STA [A— memory MOV MSB of I to A SBB. [A AH INC 14 25 INR a 0c P STA 2805 32 ‘A= memory 05 28 ‘MOV. AC 79 STA 2806 32 06 28 HLT 16 Stop execution. iS Value OT 08 05 06 Value ba 02 02 00 7 SOSA EPI ay eae Microprocessor Lab Input Address Value. 2800 05, 2801 06 2802 07 2803 08, ‘Output Address ‘Value 2804 02. 2805 02. 2806 oO 06 - 0708 06 0101 0110 07 08 O11 1000 1010 1001 CMA 1000 0111 0000 0001 ACI 0000 0001 1010 1000 1000 oe | (07S 08 1010 1010 1000 1000 (0010-0010 02 «(02 nbly language program for subtraction of two 16 bit numbers was executed 0 processing kit. Microprocessor Lab 6, MULTIPLICATION OF TWO 8 ~ BIT NUMBERS To write an assembly language for multiplying we 8 bit umbers by using Start the microprocessor Get the 1 8 bit numbers Move the 1 8it number to register ‘B Get the 28 bit number Move the 2" 8 bit number to register Intialise the accumulator as zero + Intialise the carry as zero £ Add both register ‘B" value as accumulator + Jump on ifn carry : Increment carry by 1 if there is © Decrement the 2" value and repeat from step 8 till the 2" value becomes 2e70. . Store the multiplied value in accumulator Move the carry value to accumulator Store the carry value in accumulator Get the 1* &.bit number. Move itto register BT Get the 278 bit mumber Microprocessor Lab { Initialize the accumulator as zero & curry as zero. st No ; ‘Yes Increment carry jent.2™ number 2 Nymer ‘Yes the value Fearry in accumulator Microprocessor Lab Mnemonies Hex Code Comments: LDA 2500. 3A, 00,25 | Load the first 8 bit number MOV BA 4 Move the I” 8 bit data to register ‘B' LDA 2501 3A,01,25 [Load the 2__16 it number Move the 2 8 bit data to register ‘C” MVIA, 00 3E, 00 Intialise the accumulator as zero MVID..00) 16,00 __[Intialise the carry as zero ADDB 80 [Add the contents of B’ and) accumulator INC D2 1,21 [Jump ifno cary TNRD 14 ‘increment carry ipthere is DCRC OD, Decrement the value *C™ | INZ C20C 21 [Jump if number zero STA 2502 320225. [Store the result in accumulator MOVAD TK Move the carry into] accumulator STA 2503 320325 [Store the result in accumulator [Stop the program execution Pee Microprocessor Lab 7. DIVISION OF TWO 8 — BIT NUMBERS, Aim: __Towrite an assembly language program for dividing two 8 bit numbers using microprocessor kit, Apparatus required: 8085 microprocessor Kit (0-SV) DC battery Algorithm: Stepl + Start the microprocessor Step2 Intilise the Quotient as zero Load the 15° bit data Copy the contents of accumulator into register Load the 2""" 8 bit data Compare both the values Jump if divisor is greater than dividend Subtract the dividend value by divisor value + Inerement Quotient + Jump to step 7, till the dividend becomes zero Store the result (Quotient) value in accumulator Move the remainder value to accumulator Store the result in accumulator Stop the program execution g b Microprocessor Lab START Get the divided Intiaise the Quotient as zero Get the divisor Compare the dividend & divisor 15 uml No Tnerement carry SSsvUddY Microprocessor Lab Com Label Mnemonics | Hex Code ments LHLD 2501H | 2A,01,25 [Get dividend in IL pair LDA 250311 3A,03,25 _| Get divisor from 25031 MOVBA a7 Divisor in register B MVIC.08 0E,08 Count = 08 in reg. B Shifl dividend and quotient left by Loop DAD H 2 ‘one bit. MOV AH 71C MSB of dividend in accumulator. Subtract divisor from most 2108 SUBB 90 significant bits of dividend. Ts most significant part of dividend> JC AHEAD | _DA.U,21 | Divisor? No, go to AHEAD [Most significant bits of dividend in MOV HA 67 register H. INRL 2c FYes.add I to quotient. DCRC oD [Decrement count, JNZ LOOP C2,09,21 Is count =0 ?No,jump to LOOP. ‘Store quotient in 2504 and SHLD 2504H_| 22,0425 __|remainderin 25051 76 ‘Stop the program execution, Value 34 00 09 ‘Value quotient) 03 (reminder) ; , Its The assembly language program for division of two 8 bit numbers was executed using micro processing kit Vvuvvvvoeo f Microprocessor Lab Experiment No. 8 Start the microprocessor. ‘Load H-L. pair with address of first operand’s memory location. Move the first operand from memory to accumulator. Increment H-L pair to point to next memory location. Tncrement H-L pair to point to next memory location, “Move the second operand from memory to register B. Compare B with A, HL pair with address of rand’s memory location. Ne the first operand from memory to-accumulator. Aent H-L pair to point to =xt memory location. dl operand from ) repister B. SSE VT TTT Microprocessor Lab Compare B with A, I Move data from register B to secumulator. | Increment H-L pair. Move the resultfrom ‘accumulator to memory. | stop Opcode | Remark 21 | Load H-L pair with address 3000. | 00 | Lower-order of 30H. 30 | Higher-order of 300011. TE | Move the Ist operand from memory toreg. A. a) ; 23) | increment Hel pair 46 | Move the 2° operand from memory to reg B. Dore BS | compare B with A. ee a Jump to auddress 2001811 iF there is no 2007 barry. {2008 I Lower order of 200011. 1 Microprocessor Lab Higher order of 200BH, ‘MOV AB 78 __| Move largest trom reg. B to reg. A. INX. H 23 Increment H-L pair. Mov | M.A 77 | Move the result from reg. Ato memory. Halt. SETI II IIIT Microprocessor Lab Experiment No. 9 Write a program to determine sinall number of wo &-bit numbers stored in successive memory. locations, "Apparatus required: 8085 microprocessor kit, Power suppl Start the microprocessor. ‘Load H-L. pair with address of first operand’s memory location. ‘Move the first operand from memory to accumulator, Increment H-L pair to point to next memory location. | Tnorement H-L pair to point. to next memory location. ‘the second operand from memory to register B. "Load H-L pait with address of first operand’s memory location. nt H-L pair to point to xt memory location. ! Compare B with A. | Move data from register B to accumulator. Increment H-L Remark Load HE pair with address 300011 Lower-order of 3000H, Higher-order of 30001. s Move the Ist operand from memory cee Increment H-L pair. Move the 2” operand from memory toree, B. Jump to address 200011 if ther eevee Microprocessor Lak [2008 OB [Lowerorder of 2008H oa 20 | Higher-order of 2008 2004 MOV 78 | Move largest from rep. Bto reg. A, 2008 INX 23 [Increment H-L pair. 200C MOV 77 | Move the result from reg. Ato nemo. 200D HLT 76 Halt. Before Execution: 3000H: 25H 3001H: 15H er Execution: 3002H: 15 ' Microprocessor Lab Experiment No. 10 Aim: Write a program to determine largest number among array of 8-bit numbers stored in successive memory locations. Apparatus required: 8085 microprocessor kit, Power supply, ‘Start the microprocessor. 2 ‘Load H-L pair with address of first operand’s memory location. Move counter from memory to register C. ‘Move the first operand fiom memory to accumulator Increment H-L pair to point to next memory location. Load H-L pair with address of -counter's memory location. Move counter from memory to Increment H-L pair o point to first memory location the first number from smory to register A. Microprocessor Lab Decrement Counter C. Move data from register B to aceumulator. ves Microprocessor Lab Program: ‘Address | Mnemonics | Operand | Opcode | Remark 2000 LXI H,3000H 21 Load H-L pair with address 3000H, 2001 00 | Lower order of 3000H. 2002 30 Higher order of 3000H. 2003 MOV CM 4E “Move counter from memory to reg. C. 2004 INX H 23 Increment H-L pair. 203 | Mov | AM 7E | Move first number from memory 0 reg. A. 2006. DCR c 0b Decrement counter. 2007, INX H ed) ‘Compare B with A. | 2008 MOV BLM 46 Move the next number from memory to reg. Bs 2 CMP B BS Compare B with A 2} INC | 200EH D2 Jump to address 200E1 if thers is no earry- : [06 | Lower order of 200EH. 20 Hi order of 200EH. MOVA: | 78 | Move largest from reg, B to eg. A. c 0D. Decrement counter. 2007H | C2 | Jump toaddress 2007H if counter is not zero. 07 ‘Lower order of 2007H. 20 Higher order of 2007H. i 23__| Increment HL pait. 7 Move the result from reg. A to memory. i 76 Halt After Execution: ql 3006H: F2H

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy