You are on page 1of 87

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

LOYOLA ICAM COLLEGE OF ENGINEERING AND TECHNOLOGY (LICET)

DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING

CS 2259 PROCESSOR & CONTROLLER LAB

PREPARED BY
APPROVED BY

Mr. KARTHIK. S Ms. Nisha Ms. PADMAVATHY JAWAHAR

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

ANNAUNIVERSITY, CHENNAI SYLLABUS R2008

LIST OF EXPERIMENTS

1. Programming with 8085 2. Programming with 8086-experiments including BIOS/DOS calls: Keyboard control, Display, File Manipulation. 3. Interfacing 8085/8086 with 8255, 8253. 4. Interfacing 8085/8086 with 8279, 8251. 5. 8051 Microcontroller based experiments for Control Applications. 6. Mini- Project

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

CONTENTS CYCLE I Exp No 1 2 3 Title Programs for 8-bit arithmetic operations using 8085 Programs for 16-bit arithmetic operations using 8085 Programs for sorting and searching operations using 8085 4 5 6 Programs for conversion using 8085 Programs for 16-bit arithmetic operations using 8086 Programs for sorting and searching operations using 8086 7 Programs for string manipulation operations using 8086 Page

CYCLE II Exp No 1 2 Title Interfacing ADC and DAC Parallel communication between two microprocessor kits using Mode 1 and Mode2 of 8255. 3 4 5 Interfacing and programming 8279 Interfacing and programming 8251 and 8253 Programming using arithmetic, logical and bit manipulation instructions of 8051 microcontroller. 6 Interfacing and programming of stepper motor control Page

LAB Rules:

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

DOs
Wear the lab coat & ID card Come with observation and record note book Maintain silence inside the laboratory Keep observation valuated and updated

DONTs
Using mobile phones Bringing the bags inside the laboratory Scribbling on the desk Coming late to the laboratory

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

CYCLE -1

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Exp No : 1-A Date: 8 BIT ADDITION USING 8085

Aim: To Add two 8- bit numbers using 8085 Components Required: S. No 1 Procedure:
Load the first data from the memory to accumulator and move into B Register. Load the second data from memory to accumulator. Clear C register. Add the content of B register to accumulator. Check for carry, if carry 1 go to step 1 else if carry 0 go to step 7. Store the sum to memory. Move the carry to accumulator and store in memory.

Component 8085 microprocessor training kit

Quantity 1

Program:
Address 4100 4103 4104 4107 4109 410A 410D 410E 4111 4112 4115 AHEAD Label Mnemonics LDA 4200H MOV B,A LDA 4201H MVI C00H ADD B JNC AHEAD INR C STA 4202H MOV A,C STA 4203H HLT Op-code 3A 00 42 47 3A 01 42 0E 00 80 D2 0E 41 0C 32 02 42 79 32 03 42 76 Comments Get first data in A Move A to B Get second data in A Clear C register to account for carry Get Sum in A reg If CY=0 go to AHEAD If CY=1 increment C reg Store the sum in memory Move C to A Store the carry in memory Terminate the program

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Output Table: Input Address Data Address Output Data

Rough Work & Manual Calculations

Result: Thus the program for 8 bit addition was implemented and verified.

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Exp No : 1-B Date: Aim: To Subtract two 8- bit numbers using 8085 Components Required: S. No 1 Component 8085 microprocessor training kit Quantity 1 8 BIT ADDITION USING 8085

Procedure:
Load the subtrahend from the memory to accumulator and move into B Register. Load the minuend from memory to accumulator. Clear C register to account for sign of the result. Subtract the content of B register from the content of accumulator. Check for carry, if carry 1 go to step 6 else if carry 0 go to step 7. Increment C register, complement the accumulator and add 01H. Store the difference to memory. Move the content of C register to accumulator and store in memory

Program:
Address 4100 4103 4104 4107 4109 410A 410D 410E 410F 4111 AHEAD Label Mnemonics LDA 4200H MOV B,A LDA 4201H MVI C00H SUB B JNC AHEAD INR C CMA ADI 10H STA 4202H Op-code 3A 00 42 47 3A 01 42 0E 00 80 D2 11 41 0C 2F C6 01 32 02 42 Comments Get first data in A Move A to B Get second data in A Clear C register to account for carry Get Sum in A reg If CY=0 go to AHEAD If CY=1 increment C reg Get 2s complement of difference Result in A reg Store the sum in memory

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

4114 4115 4115

MOV A,C STA 4203H HLT

79 32 03 42 76

Move C to A Store the carry in memory Terminate the program

Output Table: Input Address Data Address Output Data

Rough Work & Manual Calculations

Result: Thus the program for 8 bit subtraction was implemented and verified.

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Exp No : 1-C Date: Aim: To Multiply two 8- bit numbers using 8085 Components Required: S. No 1 Component 8085 microprocessor training kit Quantity 1 8 BIT MULTIPLICATION USING 8085

Procedure:
Load the address of the first data in HL pair. Clear C register for carry. Clear the accumulator. Move the first data to B register. Increment the pointer. Move the second data to D register. Add the content of D register to accumulator. Check for carry, If carry=1 go to step 9 else carry=0 go to step 10. Increment the C register. Decrement the B register. Check whether count has reached zero. If ZF=0, repeat steps7 through 11 or of ZF=1

go to next step. Program:


Address 4100 4103 4105 4106 4107 4108 4109 REPT Label Mnemonics LXI 4200H MVI C00H XRA A MOV B,M INX H MOV D,M ADD D Op-code 21 00 42 0E, 00 AF 46 23 56 82 Comments Set pointer for data Clear C to account for overflow Clear accumulator Get first data in B reg Increment Memory pointer Get second data in D reg reg to accumulator

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

410A 410D 410E 410F 4112 4113 4114 4115 4116 AHEAD

JNC AHEAD INR C DCR B JNZ REPT INX H MOV M,A INX H MOV M,C HLT

D2 0E 41 0C 05 C2 09 41 23 77 23 71 76

Jump on no carry If CY=1 increment C reg Store the sum in memory Repeat addition until ZF=1 Store the carry in memory Store lower byte of product in memory

Store higher byte of product in memory Stop

Output Table: Input Address Data Address Output Data

Rough Work & Manual Calculations

Result: Thus the program for 8 bit multiplication was implemented and verified.

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Exp No : 1-D Date: Aim: To Divide two 8- bit numbers using 8085 Components Required: S. No 1 Component 8085 microprocessor training kit Quantity 1 8 BIT DIVISION USING 8085

Procedure:

Load the divisor in accumulator and move it to B reg. Load the dividend in accumulator. Clear C-Register to account for quotient. Check whether divisor is less than dividend. If divisor is less than dividend, go to step 8 otherwise go to next step. Subtract the content of B reg from accumulator. Increment the content of C reg, go to step 4. Store the content of accumulator in memory. Move the content of C reg to accumulator and store in memory.

Program:
Address 4100 4103 4104 4107 4109 410A 410D 410E 410F REPT Label Mnemonics LDA 4200H MOV B,A LDA 4201H MVI C00H AGAIN CMP B JC STORE SUB B INR C JMP AGAIN Op-code 3A 00 42 47 3A 01 42 0E 00 B8 DA 41 90 0C C3 09 41 Comments Set pointer for data Get the divisor in B reg Get the dividend in A reg Clear C reg for Quotient Increment Memory pointer 12 If divisor is less than dividend go to STORE Subtract divisor from dividend Increment quotient by 1 for each subtraction

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

4112 4116 4119

STORE 4203H STA 4202H HLT

STA 32 03 42 32 02 42 76

Store the remainder in memory Store the quotient in memory

Output Table: Input Address Data Address Output Data

Rough Work & Manual Calculations

Result: Thus the program for 8 bit division was implemented and verified.

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Exp No : 1-E Date: Aim: To add two BCD numbers using 8085 Components Required: S. No 1 Procedure: Component 8085 microprocessor training kit Quantity 1 BCD ADDITION USING 8085

Program: Address

Load Data 1 into accumulator. Move Accumulator contents to Register B Load Data 2 into accumulator Add the content of SP pair to HL pair. Clear register C to account for Carry Add Data 2 to Data 1 and store in Accumulator Convert the accumulator value to BCD value If carry==0 , go to step 8 else increment carry. Store Accumulator content (Result) to memory Move contents of Register C to Accumulator Terminate the program.
Label Mnemonics Op-code Comments

4100 4103 4104 4107 4108 410B 410E 410F 4112 4113 4114 4115 AHEAD

LDA 4200 MOV B,A LDA 4201 MVI C, 00 ADD B DAA JNC Ahead INR C STA 4203
MOV A,C

STA 4204 HLT

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Output Table: Input Address Data Address Output Data

Rough Work & Manual Calculations

Result: Thus the program for 16-bit Multiplication was implemented and verified successfully.

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Exp No : 2-A Date: Aim: To add two 16- bit numbers using 8085 Components Required: S. No 1 Procedure: Load the first data in HL register pair. Move the first data to DE reg pair. Load the second data in HL reg pair. Clear A reg for carry. Add the content of DE pair to HL pair. Check for carry. If CARRY=1, go to step 7 or if CARRY=0, go to step 8. Increment A reg to account for carry. Store the sum and carry in memory. Terminate the program. Component 8085 microprocessor training kit Quantity 1 16 BIT ADDITION USING 8085

Program: Address 4100 4103 4104 4107 4108 4109 410C 410D 4110 4113 AHEAD Label Mnemonics LHLD 4200H XCHG LHLD 4202H XRA A DAD D JNC AHEAD INR A SHLD 4202H STA 4206H HLT Op-code 2A 00 42 EB 2A 02 42 AE 19 D2 0D 41 3C 22 04 42 32 06 42 76 Comments Get first data in HL pair Save first data in DE pair Get second data in HL pair Clear A reg for carry Get the sum in HL pair If CY=0, goto AHEAD If CY=1, increment A reg Store the sum in memory Store the carry in memory Terminate the program

Output Table:

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Input Address Data Address

Output Data

Rough Work & Manual Calculations

Result: Thus the program for 16-bit Addition was implemented and verified successfully.

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Exp No : 2-B Date: Aim: To subtract two 16- bit numbers using 8085 Components Required: S. No 1 Procedure:
Load the lower byte of subtrahend in accumulator from memory and move it to the B reg. Load the lower byte of minuend in accumulator from memory. Subtract the content of B reg from the content of Accumulator. Store the lower byte of result in memory. Load the higher byte of subtrahend in accumulator from memory and move it to B reg. Load the higher byte of minuend in accumulator from memory. Subtract the content of B reg and the carry from the content of Accumulator. Store the higher byte of result in memory. Terminate the program. Label Mnemonics Op-code Comments Load the lower byte in accumulator Move the lower byte to B reg

16 BIT SUBTRACTION USING 8085

Component 8085 microprocessor training kit

Quantity 1

Address 4100 4103 4104 4107 4108

LDA 4202H MOV B,A LDA 4200H SUB B STA 4204H LDA 4203H MOV B,A LDA 4201H SBB B STA 4205H HLT

3A 02 42 47 3A 00 42 90 32 04 42 3A 03 42 47 3A 01 42 98 32 05 42 76

Get lower byte of minuend in A reg Get difference of low bytes in A reg Store the result in memory
If CY=0, goto AHEAD

410B 410E 410F 4112 4113 4114


Output Table:

Get higher byte of subtrahend in B reg Get higher byte of minuend in A reg Get difference of high bytes in A reg Store the result in memory Stop

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Input Address Data Address

Output Data

Rough Work & Manual Calculations

Result: Thus the program for 16-bit Subtraction was implemented and verified successfully.

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Exp No : 2-C Date: Aim: To multiple two 16- bit numbers using 8085 Components Required: S. No 1 Procedure: Component 8085 microprocessor training kit Quantity 1 16 BIT MULTIPLICATION USING 8085

Program: Address

Load the first data in HL register pair and move to SP. Load the second data in HL register pair and move to DE. Clear HL pair and clear BC pair for overflow. Add the content of SP pair to HL pair. Check for carry. If CARRY=1, go to step 6 or if CARRY=0, go to step 7. Increment BC pair. Decrement the count. Check whether count has reached zero. To check for zero of the count, move the content of E reg to A reg and logically or with D reg. Check the zero flag if ZF=0 repeat step 5 through 11 or if ZF=1 goto next step. Store the content of HL in memory. Move the content of C to L and B to H and store HL in memory. Terminate the program.
Label Mnemonics Op-code Comments

4100 4103 4104 4107 4108 410B 410E 410F 4112 4113 AHEAD NEXT

LHLD 4200H SPHL LHLD 4202H XCHG LXIH 0000H LXIB 0000H DAD SP

2A 00 42 Get first data in HL pair F9 Save first data in SP pair

2A 02 42 Get second data in HL pair EB 21 00 00 01 00 00 39 Save Second data in DE pair Clear HL pair (initial sum=0) Clear BC pair to account overflow Add the content of SP to sum(HL)

JNC AHEAD 02 13 41 INX B 03 1B If CY=1, increment BC pair. DCX D

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

4114 4115 4116 4119 411C 411D 411E 4121


Output Table:

MOV A,E ORA D JNZ NEXT

7B B2 C2 41

Check for zero in DE pair this is done logically OR D and E 0E Repeat addition until count is zero Store lower 16 bit of product in memory

SHLD 4204H 22 04 42 MOV L,C MOV H,B 69 60

SHLD 4206H 22 06 42 HLT 76

Store upper 16 bit of product in memory Stop

Input Address Data Address

Output Data

Rough Work & Manual Calculations

Result: Thus the program for 16-bit Multiplication was implemented and verified successfully.

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Exp No : 2-D Date: Aim: To divide two 16- bit numbers using 8085 Components Required: S. No 1 Procedure: Get the dividend and divisor. Initialize the register for quotient. Repeatedly subtract divisor from dividend till dividend becomes less than divisor. Count the number of subtraction which equals the quotient. Store the result in memory. Component 8085 microprocessor training kit Quantity 1 16 BIT DIVISION USING 8085

Program:

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Output Table: Input Address Data Address Output Data

Rough Work & Manual Calculations

Result: Thus the program for 16-bit Multiplication was implemented and verified successfully.

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Exp No : 3-A Date: Aim: To sort an array of data in ascending order Components Required: S. No 1 Procedure: Load the count value from memory to A register and save it in B register. Decrement B register. Set HL pair as data array address pointer. Set C register as counter for N-1 comparison. Load the data of the array in accumulator using the data address pointer. Increment the HL pair. Compare the data pointed by HL with accumulator. If carry flag is set then goto step 10 else goto next step Exchange the content of memory pointed by HL and accumulator. Decrement C reg. If zero flag is reset goto step 6 else goto next step. Decrement B reg. If zero flag is reset goto step 3 else goto next step. Terminate the program. Component 8085 microprocessor training kit Quantity 1 ASCENDING ORDER USING 8085

Program: Address Label Mnemonics Opcode Comments

4100
4103

LDA 4200H MOV B,A DCR B LOOP2 LXIH 4200H MOV C,M DCR C INX H LOOP1 MOV A,M

3A 00 load the count value in A reg 42 47 05 21 00 Set pointer for array 42 4E 0D 23 7E Increment pointer Get one data of array in A Set count for N-1 comparison Set count for N-1 repetition

4104 4105 4108 4109 410A 410B

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

410C 410D 410E 4111

INX H CMP M JC AHEAD MOV D,M

23 BE Compare next data with A reg

DA 16 If content of A is less than memory then goto AHEAD 41 56 If the content A is greater than the content of memory, then exchange content of memory pointed by HL and previous location

4112 4113 4114 4115 4116 4117 411A 411B 411E AHEAD

MOV M,A DCX H MOV M,D INX H DCR C JNZ LOOP1 DCR B JNZ LOOP2 HLT

77 2B 72 23 0D C2 0B Repeat comparison until count is zero 41 05 C2 05 Repeat N-1 comparison until B count is zero. 41 76 Terminate the program.

Output Table:

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Input Address Data Address

Output Data

Rough Work & Manual Calculations

Result: Thus the program for ascending order was implemented and verified successfully.

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Exp No : 3-B Date: Aim: To sort an array of data in ascending order Components Required: S. No 1 Procedure: Load the count value from memory to A register and save it in B register. Decrement B register. Set HL pair as data array address pointer. Set C register as counter for N-1 comparison. Load the data of the array in accumulator using the data address pointer. Increment the HL pair. Compare the data pointed by HL with accumulator. If carry flag is reset then goto step 10 else goto next step Exchange the content of memory pointed by HL and accumulator. Decrement C reg. If zero flag is reset goto step 6 else goto next step. Decrement B reg. If zero flag is reset goto step 3 else goto next step. Terminate the program. Component 8085 microprocessor training kit Quantity 1 DESCENDING ORDER USING 8085

Program:

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Output Table: Input Address Data Address Output Data

Rough Work & Manual Calculations

Result: Thus the program for descending order was implemented and verified successfully.

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Exp No : 3-C Date: Aim: To search the smallest data in an array using 8085 microprocessor Components Required: S. No 1 Procedure: Load the address first element of array in HL reg pair Decrement B register. Move the count of B reg. Increment the pointer. Get the first data in A reg. Decrement the count. Increment the pointer. Compare the content of HL pair with A reg, If CY=1, goto step 10 else to step 9 Move the content of memory address by HL to A reg. Decrement the count. 10 If ZF=0, go to step 6 or if ZF=1 go to next step. Store the smallest data in memory. Terminate the program. Program: Component 8085 microprocessor training kit Quantity 1 SEARCHING - SMALLEST DATA

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Output Table: Input Address Data Address Output Data

Rough Work & Manual Calculations

Result: Thus the program for searching the smallest data was implemented and verified successfully.

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Exp No : 3-C Date: Aim: To search the largest data in an array using 8085 microprocessor Components Required: S. No 1 Procedure: Load the address first element of array in HL reg pair. Move the count of B reg. Increment the pointer. Get the first data in A reg. Decrement the count. Increment the pointer. Compare the counter of memory address by HL pair carry=0, goto step 10 else to step 9 with that of A move the content of HL to A reg. Decrement the count. If ZF=0, go to step 6 or if ZF=1 go to next step. Go to large data. Terminate the program. Program: Component 8085 microprocessor training kit Quantity 1 SEARCHING - LARGEST DATA

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Output Table: Input Address Data Address Output Data

Rough Work & Manual Calculations

Result: Thus the program for searching the largest data was implemented and verified successfully.

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING Exp No : 4-A Date: Aim: To convert 2 digit BCD to binary number using 8085 microprocessor Components Required: S. No 1 Procedure:
Get the BCD data in A reg and save in E reg. Mark the lowest nibble (units) of the BCD data in A reg. Rotate the upper nibble to lower nibble position and save in B reg. Clear the accumulator. Move 0AH to C reg. Decrement C reg. If ZF=0,go to step 6 else ZF=1, go to next step. Save the product in B reg. Get the BCD data in A reg from E reg and mark the upper nibble. Add the content of A reg to product (B reg). Store the binary value(A reg). Terminate the program.

CONVERSION OF 2-DIGIT BCD TO BINARY NUMBER

Component 8085 microprocessor training kit

Quantity 1

Program:

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Output Table: Input Address Data Address Output Data

Rough Work & Manual Calculations

Result: Thus the program to convert 2 digit BCD to binary was implemented and verified successfully.

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Exp No : 4-B Date: Aim: To convert binary number to BCD using 8085 microprocessor Components Required: S. No 1 Procedure:
Clear D and E reg to account for hundreds and tens. Load the binary data in A reg. Compare A reg with 64th if carry flag is set go to step 7 else go to next step. Subtract 64th from A reg. Increment E reg (hundreds) go to step 3 Compare the A reg with 0AH if carry flag is set go to step 1 else go to next step. Subtract 0AH from A reg. 8 Increment D reg(tens) go to step 7. Combine the terms to form 8 bit result. Save the tens and hundred in memory. Terminate the program.

CONVERSION OF 2-DIGIT BCD TO BINARY NUMBER

Component 8085 microprocessor training kit

Quantity 1

Program:

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Output Table: Input Address Data Address Output Data

Rough Work & Manual Calculations

Result: Thus the program to convert 2 digit BCD to binary was implemented and verified successfully.

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Exp No : 4-C Date: Aim: To convert binary number to ASCII code using 8085 microprocessor Components Required: S. No 1 Procedure:
Load the given data in A reg and move to B reg. Mark the upper nibble of binary (Hexa) data in A reg. Call subroutine code to get ASCII code of the lower nibble and store in memory. Move B reg to A reg and mark the lower nibble. Rotate the upper nibble position. Call subroutine code to get the ASCII code of upper nibble and store in memory. Terminate the program. CONVERSION OF 8-BIT BINARY NUMBER TO ASCII CODE

Component 8085 microprocessor training kit

Quantity 1

Subroutine: Compare the content of A reg with 0AH. If CY=1 go to step 4, If CY=0 go to next step. Add 07H to A reg. Add 30H to A reg. Return to main program.

Program:

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Output Table: Input Address Data Address Output Data

Rough Work & Manual Calculations

Result: Thus the program to convert binary into ASCII code was implemented and verified successfully.

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Exp No : 4-D Date: Aim: To convert ASCII code to binary value using 8085 microprocessor Components Required: S. No 1 Procedure: Set HL pair as pointer for ASCII array. Set D reg as counter for number of data in the array. Set BC pair as pointer for binary(hexa) array. Increment HL pair and move a data of ASCII array A reg. Call subroutine BIN to find the binary (hexa) value. The binary (hexa) value in A reg is stored in memory. Increment BC pair. Decrement D reg if ZF=0 then goto step 4, If ZF=1 then stop. Terminate the program. Component 8085 microprocessor training kit Quantity 1
CONVERSION OF ASCII CODE TO BINARY VALUE

Subroutine: Subtract 30H from A reg. Compare the content of A reg with 0AH. If CY=1 go to step 4, If CY=0 go to next step. Subtract 07H from A reg. 5 Return to main program.
Rough Work & Manual Calculations

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Program:

Output Table: Input Address Data Address Output Data

Result: Thus the program to convert ASCII into binary was implemented and verified successfully.

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Exp No : 5-A Date: Aim: To write an assembly language program to add two 16-bit numbers using 8086. Components Required: S. No 1 Procedure: Data are brought to 16 bit register. The contents of the register are added and store the carry and sum. Data are added in accumulator. Add data from 1100 to 1102 Result will be stored in address data 1200. Terminate the program. Program: Component 8086 microprocessor training kit Quantity 1 16 BIT ADDITION USING 8086

Output Table: Input Address Data Address Output Data

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Rough Work & Manual Calculations

Result: Thus the program for 16-bit addition was implemented using 8086 and verified successfully.

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Exp No : 5-B Date: Aim: To write an assembly language program to subtract two 16-bit numbers using 8086. Components Required: S. No 1 Procedure: Data are brought to 16 bit register. Initialize the address register. Data are added in accumulator. Subtract data from 1100 & 1102 Result will be stored in address 1200. Terminate the program. Component 8086 microprocessor training kit Quantity 1 16 BIT SUBTRACTION USING 8086

Program:

Output Table: Input Address Data Address Output Data

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Rough Work & Manual Calculations

Result: Thus the program for 16-bit subtraction was implemented using 8086 and verified successfully.

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Exp No : 5-C Date: Aim: To write an assembly language program to multiply two 16-bit numbers using 8086. Components Required: S. No 1 Procedure: Data are brought to 16 bit register. Initialize the address register. The value of AX reg is moved since it is the highest order. Multiply the value of address data. Result will be stored in the given address. Stop the program Component 8086 microprocessor training kit Quantity 1 16 BIT MULTIPLICATION USING 8086

Program:

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Output Table: Input Address Data Address Output Data

Rough Work & Manual Calculations

Result: Thus the program for 16-bit multiplication was implemented using 8086 and verified successfully.

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Exp No : 5-D Date: Aim: To write an assembly language program to divide two 16-bit numbers using 8086. Components Required: S. No 1 Procedure: Get dividend into accumulator from memory Get divisor into bx register Divide ax by bx Store quotient form accumulator into memory Store remainder from dx into memory Halt Component 8086 microprocessor training kit Quantity 1 16 BIT DIVISION USING 8086

Program:
Address 1000 1004 4108 4109 410D 4111 Label Mnemonics Op-code Comments

MOV AX, [2000H] MOV BX, [2002H] DIV BX MOV [3000], AX MOV [3002], DX HLT

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Output Table: Input Address Data Address Output Data

Rough Work & Manual Calculations

Result: Thus the program for 16-bit division was implemented using 8086 and verified successfully.

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Exp No : 6-A Date: Aim: To write an assembly language program to search a byte in an array using 8086. Components Required: S. No 1 Procedure: Load starting address of array in to SI reg. and initialize DI reg for result. Load the byte to be searched in DL reg. & initialize BH reg for position as 01 Get the 1st element into Accumulator AGAIN : Compare Accumulator with DL reg Check zero flag, if set go to AVAIL Update SI and Increment BL Get next element into Accumulator and compare with EOA If not zero, go to AGAIN. Initialize CX reg to zero Store result for Not Available and go to END AVAIL: Get word for available in to BL reg. Store position, address and status of search. END: Halt
Label Mnemonics Op-code Comments

SEARCHING FOR A BYTE IN AN ARRAY USING 8086

Component 8086 microprocessor training kit

Quantity 1

Address 1000 1004

MOV SI, 2000H MOV DI, 3000H MOV DL, [DI] MOV BH, 01 MOV AL, [SI]
AGAIN

CMP AL, DL JZ AVAIL INC SI

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

INC BL MOV AL, [SI] CMP AL, E0 JNZ AGAIN NOTAVL MOV CX, 0000H MOV [DI+1], CX MOV [DI+3], CX JMP END AVAIL MOV BL, FF MOV [DI+1], BX MOV [DI+3], SI END HLT

Output Table: Input Address Data Address Output Data

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Rough Work & Manual Calculations

Result: Thus the program for searching a byte in an array was implemented using 8086 and verified successfully.

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Exp No : 6-A ASCENDING/DESCENDING ORDER USING 8086 Date: Aim: To sort an array of data in ascending/descending order using 8086 Components Required: S. No 1 Procedure: Load SI reg with pointer to array Load array length to CL & CH for two counters (CL for repetitions & CH for comparisons) REPEAT : Get an element into accumulator NEXT: Compare with next element Check carry flag, if set go to SKIP Swap elements of array SKIP: Decrement CH and if not zero go to NEXT Decrement CL , if not zero go to REPEAT Halt
Label Mnemonics Op-code Comments

Component 8086 microprocessor training kit

Quantity 1

Address 1000 1004

MOV SI, 1500H MOV CL, [SI] DEC CL


REPEAT

MOV SI, 1500H MOV CH, [SI] DEC CH INC SI

NEXT

MOV AL, [SI]

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

INC SI CMP AL, [SI] JC SKIP/JNC SKIP XCHG AL, [SI] XCHG AL, [SI - 1]
SKIP

DEC CH JNZ NEXT DEC CL JNZ REPEAT INT 3

Output Table: Input Address Data Address Output Data

Rough Work & Manual Calculations

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Result: Thus the program to sort array of data in ascending and descending order was implemented using 8086 and verified successfully.

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Exp No : 7-A Date: Aim:

STRING MANIPULATION
BLOCK DATA TRANSFER USING 8086

To write an assembly language program to transfer a block of data using 8086. Components Required: S. No 1 Procedure: Initialize DS & ES registers Load source and destination locations to index registers. Load the block size in counter reg. Clear Direction flag for Auto- incrementing mode Copy contents from source to destination address until counter becomes zero. Halt.
Label Mnemonics Op-code Comments

Component 8086 microprocessor training kit

Quantity 1

Program:
Address 1000 1004

MOV AX, 0000H MOV DS, AX MOV ES, AX MOV SI, 2001H MOV DI, 3000H MOV CX ,[2000H] CLD
TRANSFER

MOVSB LOOP TRANSFER HLT

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Output Table: Input Address Data Address Output Data

Rough Work & Manual Calculations

Result: Thus the program to transfer a block of data using 8086 was implemented using 8086 and verified successfully.

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Exp No : 7-B Date: Aim:

STRING MANIPULATION
CODE CONVERSION USING 8086

To write an assembly language program to convert decimal number to hexadecimal number using 8086. Components Required: S. No 1 Procedure: Initialize BX reg with address of translation table Load source and destination address in SI & DI reg. Clear direction flag Load counter with length Get first element into AL , check whether the input is valid If invalid go to end Else translate code from table Store code Loop until counter becomes zero Halt Component 8086 microprocessor training kit Quantity 1

Program:
Address 1000 1004 Label Mnemonics Op-code Comments

MOV BX, 1200H MOV SI, 2000H MOV DI, 3000H CLD

MOV CX , Length
CONVERT

LODSB CMP AL, 09H

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

JA INVALID XLAT STOSB LOOP CONVERT INT 3


INVALID

MOV AL, 00 MOV [DI], AL HLT

Output Table: Input Address Data Address Output Data

Rough Work & Manual Calculations

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Result: Thus the program for code conversion using 8086 was implemented using 8086 and verified successfully.

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Exp No : 7-C Date: Aim:

STRING MANIPULATION
FIND & REPLACE USING 8086

To write an assembly language program to find and replace a data using 8086. Components Required: S. No 1 Procedure: Initialize DS & ES registers Load destination index registers. With address of string Load counter reg. Load AL with the string to be found Clear Direction flag for Auto- incrementing mode Scan for the string If found replace with the other string in AH Continue until counter cleared Halt Component 8086 microprocessor training kit Quantity 1

Program:
Address 1000 1004 Label Mnemonics Op-code Comments

MOV AX, 0000H MOV DS, AX MOV ES, AX MOV AL, [2001H] MOV DI, 3000H MOV CX ,[2000H] CLD
LOOP 1

REPNZ SCASB JNZ DONE

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

MOV AH, [2002H] MOV [DI 1], AH JMP LOOP1


DONE

HLT

Output Table: Input Address Data Address Output Data

Rough Work & Manual Calculations

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Result:

Thus the program to find and replace a data using 8086 was implemented using 8086 and verified successfully.

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

END OF CYCLE I

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

CYCLE -2

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING Exp No : 1-A Date: Aim: To generate the square wave at the DAC output using 8085. Components Required: S. No 1 2 Procedure: Load the initial value (00) to Accumulator and move it to DAC. Call the delay program. Load the final value (FF) to accumulator and move it to DAC. Call the delay program. Repeat the steps 2 and 4 Terminate the program. Component 8085 microprocessor training kit DAC Interface card Quantity 1 2 DAC INTERFACING SQUARE WAVE GENERATION

Program:

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Rough Work & Manual Calculations

Result:

Thus the program for square wave generation was executed and verified successfully.

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Exp No : 1-B Date: Aim:

DAC INTERFACING - SAWTOOTH WAVE GENERATION

To generate saw tooth waveform at the DAC output using 8085. Components Required: S. No 1 2 Procedure: Program: Load the initial value (00) to Accumulator and move it to DAC. Move the accumulator content of DAC. Increment the accumulator content by 1. Repeat the steps 2 and 3 Terminate the program. Component 8085 microprocessor training kit DAC interface Card Quantity 1 1

Output:

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Rough Work & Manual Calculations

Result:

Thus the program for saw tooth waveform generation was executed and verified successfully.

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Exp No : 1-C Date: Aim:

DAC INTERFACING - TRIANGULAR WAVE GENERATION

To generate triangular waveform at the DAC output using 8085. Components Required: S. No 1 2 Procedure: Program: Load the initial value (00) to Accumulator and move it to DAC. Move the accumulator content of DAC. Increment the accumulator content by 1. If accumulator content is Zero, proceed to next step else goto step 3. Load the value (FF) to accumulator. Move the accumulator content of DAC. Decrement the accumulator content by 1. If Accumulator content is zero goto to step 2 else goto step 7 Terminate the program. Component 8085 microprocessor training kit DAC interface Card Quantity 1 1

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Output:

Rough Work & Manual Calculations

Result:

Thus the program for triangular waveform generation was executed and verified successfully.

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Exp No : 1-D Date: Aim:

ADC INTERFACING

To initialize the analog to digital conversion process by means of software and to execute the program which converts the analog input at channel and displays the output through the LED. Components Required: S. No 1 2 Procedure: Move immediately the value of accumulator output. Move immediately as another value of accumulator. EX-OR the value for 3 times. Initialize A reg as 00. Get the output at 00. Terminate the program. Component 8085 microprocessor training kit DAC interface Card Quantity 1 1

Program:

Output:

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Rough Work & Manual Calculations

Result: Thus the ADC interfacing program was executed and verified successfully.

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Exp No : 2 Date: Aim:

8255 INTERFACING USING MODE 0 , 1, 2

To initialize port A as the input port A and port B as input in mode 0 to input the data at port A as set by input switches and the output of some data to glow the LED automatically. Components Required: S. No 1 2 MODE 0: Procedure: Start the program execution. Initialize the data A as input. Input the data at port A. Output the data at port B. Terminate the program. Component 8085 microprocessor training kit 8255 interface card Quantity 1 1

Program:

Output:

MODE 1: Procedure: Start the program execution. Initialize the data A as input. Input the data at port A. Output the data at processor.

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Terminate the program.

Program:

Output:

MODE 2:
Procedure: Start the program execution. Initialize the input through processor. Input the data and processor. Output the data at port C. Terminate the program.

Program:

Output:

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Rough Work & Manual Calculations

Result: Thus the interfacing 8255 using Mode 0, 1, 2 was executed and verified successfully.

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Exp No : 3 Date: Aim:

KEYBOARD AND DISPLAY INTERFACING USING 8279

To write an assembly language program to display the rolling message HELP US in the display. Components Required: S. No 1 2 Procedure:
Start the program execution. Initialize the pointer for array. Initialize the counter for P register. Set mode and clear display and increment display counter. The input data given is displayed. The data is moved to the memory. Terminate the program.

Component 8085 microprocessor training kit 8279 interface card

Quantity 1 1

Program:

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Rough Work & Manual Calculations

Result: Thus the interfacing of 8279 IC with 8085 was executed and verified successfully.

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Exp No : 4 Date: Aim:

INTERFACING 8253/8251 WITH 8085

To interface 8253 Interface board to 8085 p and verify the operation of 8253in six different modes. Components Required: S. No 1 2 Component 8051 microcontroller training kit 8253/8251 interface Quantity 1 1

MODE 0 SIMPLE I/O MODE: The output will be initially low after mode set operations. After loading the counter, the output will be remaining low while counting and on terminal count; the output will become high, until reloaded again. Let us set the channel 0 in mode 0. Connect the CLK 0 to the debounce circuit by changing the jumper J3 and then execute the following program. It is observed in CRO that the output of Channel 0 is initially LOW. After giving six clock pulses, the output goes HIGH. Address Label Opcode Mnemonics 4100 START: MVI A, 90 4102 OUT C6 4104 IN C0 4106 OUT C2 4108 STA 4200 410B HLT MODE1 STROBED I/O MODE: After loading the counter, the output will remain low following the rising edge of the gate input. The output will go high on the terminal count. It is retriggerable; hence the output will remain low for the full count, after any rising edge of the gate input. Comments Initialize port A as Input and Port B as output. Send Mode Control word Read from Port A Display the data in port B Store the data read from Port A in 4200 Stop the program.

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

MODE 2 RATE GENERATOR: It is a simple divide by N counter. The output will be low for one period of the input clock. The period from one output pulse to the next equals the number of input counts in the count register. If the count register is reloaded between output pulses the present period will not be affected but the subsequent period will reflect the new value.

MODE 3 SQUARE WAVE GENERATOR: It is similar to Mode 2 except that the output will remain high until one half of count and go low for the other half for even number count. If the count is odd, the output will be high for (count + 1)/2 counts. This mode is used of generating Baud rate for 8251A (USART). Set the jumper, so that the clock 0 of 8253 is given a square wave of frequency 1.5 MHz. This program divides this PCLK by 10 and thus the output at channel 0 is 150 KHz. Vary the frequency by varying the count. Here the maximum count is FFFF H. So, the square wave will remain high for 7FFF H counts and remain low for 7FFF H counts. Thus with the input clock frequency of 1.5 MHz, which corresponds to a period of 0.067 microseconds, the resulting square wave has an ON time of 0.02184 microseconds and an OFF time of 0.02184 microseconds. To increase the time period of square wave, set the jumpers such that CLK2 of 8253 is connected to OUT 0. Using the above-mentioned program, output a square wave of frequency 150 KHz at channel 0. Now this is the clock to channel 2.

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

MODE 4: SOFTWARE TRIGGERED STROBE: The output is high after mode is set and also during counting. On terminal count, the output will go low for one clock period and becomes high again. This mode can be used for interrupt generation. The following program initializes channel 2 of 8253 in mode 4.

MODE 5 HARDWARE TRIGGERED STROBE: Counter starts counting after rising edge of trigger input and output goes low for one clock period when terminal count is reached. The counter is retriggerable. Example: The program that follows initializes channel 0 in mode 5 and also triggers Gate 0. Connect CLK 0 to debounce circuit. Execute the program. After giving Six clock pulses, you can see using CRO, the initially HIGH output goes LOW. The output ( OUT 0 pin) goes high on the next clock pulse.

Rough Work & Manual Calculations

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Result:

Thus the 8253 has been interfaced to 8085 p and six different modes of 8253 have been studied.

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Exp No : 5 Date: Aim:

8 BIT ARITHMETIC OPERATIONS USING 8051

To write an assembly language program to add two 8-bit numbers using 8051. Components Required: S. No 1 A. Addition: Procedure: C reg is to be cleared for carry. Get the data immediately. Add the two data. Store the result in the memory pointer. Terminate the program. Component 8051 microcontroller training kit Quantity 1

Program:

Output:

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

B. Subtraction: Procedure: C reg is to be cleared for carry. Get the data immediately. Subtract the two data. Store the result in the memory pointer. Terminate the program.

Program:

Output:

C. Multiplication:

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Output:

D. Division: Procedure: Get the data in A reg. Get the value to be divided in B reg. Divide the data. The Quotient is in A reg and remainder is in B reg. Terminate the program.

Program:

Output:

Result: Thus the program for 8-bit arithmetic operations using 8051 was executed and verified successfully.

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Exp No : 6 Date: Aim:

STEPPER MOTOR INTERFACING WITH 8051

To write an assembly language program to rotate the motor in forward and reverse direction using 8051. Components Required: S. No 1 2 3 Procedure: Start the program. The port and 8279 are initiated. Set the count for 4-stepping sequence. Call subroutine wait for 1ms. Decrement the counter. Count zero is checked then set the count for 4-stepping sequence else go to initializing ports. Terminate the program. Component 8051 microcontroller training kit Stepper motor interface Stepper motor Quantity 1 1 1

Program:

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Output:

Rough Work & Manual Calculations

LOYOLA ICAM COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Result: Thus the stepper motor was rotated in forward and reverse direction using 8051.