MP&MC Lab PDF

Download as pdf or txt
Download as pdf or txt
You are on page 1of 95

TAMILNADU COLLEGE OF ENGINEERING

PALANISAME RAVI NAGAR, KARUMATHAMPATTI,

COIMBATORE -641659

LABORATORY RECORD

NAME

CLASS

BRANCH

SUBJECT

UNIVERSITY REGISTER NO ROLL NO

This is to certify that this is a bonafide record of work done by the above student for the
Laboratory________________________________________ during the academic year / semester
_________________________

LAB - IN – CHARGE HEAD OF DEPARTMENT

Submitted for the Anna university practical examination held on _________________________

INTERNAL EXAMINER EXTERNAL EXAMINER


INDEX
Page
S.No Date Title of the Experiment Mark Sign
No
BASIC ARITHEMATIC OPERATION USING 8086
1 PROGRAM

2 BLOCK TRANSFER

AVERAGE OF n NUMBER IN AN ARRAY USING


3 8086 MICROPROCESSOR

4 SORTING

5 FIBONACCI SERIES

6 LOGICAL OPERATIONS

7 MATRIX ADDITTION

8 CODE CONVERSION

9 MASM

ARITHEMATIC OPERATION OF 8’BIT AND


10 16’BIT DATA

COUNTING n NUMBERS OF ONE’S AND


11 ZEROS’S IN A NUMBER

12 SEARCHING A GIVEN A BYTE IN AN ARRAY

13 LOGICAL OPERATIONS USING 8051

14 CODE CONVERSION

15 STEPPER MOTOR INTERFACING WITH 8051

INTERFACING ADC WITH 8051


16 MICROCONTROLLER

INTERFACING DAC WITH 8051


17 MICROCONTROLLER

INTERFACING 8279 WITH 8086


18 MICROPROCESSOR

19 TRAFFIC LIGHT CONTROL

20 DIGITAL CLOCK

21 PRINTER STATUS
EXPT NO: 01 DATE:

BASIC ARITHMETIC OPERATIONS ON 16 BIT DATA USING 8086


MICROPROCESSOR

AIM:
To write an Assembly Language Program (ALP) for performing the Arithmetic
operation of two byte numbers and to execute it using 8086 microprocessor kit.

APPARATUS REQUIRED:

SL.NO ITEM SPECIFICATION QUANTITY

1. Microprocessor kit 8086 kit 1


2. Power Supply +5 V dc 1

ALGORITHM:
(iii) Multiplication of 16-bit
(i) 16-bit addition numbers:

 Initialize the MSBs of sum to 0  
 Get the multiplier. 

 Get the first number.  
 
Get the multiplicand

 Initialize the product to 0. 

Add the second number to the first
 number.  
 Product = product + multiplicand 

If there is any carry,
 increment 
MSBs of sum by 1.  Decrement the multiplier by 1 

 Store LSBs of sum.  
  If multiplicand is not equal to
Store MSBs of sum. 0,repeat from step  (d) otherwise
store the product.
(ii) 16-bit subtraction (iv) Division of 16-bit numbers.

  
 Get the dividend 
Initialize the MSBs of difference to
 
 
0 Get the divisor
  
 Initialize the quotient to 0. 
 Get the first number

 Dividend = dividend – divisor 

Subtract
 the second number from the first

number. 
If the divisor is greater, store the
  quotient. Go to step g. 
If there is any
borrow, increment MSBs of
difference by 1. 

 Store LSBs of difference
 If dividend is greater, quotient
  = quotient + 1. Repeat from
Store MSBs of difference. step (d)Store the dividend
value as remainder.
ADDITION

ADDRESS OPCODES PROGRAM COMMENTS

1000 C7, C1,00,00 MOV CX, 0000H Initialize counter CX

1004 8B, 06,00,12 MOV AX, [1200] Get the first data in AX reg

1008 8B, 1E, 02,12 MOV BX, [1202] Get the second data in BX reg

ADD AX,BX Add the contents of both the


100C 01, D8 regs AX & BX

100E 73, 01 JNC 1011 (L1) Check for carry

41 INC CX If carry exists, increment the


1010 CX

1011 89,0E,06,12 L1 : MOV [1206],CX Store the carry


89,0E,06,1
1015 89,06,04,12 MOV [1204], AX Store the sum

1019 F4 HLT Stop the program

SUBTRACTION
ADDRESS OPCODES PROGRAM COMMENTS

1000 C7, C1,00,00 MOV CX, 0000H Initialize counter CX

1004 8B, 06,00,12 MOV AX,[1200] Get the first data in AX reg

1008 8B, 1E, 02,12 MOV BX, [1202] Get the second data in BX reg

SUB AX,BX Subtract the contents of BX from


100C 29, D8 AX

JNC L1 Check for borrow


100E 73, 01
INC CX If borrow exists, increment the
41 CX
1010
L1 : MOV [1206],CX Store the borrow
1011 89,0E,06,12
MOV [1204], AX Store the difference
1015 89,06,04,12
HLT Stop the program
1019 F4
OBSERVATION:

ADDITION

MEMORY

DATA

SUBTRACTION

MEMORY

DATA

MANUAL CALCULATION:
MULTIPLICATION

ADDRESS OPCODES PROGRAM COMMENTS

1000 8B,06,00,12 MOV AX,[1200] Get the first data

1004 8B,1E,02,12 MOV BX, [1202] Get the second data

1008 F7,E0 MUL AX, BX Multiply both

100A 89,06,04,12 MOV [1204],AX Store the lower order product

100E 89,D0 MOV AX,DX Copy the higher order product to


AX
1010 89, 06, 06,12 MOV [1206],AX Store the higher order product

1014 F4 HLT Stop the program

DIVISION

ADDRESS OPCODES PROGRAM COMMENTS

1000 8B,06,00,12 MOV AX,[1200] Get the first data

1004 8B,1E,02,12 MOV BX, [1202] Get the second data

1008 F7 FO DIV BX Divide the dividend by divisor

100A 89,06,04,12 MOV [1204],AX Store the lower order product

100E 89,D0 MOV AX,DX Copy the higher order product to


AX
1010 89, 06, 06,12 MOV [1206],AX Store the higher order product

1014 F4 HLT Stop the program


M
OBSERVATION:

MULTIPLICATION

MEMORY

DATA

DIVISON

MEMORY

DATA

MANUAL CALCULATION

Exp setup 30

Program 40

Output 20

Viva 10

Total 100
RESULT:

Thus the assembly language program to perform arithmetic operation of two byte
numbers are written and executed using 8086 microprocessor kit and output is verified .
EXP.NO: 02 DATE:

BLOCK TRANSFER

AIM:
To write an Assembly Language Program (ALP) to transfer a block of data
from one part of memory location to another set of location and to execute it using
8086 microprocessor

APPARATUS REQUIRED:

SL. No ITEM SPECIFICATION QUANTITY

1. Microprocessor kit 8086 kit 1


2. Power Supply +5 V dc 1

.
ALGORITHM:
1. Start the program
2. Lead the count CL
3. Initialize BX with source address
4. Initialize SI with destination address
5. Move the content of memory location pointed by BX to AL
6. Move contents of AL to memory location
7. Increment BX by SI
8. Decrement CL register.

PROGRAM:

ADDRESS OPCODES PROGRAM COMMENTS


1300 C6C105 MOV CL,05 Move 05 to CL register
1303 C7C30011 MOV BX,1100 Move 1100 to BX
1307 C7C60012 MOV SI,1200 Move 1200 to SI
130B 8A07 LOOP: MOV Move the content of BX to
AL,[BX] AL
130D 8804 MOV [SI],AL Move the content of AL to
[SI]
130F 43 INC BX Increment the BX
1310 46 INC SI Increment SI register
1311 FEC9 DEC CL Decrement CL register
1313 75F6 JNZ 130B If the cc not equal to them
jump to 130B
1315 F4 HLT Stop the program
OBSERVATION:

Input address Input data Output address Output data


1100 1200
1101 1201
1102 1202
1103 1203
1104 1204

Exp setup 30

Program 40

Output 20

Viva 10

Total 100

RESULT:
Thus the assembly language program to Move a data block without overlap is
written and executed using 8086 microprocessor kit and output is verified.
EXP.NO: 03 DATE:

AVERAGE OF ‘N’ NUMBERS IN AN ARRAY USING 8086


MICROPROCESOR

AIM:
To write an Assembly Language Program (ALP) to find an average of ‘N’
numbers in an array and to execute it using 8086 microprocessor

APPARATUS REQUIRED:

SL.NO ITEM SPECIFICATION QUANTITY

1. Microprocessor kit 8086 1


2. Power Supply +5 V dc 1

ALGORITHM:

1. Initialize the memory pointer


2. Get the count value in CL by BL register.
3. Move “0000” to AX register.
4. Increment the pointer
5. Add AX with content of memory location.
6. If CF=1 increment AH register, else continue.
7. Decrement the count value and repeat step from 4 till count
becomes Zero
8. Stop the execution.
PROGRAM:

ADDRESS OPCODE MNEUMONICS COMMENTS

1000 C2C600 MOV DL,00 Clear DL register

1003 C7C60020 MOV SI,2000 SET SI REGISTER AS POINTER


FOR ARRAY

1007 C7C70030 MOV DI,3000 SET DI REGISTER AS POINTER


FOR RESULT

100B 8A0C MOV CL,[SI] SET CL AS COUNT FOR NO OF


BYTES IN ARRAY

100D 88CB MOV BL,CL MOVE CL TO BL

100F 46 INC SI INCREMENT SI

1010 C7C00000 MOV AX,0000 SET INITIAL SUM AS ZERO

1014 0204 LOOP1: ADD AL,[SI] ADD A BYTE OF ARRAY TO


SUM

1016 7308 JNC LOOP:2 IF JUMP NO CARRY MEANS


THEN GO TO LOOP 1

1018 FEC2 INC DL INCREMENT DL

101A 46 LOOP 2:INC SI INCREMENT ARRAY POINTER

101B FEC9 DEC CL DECREMENT CL

101D 13F5 JNC LOOP:l IF CL NOT EQUAL TO ZERO


PROCEED COMPARISON

101F F6F3 DIV BL DIVIDE THE CONTENT OF AL


WITH BL

1021 8905 MOV [DI],AX STORE THE SUM IN ARRAY

1023 F4 HLT STOP THE PROCESS


OSERVATION:

ADDRESS TRIAL- TRIAL-3


1 TRIAL-2
2000

2001

2002

2003

2004

3000

Exp setup 30

Program 40

Output 20

Viva 10

Total 100
RESULT:
Thus the assembly language program to find an average of ‘N’ numbers in an array is
written and executed using 8086 microprocessor kit and output is verified.
EXP.NO: 04 DATE:

SORTING OF AN ARRAY

AIM:

To write and execute an assembly language program to sort an array of numbers in


an ascending and descending order.

APPARATUS:

SL.NO ITEM SPECIFICATION QUANTITY

1. Microprocessor kit 8086 1


2. Power Supply +5 V dc 1

ALGORITHM:

SORTING IN ASCENDING ORDER:

1. Start
2. Load the array count in two registers C1 and C2.
3. Get the first two numbers.
4. Compare the numbers and exchange if necessary so that the two numbers are
in ascending order.
5. Decrement C2.
6. Get the third number from the array and repeat the process until C2 is 0.
7. Decrement C1 and repeat the process until C1 is 0.
8. Stop
SORTING IN DESCENDING ORDER:

1. Start
2. Load the array count in two registers C1 and C2.
3. Get the first two numbers.
4. Compare the numbers and exchange if necessary so that the two numbers are
in descending order.
5. Decrement C2.
6. Get the third number from the array and repeat the process until C2 is 0.
7. Decrement C1 and repeat the process until C1 is 0.
8. Stop
ASCENDING ORDER

ADDRESS OPCODE LABEL MNEMONICS COMMENTS


1000 C7,c6,00,20 MOV SI,2000 Initialize the memory pointer
1004 8A,0C MOV CL,[SI] Move the content SI to CL.
1006 FE,C9 DEC CL Decrement the count values
1008 C7,C6,00,20 REPEAT: MOV SI,2000 Move 2000 to SI
100C 8A,2C MOV CH,[SI] Move the content of to CH
100E FE,CD DEC CH Decrement the CH by one
1010 46 INC SI Increment the memory pointer
1011 8A,04 RECMP: MOV AL,[SI] Move the content of SI to AL
1013 46 INC SI Increment the memory pointer
1014 3A,04 CMP AL[SI] Compare the content of Al and
content of address hold by SI
1016 72,05 JC:AHEAD If carry occur jump to the
address specify by the label
AHEAD
1018 86,04 XCHG AL,[SI] Exchange the content of AL and
the hold by the address specify
in SI
101A 86,44,FF XCHG AL,[SI-1] Exchange the content of AL and
the hold by the address specify
in SI-1
101D FE,CD AHEAD: DEC CH Decrement the CH register by 1
101F 75,F0 JNZ:RECMP In the count value not reach to
zero jumps to address specify
by RECMP
1021 FE,C9 DEC CL Decrement the content of CL
1023 75,E3 JNZ:REPEAT In the count value not reach to
zero jumps to address specify
by REPEAT
1025 F4 HLT Stop the program

OUTPUT

INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
2000 2000
2001 2001
2002 2002
2003 2003
2004 2004
2005 2005
DESCENDING ORDER:

ADDRESS OPCODE LABEL MNEMONICS COMMENTS


1000 C7,c6,00,20 MOV SI,2000 Initialize the memory pointer
1004 8A,0C MOV CL,[SI] Move the content SI to CL.
1006 FE,C9 DEC CL Decrement the count values
1008 C7,C6,00,20 REPEAT: MOV SI,2000 Move 2000 to SI
100C 8A,2C MOV CH,[SI] Move the content of to CH
100E FE,CD DEC CH Decrement the CH by one
1010 46 INC SI Increment the memory pointer
1011 8A,04 RECMP: MOV AL,[SI] Move the content of SI to AL
1013 46 INC SI Increment the memory pointer
1014 3A,04 CMP AL[SI] Compare the content of Al and
content of address hold by SI
1016 73,05 JC:AHEAD If carry occur jump to the
address specify by the label
AHEAD
1018 86,04 XCHG AL,[SI] Exchange the content of AL and
the hold by the address specify
in SI
101A 86,44,FF XCHG AL,[SI-1] Exchange the content of AL and
the hold by the address specify
in SI-1
101D FE,CD AHEAD: DEC CH Decrement the CH register by 1
101F 75,F0 JNZ:RECMP In the count value not reach to
zero jumps to address specify
by RECMP
1021 FE,C9 DEC CL Decrement the content of CL
1023 75,E3 JNZ:REPEAT In the count value not reach to
zero jumps to address specify
by REPEAT
1025 F4 HLT Stop the program

OUTPUT

INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
2000 2000
2001 2001
2002 2002
2003 2003
2004 2004
2005 2005
Exp setup 30

Program 40

Output 20

Viva 10

RESULT:
Total 100

Thus an assembly language program to sort an array of number in ascending and


descending order was performed and executed using 8086 microprocessor kit and output is
verified.
EXP.NO: 05 DATE:

GENERATION OF FIBONACCI SERIES

AIM

To write and execute an assembly language program to generate Fibonacci series


and executed using 8086 microprocessor kit.
APPARATUS:

SL.NO ITEM SPECIFICATION QUANTITY

1. Microprocessor kit 8086 1


2. Power Supply +5 V dc 1

ALGORITHUM:

1. Initialize the memory pointer


2. Get the count value in CL by BL register.
3. Move “0000” to AX register.
4. Increment the pointer
5. Add AX with content of memory location.
6. If CF=1 increment AH register, else continue.
7. Decrement the count value and repeat step from 4 till count
becomes Zero
8. Stop the execution.

PROGRAM:

ADDRESS OPCODE LABEL MNEMONICS COMMEND

1000 8B,36,00,20 MOV SI,2000 Set SI register as pointer for


series

1004 8A,0C MOV CL,[SI] Set CL as count for no of


element is series

1006 46 INC SI Increment pointer

1007 C6,C0,00 MOV AL,00 Load the first element of the


series

100A 88,04 MOV [SI],AL Save the first element of the


series

100C 46 INC SI Increment pointer


100D FE,C0 INC AL Get the second number of series
in AL

100F 88,04 MOV[SI],AL Save second number of series

1011 80,E9,02 SUB CL,02 Decrement the count by 2

1014 4E LOOP DEC SI Let SI pointer to element prior to


last element

1017 46 INC SI Increment pointer

1018 8A,1C MOV BL,[SI] Get last element of generated


series in BL

101A 00,D8 ADD AL,BL AL=(AL+BL)

101C 46 INC SI Increment pointer

101D 88,04 MOV [SI],AL [SI]<=AL

101F FE,C9 DEC CL Decrement CL register

1021 75,F1 JNZ LOOP Jump on no zero in loop

1023 F4 HLT Stop the program

OUTPUT:

DATA ADDRESS TRIAL 1 TRIAL 2 TRIAL 3

INPUT 2000

OUTPUT
Exp setup 30

Program 40

Output 20

Viva 10

Total 100

RESULT:

Thus the assembly language program for generation of Fibonacci series is written and
executed using 8086 microprocessor kit and output is verified.
EXP.NO:06 DATE:

LOGICAL OPERATION ON 8 BIT DATA USING 8086 MICROPORCESSOR

AIM:

To write and execute an assembly language program for performing logical OR, AND,
NAND operation in 8086 kit.

APPARATUS:
1. 8086 microprocessor kit
2. Power card
3. Keyboard

LOGICAL AND OPERATION

ALGORITHM:
1. Load the First Data in AL-register.
2. Load the Second Data in BL-register.
3. Logically OR the content of AL with BL-register.
4. Store the result in memory location
5. Stop the program

PROGRAM:

ADDRESS OPCODE LABEL MNEMONICS COMMENTS

1000 C6,C0,85 MOV AL,85H Load AL-register with 1st Data

1003 C6,C3,99 MOV BL,99H Load BX-register with 2 nd Data

1006 08,D8 OR AL, BL OR the contents of AL with BL-

register

1008 C7,C6,00,12 MOV SI,1200H Assign SI-reg to 1200H

100C 89,04 MOV [SI],AX Store the Result

100E F4 HLT Stop the program


OUTPUT:

INPUT OUTPUT

Register Data Address Data

AL 85H 1200H 9D

BL 95H

22

LOGICAL AND OPERATION

ALGORITHM:
1. Load the First Data in AL-register.
2. Load the Second Data in BL-register.
3. Logically AND the content of AL with BL-register.
4. Store the result in memory location
5. Stop the program

ADDRESS OPCODE LABEL MNEMONICS COMMENTS

1000 Org 1000h Starting address of the program

1000 C6,C0,85 MOV AL,85H Load AL-register with 1st Data

1003 C6,C3,99 MOV BL,99H Load BX-register with 2 nd Data

1006 20,D8 AND AL, BL AND the contents of AL with BL-

register

1008 C7,C6,00,12 MOV SI,1200H Assign SI-reg to 1200H

100C 89,04 MOV [SI],AX Store the Result

100E F4 HLT Stop the program


OUTPUT:

INPUT OUTPUT

Register Data Address Data

AL 85H 1200H 81H

BL 95H

LOGICAL NAND OPERATION

ALGORITHM:

1. Load the First Data in AL-register.


2. Load the Second Data in BX-register.
3. Logically AND the content of AX with BX-register.
4. Logically the content of AX register is complemented.
5. Store the result in memory location.
6. Stop the program

PROGRAM

ADDRESS OPCODE LABEL MNEMONICS COMMENTS

1000 C6,C0,85 MOV AL,85H Load AL-register with 1st Data

1003 C6,C3,99 MOV BL,99H Load BX-register with 2 nd Data

1006 20,D8 AND AL, BL AND the contents of AL with BL-

register

1008 F6,D0 NOT AL Complement the contents of AL-

register

100A C7,C6,00,12 MOV SI,1200H Assign SI-reg to 1200H

100E 89,04 MOV [SI],AX Store the Result

1010 F4 HLT Stop the program


OUTPUT:

INPUT OUTPUT

Register Data Address Data

AL 85H 1200H 7EH

BL 95H

Exp setup 30

Program 40

Output 20

Viva 10

Total 100

RESULT:
Thus an assembly language program for performing logical OR, AND, NAND
operation is written and executed using 8086 kit output is verified.
EX. NO: 07 DATE:

MATRIX OPERATIONS USING 8086 MICROPORCESSOR

AIM:

To write and execute an assembly language program for performing addition of two
matrices using 8086 k

APPARATUS:

1. 8086 microprocessor kit


2. Power card
3. Keyboard

ALGORITHM:

1. Get the 1st BCD number.


2. Get the 2 nd BCD number.
3. Multiply two BCD numbers.
4. Adjust result to valid BCD numbers.
5. Display the result.

PROGRAM:

ADDRESS OPCODE LABEL MNEMONICS COMMENTS

1000 Org 1000h Starting address of the program

1000 C6 C0 09 MOV AL, 09H Load AL-reg with data 09h.

1003 C6 C3 02 MOV BL, 02H Load BL-reg with data 02h.

1006 00 D8 ADD AL, BL Add the contents of AL-reg with


BL-register and the result will be
stored in AL-register.
1008 27 DAA Adjust result to valid BCD number.

1009 C6 C5 02 MOV CH, 02H Count of digits to be displayed

100C C7 C6 00 MOV SI, 1400H Load Si-reg with address 1400.


14
1010 88 04 MOV [SI], AL Copy the contents of AL-reg to
address 1400.

1012 C6 C1 04 MOV CL, 04H Count to roll by 4-digits


1015 88 C7 MOV BH, AL Copy the contents of AL-reg to
BH-register

1017 D2 CF L2: ROL BH, CL Roll BL-reg so that MSB comes to


LSB.

1019 88 FA MOV DL, BH Load DL-reg with data to be


displayed.

101B 80 E2 0F AND DL, 0FH Get only LSB data.

101E 80 FA 09 CMP DL, 09 check if digit is 0-9 or letter A-F

1021 76 03 JBE L4 If byte jump to label L4

1023 80 C2 07 ADD DL, 07 If letter add 37H

1026 80 C2 30 L4: ADD DL, 30H Else only add 30H

1029 FE CD DEC CH Decrement Count

102B 75 EA JNZ L2 If count is not zero then goto label


L2

102D F4 HLT Stop the program


OUTPUT:

INPUT OUTPUT

ADDRESS DATA ADDRESS DATA Address Data

1300 1400 1501

1301 1401 1502

1302 1402 1503

1303 1403 1504

1304 1404 1505

1305 1405 1506

1306 1406 1507

1307 1407 1508

1308 1408 1509

Exp setup 30

Program 40

Output 20

Viva 10

Total 100
RESULT

Thus an assembly language program for performing addition of two matrices is


written and executed using 8086 microprocessor kit and its output is verified
EX. NO: 08 DATE:

CODE CONVERSION

AIM:

To write and execute an assembly language program for converting BCD to Binary
and Hexadecimal to binary using 8086 kit.
APPARATUS:

1. 8086 microprocessor kit


2. Power card
3. Keyboard
ALGORITHM:

1. Load the address of BCD data in SI-register.


2. Copy the BCD data to BL-register
3. Get the BCD data in AL-register.
4. Copy the BCD data in DL-register from AL-register.
5. Logically AND DL with 0Fh to mask upper nibble and get unit’s digit in DL-reg.
6. Move the count value for rotation in CL-register.
7. Rotate the content of AL to move the upper nibble to lower nibble position.
8. Move 0Ah to DH-register.
9. Multiply AL with DH-register. The product will be in AL-register.
10. Add the unit’s digit in DL-register to product in AL-register.
11. Save the binary data (AL) in memory.
12. Stop.

BCD TO BINARY

ADDRESS OPCODE LABEL MNEMONICS COMMENTS

1000 MOV BX,1100 Initialize the address in BX

register

1004 MOV AL,[BX] Move the BCD data in AL register

1006 MOV DL,AL Copy the data to AL register

1008 AND DL,0F

Mask lower
100B AND AL,0F0 nibble

100E MOV CL,04 Rotate the upper to lower nibble

1011 ROR AL,CL Rotate the content in AL register

1013 MOV DH,0A Set multiplier as 0A hexadecimal


value

1016 MUL DH Multiply the content in DH

register

1018 ADD AL,DL Add sum of digits and product in

AL register

101A MOV [BX+1], AL Store the binary data

Stop the
101D HLT program

OUTPUT:

INPUT OUTPUT

Register Data Address Data

BL 7410 1200 4Bh

HEXADECIMAL TO BINARY

ADDRESS OPCODE LABEL MNEMONICS COMMENTS

1000 MOV SI,1100 Initialize the address in SI

register

1004 MOV AL,[SI] Move the BCD data in AL register

1006 MOV CL,08 Set CL

Move
1008 MOV BL,01 BL

Rotate AL and
100B LOOP 2 RCR AL,BL BL

100E JC LOOP Jump loop

1011 MOV DL,00 Move DL

1013 INC SI Increment SI

1016 MOV [SI],DL Move DL to [SI]


1018 JMP LOOP 1 Jump to LOOP 1

101A LOOP MOV DL,01 Move DL

101D INC SI Increment SI

101E MOV [SI],DL Move DL to SI

1020 LOOP 1 DCR CL Decrement CL

1022 JNZ LOOP 2 Jump no zero

Stop the
1023 HLT program

OUTPUT:

INPUT OUTPUT

OUTPUT
ADDRESS INPUT DATA ADDRESS DATA

1200 1201 TO 1208

Exp setup 30

Program 40

Output 20

Viva 10

Total 100

RESULT:

Thus an assembly language program for converting BCD to Binary data and
Hexadecimal to Binary using 8086 overlap is written and executed using 8086
microprocessor kit output is verified
EX. NO: 09 DATE:

MASM

INTRODUCTION TO MASM

EDITOR:

An editor is a program, which allows you to create a file containing the assembly language
statements for your program. As you type in your program, the editor stores the ASCII codes for the
letters and numbers in successive RAM locations. When you have typed in all of your programs, you
then save the file on a floppy of hard disk. This file is called source file. The next step is to process
the source file with an assembler. In the MASM /TASM assembler, you should give your source file
name the extension, .ASM

ASSEMBLER:

An assembler program is used to translate the assembly language mnemonics for instructions
to the corresponding binary codes. When you run the assembler, it reads the source file of your
program the disk, where you saved it after editing on the first pass through the source program the
assembler determines the displacement of named data items, the offset of labels and pails this
information in a symbol table. On the second pass through the source program, the assembler produces
the binary code for each instruction and inserts the offset etc that is calculated during the first pass.
The assembler generates two files on floppy or hard disk. The first file called the object file is given
the extension.OBJ. The object file contains the binary codes for the instructions and information about
the addresses of the instructions. The second file generated by the assembler is called assembler list
file. The list file contains your assembly language statements, the binary codes for each instructions
and the offset for each instruction. In MASM/TASM assembler, MASM/TASM source file name
ASM is used to assemble the file. Edit source file name LST is used to view the list file, which is
generated, when you assemble the file.

LINKER:
A linker is a program used to join several object files into one large object file and convert to
an exe file. The linker produces a link file, which contains the binary codes for all the combined
modules. The linker however doesn’t assign absolute addresses to the program, it assigns is said to be
reloadable because it can be put anywhere in memory to be run. In MASM/TASM, LINK/TLINK
source filename is used to link the file.

DEBUGGER:

A debugger is a program which allows you to load your object code program into system memory,
execute the program and troubleshoot are debug it the debugger allows you to look at the contents of
registers and memory locations after your program runs. It allows you to change the contents of
register and memory locations after your program runs. It allows you to change the contents of register
and memory locations and return the program. A debugger also allows you to set a break point at any
point in the program. If you inset a breakpoint the debugger will run the program upto the instruction
where the breakpoint is set and stop execution. You can then examine register and memory contents
to see whether the results are correct at that point. In MASM/TASM, td filename is issued to debug
the file.

DEBUGGER FUNCTIONS:

1. Debugger allows looking at the contents of registers and memory locations.

2. We can extend 8-bit register to 16-bit register which the help of extended register option.

3. Debugger allows setting breakpoints at any point with the program.

5. The debugger will run the program upto the instruction where the breakpoint is set
and then stop execution of program. At this point, we can examine registry and
memory contents at that point. With the help of dump we can view register contents.
6. We can trace the program step by step with the help of F7.

7. We can execute the


program completely
at a time using F8 The
DOS -Debugger:

The DOS “Debug” program is an example of simple debugger that


comes with MS-DOS. Hence it is available on any PC .it was initially
designed to give the user the capability to trace logical errors in
executable file.

Below, are summarized the basic DOS - Debugger commands

COMMAND SYNTAX

Assemble A [address]

Compare C range address

Dump D [range]

Enter E address [list]

Fill F range list

Go G [=address] [addresses]
Hex H value1 value2

Input I port

Load L[address] [drive][first sector][number]

Move M range address

Name N[pathname][argument list]

Output O port byte

Proceed P [=address] [number]

Quit Q

Register R[register]

Search S range list

Trace T [=address] [value]

Unassembled U [range]

Write W[address] [drive] [first sector] [number]

MS-MASM:

Microsoft’s Macro Assembler (MASM) is an integrated software package Written by Microsoft


Corporation for professional software developers. It consists of an editor, an assembler, a linker and
a debugger (Code View).The programmer’s workbench combines these four parts into a user-
friendly programming environment with built in on line help. The following are the steps used if you
are to run MASM from DOS.
PC PROGRAMMING WITH ASSEMBLY LANGUAGE USING MASM

Procedure:

1. Open command window (click: start->run->type cmd )

2. Paste the 8086 or MASM software in any driver

3. In that window change the directory [Where you paste the masm software]
4. n the command window type the directory name after that change the directory to
8086(masm) after that type edit

5. After changing directory type edit then you get one window in that window you can write a
program
6. After writing a program click: file->save->exit [again we enter the command window

7. Type : masm filename,,;[This will display the error report]

8. Type: link filename,,; [This will create a list file you can see this inside the
masm(8086)software]

Note: Here we no need to use stack segment so no need to worry about stack error
9. Type: debug filename.exe [to create exe file]

10. Type: n filename.bin [to create a bin file]


11. Type: WCS: 1000 [writing code segment]

12. Type: g =1000 [to execute a program]


13. Type: u 1000 [to see opcode]

14. Type: e 1200 [see output in corresponding address] use space bar to see next output value
15. Type: q [terminate a line]

16. Downloading procedure

Note: don’t use these command while down loading

Mov ah, 4ch [These commands are used to see the results system itself] Int 21h

(Bin file is used to downloading)

 Type: dc then you can get the following window


17. Press f1 key and set the port settings

18. Press esc key to abort


19. Now in micro 86 kit select receiving mode (i.e.) type Si 1000(starting address) then press
enter key. Then the kit is ready to receive data and press any in the host to start transmission.
During transmission the message display as, transmission progress.
Press esc to abort.

Now binary files are downloaded to kit.


Exp setup 30

Program 40

Output 20

Viva 10

Total 100

RESULT:

Thus the procedure to execute an assembly language program for 8086 microprocessor by
using MASM is studied and sample programs are executed.
8051 EXPERIMENTS
EX .NO:10 DATE:

ARITHMETIC OPERATIONS ON 8 BIT & 16 BIT DATA

AIM:
To write an assembly language program to perform an arithmetic operations like
addition and subtraction of two 16 bit numbers, multiplication and division of two 8 bit
numbers and to execute it using 8051 µc.

APPARATUS REQUIRED:
1. 8051 microcontroller
2. Power supply

ALGORITHM:

ADDITION OF TWO 16 BIT NUMBER’S:


1. Clear the R4 register for saving the array
2. Initialize the memory pointer in DPTR to get the input data in consecutive memory
locations.
3. Move the lower order byte and higher order byte of augend to R0 and R1.
4. Increment the memory pointer and get the lower order of the addend.
5. Move the addend to accumulator and add it with lower byte of augend and also
decimal adjust the accumulator.
6. Store the lower byte of sum in accumulator into R2 register.
7. Increment DPTR and get the higher byte of addend.
8. Move the addend to accumulator, add the higher byte of augend and addend with
carry and also decimal adjust the accumulator.
9. Store the higher byte of sum into R3 register. If carry presents, then increment R4
register.
10. Increment DPTR and move the lower byte sum into memory location.
11. Increment DPTR and move the higher byte sum into memory location.
12. Move the carry in R4 register into accumulator and store into memory location by.
13. Increment memory pointer.
PROGRAM:

ADDITION OF TWO 16 B IT NUMBERS:


ADDRESS OPCODE LABEL MNEMONIC OPERAND COMMENTS
8000 7C,00 MOV R4,#00 Clear r4 for carry

8002 90,85,00 MOV DPTR,#8500 Initialize the memory pointer

8005 E0 MOVX A,@DPTR Move the lower byte of augend


in memory location into
accumulator
8006 F8 MOV R0,A Move lower byte of augend into
R0.
8007 A3 INC DPTR Increment DPTR

8008 E0 MOVX A,@DPTR Move the higher byte of augend


in memory location into
accumulator
8009 F9 MOV R1,A Move the higher byte of augend
into R1
800A A3 INC DPTR Increment DPTR

800B E0 MOVX A,@DPTR Move the lower byte of addend


in memory location into
accumulator
800C 28 ADD A,R0 Add lower byte of addend in
Accumulator with lower byte of
addend in R0
800D D4 DA A Decimal adjust the accumulator

800E FA MOV R2,A Store the lower byte of sum into


R2
800F A3 INC DPTR Increment DPTR

8010 E0 MOVX A,@DPTR Move the higher byte of addend


in memory location into
accumulator
8011 39 ADDC A,R1 Add higher byte of addend in
Accumulator with higher byte
of augend in R0
8012 D4 DA A Decimal adjust the accumulator
8013 50,02 JNC LOOP J ump on no carry to loop
8015 0C INC R4 Increment R4
8016 FB LOOP MOV R3,A Store the higher byte of sum
into R3
8017 A3 INC DPTR Increment DPTR
8018 EA MOV A,R2 Move the lower byte of sum in
R2 into accumulator
8019 F0 MOVX @DPTR,A Move the lower byte of sum in
accumulator into memory
location
801A A3 INC DPTR Increment DPTR
801B FC MOV A,R4 Move carry in R4 into
accumulator
801C F0 MOVX @DPTR,A Move the carry to memory
location
801D 80 FE SJMP 801D Stop the program

OUTPUT:

ADDITION OF TWO 16-BIT NUMBERS:


I/O DATA ADDRESS TRIAL 1 TRIAL II TRAIL III
8500
AUGEND
8501
INPUT
8502
ADDEND
8503

8504

SUM 8505
OUTPUT

8506
CARRY
ALGORITHM:

SUBTRACTION OF TWO 16 BIT NUMBERS:

1. Clear the R4 register for saving the array


2. Initialize the memory pointer in DPTR to get the input data in consecutive
memory locations.
3. Move the lower order byte and higher order byte of subtrahend to R0 and R1.
4. Increment the memory pointer and get the lower byte of the subtrahend.
5. Move the lower byte of minuend to accumulator and subtract lower byte of
subtrahend in R0.
6. Store the lower byte of difference in accumulator into R2 register.
7. Increment DPTR and get the higher byte of minuend.
8. Move the minuend to accumulator, and subtract higher byte of subtrahend with
carry
9. Store the higher byte of difference into R3 register. If carry presents, then
increment R4 register.
10. Increment DPTR and move the lower byte difference in R2 into memory location.
11. Increment DPTR and move the higher byte difference in R3 into memory location.
12. Move the carry in R4 reg ister into accumulator and store into memory location by
incrementing the memory pointer.

PROGRAM:

ADDRESS OPCODE LABEL MNEMONIC OPEREND COMMENTS


8700 7C 00 MOV R4,#00 Clear the r4 register
8702 90 88 00 MOV DPTR,#8800 Initialize the memory pointer
8705 E0 MOVX A,@DPTR Move the lower byte of
minuend in memory location
into accumulator
8706 F8 MOV R0,A Move lower byte of minuend
into R0.
8707 A3 INC DPTR Increment DPTR
8708 E0 MOVX A,@DPTR Move the higher byte of
minuend in memory location
into accumulator
8709 F9 MOV R1,A Move the higher byte of
minuend into R1
870A A3 INC DPTR Increment DPTR
870B E0 MOVX A,@DPTR Move the lower byte of
subtrahend in memory
location into accumulator
870C C3 CLR C Clear the carry flag
870D 98 SUBB A,R0 Subtract lower byte of
subtrahend with lower byte
of minuend in R0
870E FA MOV R2.A Store the lower byte of
difference into R2
870F A3 INC DPTR Increment DPTR

8710 E0 MOVX @DPTR,A Move the higher byte of


subtrahend in memory
location into accumulator
8711 99 SUBB A,R1 Subtract the higher byte of
subtrahend in accumulator
with higher byte of minuend
in R1
8712 50 01 JNC LOOP Jump on no carry to LOOP
8714 0C INC R4 Increment R4

8715 FB LOOP MOV R3.A Store the higher byte of


difference into R3
8716 A3 INC DPTR Increment DPTR

8717 EA MOV A,R2 Move the lower byte of


difference in R2 into
accumulator
8718 F0 MOVX @DPTR,A Move the lower byte of
difference in accumulator
into memory location
8719 A3 INC DPTR Increment DPTR
871A EB MOV A,R3 Move the higher byte of
difference in R3 into
accumulator
871B F0 MOVX @DPTR.A Move the higher byte of
difference in accumulator
into memory location
871C EC INC DPTR Increment DPTR
871D A3 MOV A,R4 Move borrow in R4 into
accumulator
871E F0 MOVX @DPTR,A Move the borrow to memory
location
871F 80 FE SJMP 871F Stop the program
OUTPUT:

SUBTRACTION OF TWO 16 BIT NUMBERS:

I/O DATA ADDRESS TRIAL 1 TRIAL 2 TRIAL 3


INPUT LOWER BYTE 8800
OF MINUEND
HIGHER BYTE 8801
OF MINUEND
LOWER BYTE 8802
OF
SUBTRAHEND
HIGHER BYTE 8803
OF
SUBTRAHEND
OUTPUT LOWER BYTE 8804
OF
DIFFERENCE
HIGHER BYTE 8805
OF DIFFERENCE
BORROW 8806

ALGORITHM:

MULTIPLICATION OF TWO 8 BIT NUMBERS:

1. Initialize DPTR and get multiplicand form memory location into accumulator.
3. Accumulator content of multiplicand is moved to B register.
4. Increment the pointer to get the multiplier into accumulator.
5. Multiply the content of A & B. The lower byte of the product in the accumulator and
higher byte in B register.
6. Store the product into memory location by incrementing the pointer.
7. Stop the execution.

PROGRAM:

MULTIPLICATION OF TWO 8 BIT NUMBERS


ADDRESS OPCODE LABEL MNEMONIC OPERAND COMMENTS
8500 90 87 00 MOV DPTR,#8700 Initialize the memory pointer
8503 E0 MOVX A,@DPTR Move the multiplicant in memory
location into accumulator
85 F5 F0 MOV B,A Move the multiplicant from
accumulator into B register
8506 A3 INC DPTR Increment DPTR
8507 E0 MOVX A,@DPTR Move the multiplier from memory
location into accumulator
8508 A4 MUL AB Multiply the multiplicant in B register
with multiplier in the accumulator
8509 A3 INC DPTR Increment DPTR
850A F0 MOVX @DPTR,A Move lower byte of product in
accumulator into memory
850B A3 INC DPTR Increment DPTR
850C E5 F0 MOV A,B Move the higher byte of product in B
register into accumulator
850E F0 MOVX @DPTR,A Move higher byte of product in
accumulator into memory
850F 80 FE SJMP 850F Stop the execution

OUTPUT:

MULTIPLICATION OF 8-BIT NUMBER:


I/O DATA ADDRESS TRIAL1 TRIAL2 TRIAL3
INPUT 8700
MULTIPLICAND

MULTIPLIER 8701

OUTPUT HIGHER BYTE 8702


OF PRODUCT
LOWER BYTE 8703
OF PRODUCT
DIVISION OF TWO 8-BIT NUMBERS:

ALGORITHM FOR DIVISION OF TWO 8-BIT NUMBERS:


1. Initialize DPTR and get divisor into accumulator.
2. Accumulator content moved to B register.
3. Increment the pointer to get the dividend into accumulator.
4. Divide the content of A & B. The quotient is in the accumulator and remainder in B
register.
5. Store the quotient and remainder into memory location by incrementing the pointer .
6. Stop the execution.

PROGRAM: DIVISION OF TWO 8 BIT NUMBERS


ADDRESS OPCODE LABEL MNEMONIC OPERAND COMMENTS
8500 90 87 00 MOV DPTR,#8700 Initialize the memory pointer
8503 E0 MOVX A,@DPTR Move the dividend in memory
location into accumulator
8504 F5 F0 MOV B,A Move the dividend from
accumulator into B register
8506 A3 INC DPTR Increment DPTR
8507 E0 MOVX A,@DPTR Move the divisor from memory
location into accumulator
8508 84 DIV AB Divide the dividend in B register
with divisor in the accumulator
8509 A3 INC DPTR Increment DPTR
850A F0 MOVX @DPTR,A Move quotient in accumulator into
memory
850B A3 INC DPTR Increment DPTR
850C E5 F0 MOV A,B Move the remainder in B register
into accumulator
850E F0 MOVX @DPTR,A Move remainder in accumulator
into memory
850F 80 FE SJMP 850F Stop the execution
OUTPUT:

DIVISION OF 8-BIT NUMBER:


I/O DATA ADDRESS TRIAL1 TRIAL2 TRIAL3
INPUT 8700
DIVIDEND

DIVISOR 8701

OUTPUT 8702
QUOTIENT
8703
REMAINDER

Exp setup 30

Program 40

Output 20

Viva 10

Total 100

RESULT:
Thus the assembly language programs to perform arithmetic operations like addition,
subtraction, multiplication and division are written and executed using 8051microcontroller
and output is verified.
EXP.NO: 11 DATE:

COUNTING NUMBER OF ONE’S & ZERO’S IN A

NUMBER

AIM:
To write an assembly language program to count the number of one’s & zero’s in a
given number and to execute it using 8051 microcontroller.

APPARATUS REQUIRED:
1. 8051 microcontroller kit
2. Power supply

ALGORITHM:
1. Start the program.
2. Initialize the memory pointer for input and outputs data
3. Initialize two registers R0 and R1 for counting zero’s & one’s.
4. Give the count value that is number of bits in data as 08 in R2.
5. Get the input data into accumulator.
6. Rotate right the accumulator through carry.
7. If CF=0, go to step9, else continue.
8. Increment one’s count in R1 then go to step10
9. Increment zero’s count in R0.
10. Decrement count in R2 and repeat the steps from 5 till count becomes zero.
11. Stop the program.
PROGRAM: COUNTING NUMBER OF ONE’S AND ZERO’S IN A
NUMBER
ADDRESS OPCODE LABEL MNEMONICS OPERANDS COMMENTS
8700 78 00 MOV R0,#00 Clear R0 register(count for 0’)
8702 79 00 MOV R1,#00 Clear R2 register(count for 1’s)
8704 7A 08 MOV R2, #08 Load the count value
8706 90 88 00 MOV DPTR, #8800 Initialize the data pointer
8709 E0 MOVX A,@DPTR Move the contents of data pointer
into accumulator
870A 13 LOOP 2 RRC A Rotate right through carry the
accumulator
870B 40 03 JC LOOP If cy=1 jump to loop
870D 09 INC R1 Increment R1
870E E1 03 AJMP LOOP 1 Absolute jump to loop 1
8710 08 LOOP INC R0 Increment count for zero’s
8711 DA F7 LOOP 1 DJNZ R2,LOOP 2 Decrement jump on no zero to
loop 2
8713 E9 MOV A,R1 Move the count of one’s in R1
to accumulator
8714 A3 INC DPTR Increment memory pointer
8715 E0 MOVX @DPTR,A Move the content of
accumulator to memory pointer
8716 E8 MOV A,R0 Move the count of 0’s in R0
into accumulator
8717 A3 INC DPTR Increment memory pointer
8718 F0 MOVX @DPTR,A Move the content of
accumulator to memory
8719 80 FE SJMP 8719 Stop the execution

OUTPUT:

COUNTING NUMBER OF ONE’S AND ZERO’S IN A NUMBER:


DATA ADDRESS TRIAL-1 TRIAL-2 TRIAL-3
INPUT 8800
OUTPUT 8801 (1’S)

8802 (0’S)
Exp setup 30

Program 40

Output 20

Viva 10

Total 100

RESULT: Thus the assembly language program to count the number of one’s and zero’s
in a given number is written and executed using 8051 Microcontroller kit and output is
verified.
EXP.NO: 12 DATE:

SEARCHING A GIVEN BYTE IN AN ARRAY

AIM:

To write an assembly language program to search a given Byte in an array and to


execute it using 8051 microcontroller kit.

APPARATUS REQUIRED:

1. 8051 Microcontroller kit


2. Power supply

ALGORITHM:

1. Clear the registers R1 and R2.


2. Initialize count value that is number of elements in an array in R0 and
initialize memory pointer in DPTR.
4. Get the data in memory location pointed by DPTR into accumulator.
5. Compare the immediate data to be searched with the first element in
accumulator
6. If they are not equal go to step 9, else continue.
7. Move lower order address of searched data in DPL into R1.
8. Move higher order address of searched data in DPH into R2.
9. Increment the pointer and Decrement the count value in R0 and repeat the
steps from5 till count becomes zero.
10. Increment the pointer and move lower order address of found data / 00 in
R1 into memory location.
11. Increment the pointer and move higher order address of found data/00 in
R2 into memory location.
12. Stop the program.

PROGRAM:

TO SEARCH A GIVEN BYTE IN AN ARRAY :


ADDRESS OPCODE LABEL MNEMONICS OPERANDS COMMENTS
8000 79 00 MOV R1,#00 Clear R1 register
8002 7A 00 MOV R2,#00 Clear R2 register
8004 78 0A MOV R0,#0A Move 0A H into R0 reg
8006 990 82 00 MOV DPTR,#8200 Initialize data pointer
8009 E0 LOOP 1 MOVX A,@DPTR Move the data in data
pointer into accumulator
800A B4 20 06 CJNE A,#20,LOOP Compare not equal to ie)A
is not equal to 20 and jump
to loop
800D AA 82 MOV R1,DPL Move the content of lower
byte of data pointer into R1
800F AA 83 MOV R2,DPH Move the content of higher
byte of data pointer into R2
8011 80 03 SJMP LOOP 2 Jump to loop 2
8013 A3 LOOP INC DPTR Increment data pointer
8014 D8 F3 DJNZ R0,LOOP 1 Decrement jump no zero to
loop 1
8016 90 83 00 LOOP 2 MOV DPTR,#8300 Initialize data pointer
8019 E9 MOV A,R1 Move the content of R1
into accumulator
801A F0 MOVX @DPTR,A Store the accumulator
content into memory
801B A3 INC DPTR Increment DPTR
801C EA MOV A,R2 Move the content of R2
into accumulator
801D F0 MOVX @DPTR,A Store the accumulator
content in memory
801E 80 FE SJMP 80 1E Stop the execution

OUTPUT:

TO SEARCH A GIVEN BYTE IN AN ARRAY:


DATA ADDRESS TRIAL 1 TRIAL II TRIAL III
8200
8201
8202
8203
INPUT
8204
8205
8206
8207
8208
8209

8300
OUTPUT 8301
Exp setup 30

Program 40

Output 20

Viva 10

Total 100

RESULT:

Thus the assembly language program to search a given byte in an array is written
and executed using 8051µc kit and output is verified.
EXP.NO:13 DATE:

LOGICAL OPERATIONS USING 8051

AIM:

To write and execute an assembly language program to perform logical operations


and to execute it using 8051 microcontroller kit.

APPARATUS:

1. 8051 microcontroller kit ----1


2. Power card ----1
3. Keyboard ----1
4. PC with Intel/AMD Processor----1

ALGORITHM:

1. Get the Data 1 in the R0-register.


2. Get the Data 2 in the A register.
3. Logical AND, OR, XOR A with R0.
4. Store the result in memory.
5. Stop the program.
PROGRAM

LOGICAL AND OPERATION

ADDRESS OPCODE LABEL PROGRAM COMMENTS

4100 78,14 MOV R0,#DATA 1 Load data 1 in R0-reg.

4102 74,12 MOV A,#DATA 2 Load data 2 in A-register

4104 58 ANL A,R0 Logical AND the contents

of A-reg with R0-register.

4105 90,45,00 MOV DPTR,#4500H Initialize DPTR with

address 4500H

4108 F0 MOVX @ DPTR,A Store the result in 4500H

4100 80, FE STOP: SJMP STOP Stop the program

OUTPUT:

INPUT OUTPUT

REGISTER DATA ADDRESS DATA

R0-Register 14 4500 10

A-Register 12

LOGICAL OR OPERATION

ADDRESS OPCODE LABEL PROGRAM COMMENTS

4100 78,14 MOV R0,#DATA 1 Load data 1 in R0-reg.

4102 74,12 MOV A,#DATA 2 Load data 2 in A-register


4104 58 ORL A,R0 Logical OR the contents of

A-reg with R0-register.

4105 90,45,00 MOV DPTR,#4500H Initialize DPTR with

address 4500H

4108 F0 MOVX @ DPTR,A Store the result in 4500H

4100 80, FE STOP: SJMP STOP Stop the program

OUTPUT:

INPUT OUTPUT

REGISTER DATA ADDRESS DATA

R0-Register 14 4500 16

A-Register 12

LOGICAL X-OR OPERATION

ADDRESS OPCODE LABEL PROGRAM COMMENTS

4100 78,14 MOV R0,#DATA 1 Load data 1 in R0-reg.

4102 74,12 MOV A,#DATA 2 Load data 2 in A-register

4104 68 XRL A,R0 Logical EX-OR the contents

of A-reg with R0-register.


4105 90,45,00 MOV DPTR,#4500H Initialize DPTR with

address 4500H

4108 F0 MOVX @ DPTR,A Store the result in 4500H

4100 80, FE STOP: SJMP STOP Stop the program

OUTPUT:

INPUT OUTPUT

REGISTER DATA ADDRESS DATA

R0-Register 14 4500 06

A-Register 12

Exp setup 30

Program 40

Output 20

Viva 10

Total 100
RESULT:

Thus an assembly language program for logical operations is written and executed
using 8051µc kit and output is verified.
EXP.NO: 14 DATE:

CODE CONVERSION

AIM:

To write and execute an assembly language program to perform code conversion and to
execute it using 8051 microcontroller kit.
APPARATUS REQUIRED:

1. 8051 microcontroller kit ----1


2. Power card ----1
3. Keyboard ----1
4. PC with Intel/AMD Processor----1

ALGORITHUM:

1. Get the binary number as an input into the memory location.


2. More its binary number into A register.
3. Rotate right the binary input A register by one time.
4. Logically X-or the content of A register and R1 register and some of the answering into
next memory location.
5. Stop the program.

BINARY TO GRAY:

ADDRESS OPCODE LABEL MNEMONICS COMMEND

4000 90,41,00 MOV DPTR,#4100 Move the data 4100 to DPTR

4003 E0 MOVX A,@DPTR Move the DPTR value in A


register

4004 F9 MOV R1,A Move A register to R1 register

4005 D3 SETB C Set C register

4006 B3 CPL C Compliment C Register

4007 07 RR A Rotate right the accumulator

4008 69 XRL A,R1 X OR logical operation R1 to A

4009 A3 INC DPTR Increment DPTR

400A F0 MOVX @DPTR,A Move to A register to DPTR


register

400B 80,FE HLT Stop the program


OUTPUT:

DATA ADDRESS TRIAL-1 TRIAL- 2

Exp setup 30

Program 40

Output 20

Viva 10

Total 100

RESULT:

Thus an assembly language program for code conversions operations is written


and executed using 8051µc kit and output is verified.
INTERFACING
EXPERIMENT
EXP.NO: 15 DATE:

STEPPER MOTOR INTERFACING WITH 8051 MICROCONTROLLER

AIM:

To interface a stepper motor with 8051 microcontroller and to write an assembly


program to rotate it.

APPARATUS REQUIRED:

(I) 8051 MICROCONTROLLER


(II) STEPPER MOTOR INTERFACING KIT

THEORY:

A motor in which the rotor is able to assume only discrete stationary angular position
is a stepper motor. The rotary motion occurs in a step-wise manner from one equilibrium
position to the next. Stepper Motors are used very wisely in position control systems like
printers, disk drives, process control machine tools, etc. The basic two-phase stepper motor
consists of two pairs of stator poles. Each of the four poles has its own winding. The excitation
of any one winding generates a North Pole. A South Pole gets induced at the diametrically
opposite side. The rotor magnetic system has two end faces. It is a permanent magnet with
one face as South Pole and the other as North Pole. The Stepper Motor windings A1, A2, B1,
B2 are cyclically excited with a DC current to run the motor in clockwise direction. By
reversing the phase sequence as A1, B2, A2, B1, anticlockwise stepping can be obtained.

ANTICLOCKWISE CLOCKWISE
STEP A1 A2 B1 B2 DATA STEP A1 A2 B1 B2 DATA

1 1 0 0 1 9h 1 1 0 1 0 Ah

2 0 1 0 1 5h 2 0 1 1 0 6h

3 0 1 1 0 6h 3 0 1 0 1 5h

4 1 0 1 0 Ah 4 1 0 0 1 9h
ADDRESS MNEMONICS
OPCODDE LABEL COMMEND
ORG 4100h

4100 START: MOV DPTR, #TABLE Load the start address of


90,41,1F switching scheme data TABLE
into Data Pointer (DPTR)

4103 78,04 MOV R0, #04 Load the count in R0

4105 LOOP: MOVX A, @DPTR Load the number in TABLE


E0
into A

4106 C0,83 PUSH DPH Push DPTR value to Stack

4108 C0,82 PUSH DPL

410A MOV DPTR, #0FFC0h Load the Motor port address


90,0F,FC
into DPTR

410D MOVX @DPTR, A Send the value in A to stepper


F0
Motor port address

410E 7C,0F MOV R4, #0FFh Delay loop to cause a specific


amount of time delay before
4110 7D,0F DELAY: MOV R5, #0FFh next data item is sent to the
4112 DELAY1 DJNZ R5, DELAY1 Motor
DD,FE
:

4114 DC,FA DJNZ R4, DELAY

4116 D0,82 POP DPL POP back DPTR value from


Stack
4118 D0,83 POP DPH

411A INC DPTR Increment DPTR to point to


A3
next item in the table

411B DJNZ R0, LOOP Decrement R0, if not zero


D8,E8
repeat the loop

411D SJMP START Short jump to Start of the


80,E1 program to make the motor
rotate continuously

411F TO 09, 05, 06, TABLE: DB 09 05 06 0Ah Values as per two-phase


4122 0A switching scheme
Exp setup 30

Program 40

Output 20

Viva 10

Total 100

RESULT:

Thus an assembly program to interface stepper motor with 8051 µc and to rotate it
on forward/reverse direction operations is written and executed using 8051µc kit and output
is verified.
EXP.NO: 16 DATE:

INTERFACING ADC WITH 8051 MICROCONTROLLER

AIM:

To interface analog to digital convertor with 8051 µc and to display the equivalent
digital (hexa value) value by saving it on memory location is written and to execute using
8051µc kit

APPARATUS REQUIRED:

1. 8051 Microcontroller kit

2. Power Supply

3. ADC Interface board

THEORY:

An ADC usually has two additional control lines: the SOC input to tell the ADC when
to start the conversion and the EOC output to announce when the conversion is complete. The
following program initiates the conversion process, checks the EOC pin of ADC 0809 as to
whether the conversion is over and then inputs the data to the processor. It also instructs the
processor to store the converted digital data at RAM location.

ALGORITHM:

(i) Select the channel and latch the address.


(ii) Send the start conversion pulse.
(iii) Read EOC signal.
(iv) If EOC = 1 continue else go to step (iii)
(v) Read the digital output.
(vi) Store it in a memory location.

PROCEDURE:
1. Place the jumper J2 in A position.
2. Place the jumper J5 in A position.
3. Enter and execute the program.
4. Vary the analog input (using trimpot) and verify the digital data displayed with that data
stored in memory location 4105H
PROGRAM
ADDRESS OPCODE MNEMONICS COMMENTS
4100 90,FFC8 MOV DPTR,#FFC8

4103 74,10 MOV A,#10 Select channel 0

4105 F0 MOVX @DPTR,A Make ALE low

4106 74,18 MOV A,#18 Make AL high

4108 F0 MOVX @DPTR,A

4109 90,FFD0 MOV DPTR,#FFD0

410C 74,01 MOV A,#01 SOC signal high

410E F0 MOVX @DPTR,A

410F 74,00 MOV A,#00 SOC signal low

4111 F0 MOVX @DPTR,A

4112 90,FFDA MOV DPTR,#FFDA

4115 E0 WAIT: MOVX A,@DPTR

4116 30,E0FC JNB E0,WAIT Check for EOC

4119 90,FFC0 MOV DPTR,#FFC0 Read ADC data

411C E0 MOVX A,@DPTR

4110 90,4150 MOV DPTR,#4150 Store the data in memory


location
4120 F0 MOVX @DPTR,A

4121 80,FE HERE: SJMP (HERE) 4121

OSERVATION:
Exp setup 30

Program 40

Output 20

Viva 10

Total 100

RESULT:
Thus an assembly program to interface analog to digital convertor with 8051 µc and
to display the equivalent digital (hexa value) value by saving it on memory location is written
and executed using 8051µc kit and output is verified.
EXP.NO: 17 DATE:

INTERFACING DAC WITH 8086 MICROPROCESSOR

AIM :
To interface DAC with 8086 microprocessor and to write an assembly language
program to generate square, sawtooth and triangular waveform and to execute it.

APPARATUS REQUIRED:

1. 8051 MICROCONTROLLER
2. Power Supply
3. DAC Interface board
THEORY:

Since DAC 0800 is an 8 bit DAC and the output voltage variation is between –5v and
+5v. The output voltage varies in steps of 10/256 = 0.04 (approximately). The digital data
input and the corresponding output voltages are presented in the table. The basic idea behind
the generation of waveforms is the continuous generation of analog output of DAC. With 00
(Hex) as input to DAC2 the analog output is –5v. Similarly with FF H as input, the output is
+5v. Outputting digital data 00 and FF at regular intervals, to DAC2, results in a square wave
of amplitude 5v.Output digital data from 00 to FF in constant steps of 01 to DAC2. Repeat
this sequence again and again. As a result a saw-tooth wave will be generated at DAC2
output.Output digital data from 00 to FF in constant steps of 01 to DAC2.Output digital data
from FF to 00 in constant steps of 01 to DAC2. Repeat this sequence again and again. As a
result a triangular wave will be generated at DAC2 output.

ALGORITHM:

Square Waveform:

(i) Send low value (00) to the DAC.


(ii) Introduce suitable delay.
(iii) Send high value to DAC.
(iv) Introduce delay.
(v) Repeat the above procedure.
OBSERVATION:
WAVEFORM AMPLITUDE TIME PERIOD FREQUENCY

Square wave
PROGRAM TABLE: SAW TOOTH WAVEFORM.

MOV AL,00 Move immediate data 00 to AL register

OUT C0,AL Send through output port

INC AL Increment AL register

JNZ 1002 Till AL register become zero send the value


through output port

JMP 1000 Repeat the cycles

OBSERVATION:
WAVEFORM AMPLITUDE TIME PERIOD FREQUENCY

SAW TOOTH
PROGRAM TABLE: TRIANGULAR WAVE
MOV BL,00 Move immediate data to BL register

MOV AL,BL Move BL register to AL register

OUT C8,AL Send through output port

INC BL Increment BL register

JNZ 1002 Till AL register become zero send the value


through output port

MOV BL,FF Move immediate data to BL register

MOV AL,BL Move BL register to AL register

OUT C8,AL Send through output port

DEC BL Decrement BL register

JNZ 100C Till BL register become zero send the value


through output port

JMP 1000 Repeat the cycles

OBSERVATION:
WAVEFORM AMPLITUDE TIME PERIOD FREQUENCY

Triangular wave
Exp setup 30

Program 40

Output 20

Viva 10

Total 100

RESULT:

Thus an assembly program to interface DAC with 8086 microprocessor and to


generate square, sawtooth and triangular waveform is written and executed and output is
verified by using CRO.
EXP.NO: 18 DATE:

INTERFACING IC 8279 (KEYBOARD/DISPLAY INTERFACE) WITH 8086


MICROPROCESSOR

AIM:

To interface IC 8279 (keyboard/display interface) with 8086 microprocessor and to


write an assembly language program to roll the characters in seven segmnet display and to
execute it.

PROGRAMMABLE KEYBOARD/DISPLAY INTERFACE – 8279


ARCHITECTURE

A programmable keyboard and display interfacing chip. Scans and encodes up to a


64-key keyboard. Controls up to a 16-digit numerical display. Keyboard section has a built-
in FIFO 8 character buffer. The display is controlled from an internal 16x8 RAM that stores
the coded display information.

Keyboard and display is configured in the encoded mode. In the encoded mode, a
binary count sequence is put on the scan lines SL0-SL3. These lines must be externally
decoded to provide the scan lines for keyboard and display. A 3 to 8 decoder 74LS138 is
provided for this purpose. The S0-S1 output lines of this decoder are connected to the two
rows of the keyboard. And QA0 to QA7 is connected to 7 Segment Display
8086 MICRO PROCESSOR ON BOARD I/O DECODING ADDRESS

CONTROL ADDRESS
Control REG C2
Control Data CC
DISPLAY DATA "A":

APPARATUS REQUIRED:

i. 8051 microcontroller
ii. Power cable

PROGRAM:

ADDRESS OPCODE MNEMONICS

1000 C6,CO,00 MOV AL,00


1003 E6,C2 OUT C2,AL
1005 C6,C0,CC MOV AL,CC
1008 E6,C2 OUT C2,AL
100A C6,C0,90 MOV AL,90
100D E6,C2 OUT C2,AL
100F C6,C0,88 MOV AL,88
1012 E6,C0 OUT C0,AL
1014 C6,C0,FF MOV AL,FF
1017 C7,C1,05,00 LP1: MOV CX,0005
101B E6,C0 OUT C0,AL
101D E2,FC LOOP (LP1)1017
101F F4 HLT
LOOK-UP TABLE:

CHARACTER d c b a dp g f e HEXA
VALUE

Exp setup 30

Program 40

Output 20

Viva 10

Total 100

RESULT:

Thus an assembly program to interface IC 8279 (keyboard/display interface) with


8086 microprocessor and to write an assembly language program to roll the characters in
seven segmnet display is written and executed and output is verified
EXP.NO: 19 DATE:
TRAFFIC LIGHT CONTROL

AIM:

To write and execute an assembly language Program for interfacing the Traffic
Light Controller in 8086 kit.

APPARATUS:

1. 8086 microprocessor kit/MASM


2. Traffic Light Controller Interface board
3. Power card
4. Keyboard
PROGRAM:

ADDRESS OPCODE LABEL MNEMONICS COMMENTS

1000 B0,80 START: MOV AL,80H Move 80 to AL-register

1002 E6,26 OUT CONTROL,AL Copy the AL-reg content to

output port.

1004 BB 6B 10 REPEAT: MOV BX, LOOKUP Copy the lookup data value

to BX-register

1007 BE 77 10 MOV SI, LABEL Copy the direction of rotation

value to SI-reg.

100A E8 32 00 CALL OUT Call to OUT port

100D 8A 04 MOV AL, [SI] Copy the contents of SI-reg

to Al-register

100F E6 20 OUT PORTA, AL Move the AL-reg value to

PORTA

1011 E8 4A 00 CALL DELAY1 Call Delay program

1014 46 INC SI Increment SI-register

1015 43 INC BX Increment BX-register

1016 E8 26 00 CALL OUT Call to OUT port

1019 8A 04 MOV AL, [SI] Copy the contents of SI-reg

to Al-register

101B E6 22 OUT PORTB, AL Move the AL-reg value to

PORTB
101D E8 3E 00 CALL DELAY1 Call Delay program

1020 46 INC SI Increment SI-register

1021 43 INC BX Increment BX-register

1022 E8 1A 00 CALL OUT Call to OUT port

1025 8A 04 MOV AL, [SI] Copy the contents of SI-reg

to Al-register

1027 E6 24 OUT PORTC, AL Move the AL-reg value to

PORTC

1029 E8 32 00 CALL DELAY1 Call Delay program

102C 46 INC SI Increment SI-register

102D 43 INC BX Increment BX-register

102E E8 0E 00 CALL OUT Call to OUT port

1031 8A 04 MOV AL, [SI] Copy the contents of SI-reg

to Al-register

1033 E6 24 OUT PORTC, AL Move the AL-reg value to

PORTC

1035 46 INC SI Increment SI-register

1036 8A 04 MOV AL, [SI] Copy the contents of SI-reg

to Al-register

78

1038 E6 20 OUT PORTC, AL Move the AL-reg value to

PORTC

103A E8 21 00 CALL DELAY1 Call Delay program

103D EB C5 JMP REPEAT Jump to label REPEAT

103F 8A 07 OUT: MOV AL, [BX] Copy the content of BX to

AL-register

1041 E6 24 OUT PORTC, AL Move the AL-reg value to

PORTC

1043 43 INC BX Increment BX-register

1044 8A 07 MOV AL, [BX] Copy the content of BX to

AL-register

1046 E6 22 OUT PORTB, AL Move the AL-reg value to


PORTB

1048 43 INC BX Increment BX-register

1049 8A 07 MOV AL, [BX] Copy the content of BX to

AL-register

104B E6 20 OUT PORTA, AL Move the AL-reg value to

PORTA

104D E8 01 00 CALL DELAY Call Delay program

1050 C3 RET Return from subroutine

1051 BF 40 00 DELAY: MOV DI, 00040H Move 40h to DI-register

1054 BA FF FF A: MOV DX, 0FFFFH Move 0FFFFh to DX-register

1057 4A A1: DEC DX Decrement DX-register

1058 75 FD JNZ A1 Jump on no zero to A1.

105A 4F DEC D1 Decrement D1-register

105B 75 F6 JNZ A Jump on no zero to A

105D C3 RET

105E BF 15 00 DELAY1: MOV DI, 00015H Move 15h to DI-register

1061 BA FF FF B: MOV DX, 0FFFH Move 0FFFh to DX-register

1064 4A B1: DEC DX Decrement DX-register

1065 75 FD JNZ B1 Jump on no zero to B1

1067 4F DEC D1 Decrement D1-register

1068 75 F6 JNZ B Jump on no zero to B

106A C3 RET

106B 12 27 44 10 LOOKUP: DB 12H,27H,44H,10H

106F 2B 92 109D 2BH,92H,10H,9DH

1073 84 48 2E 84 84H,48H,2EH,84H

1077 48 4B 20 49 LABEL: DB 48H,4BH,20H,49H

107B 04 04H For traffic light control.

107C END
Exp setup 30

Program 40

Output 20

Viva 10

Total 100

RESULT:

Thus the traffic light controller is interfaced with 8086 microprocessor and assembly
language program to display a specified sequence is written and executed and output is
verified.
EXP.NO: 20 DATE:

DIGITAL CLOCK

AIM:

To write and execute an assembly language Program for digital clock in 8086 kit.

APPARATUS:

1.8086microprocessorkit/MAM ----1
2. Traffic Light Controller Interface boar- 1
3. Power card -- 1

4. Keyboard1---
5. PC with Intel/AMD
Processor---- 1

PROGRAM:

ADDRESS OPCODE LABEL MNEMONICS COMMENTS

1000 CALL CONVERT Call subroutine for conversion

1003 CALL DISPLAY Call subroutine for Display

1006 DELAY: MOV AL,0B0H Copy the data 0B0H to AL-reg

1009 OUT 16H,AL Configure output port

100B MOV CL,07H Copy the data 07H to AL-reg

100E S2: MOV AL,88H Copy 88H to AL-register

1011 OUT 14H,AL Configure output port

1013 MOV AL,80H Copy the data 80H to AL-reg

1016 OUT 14H,AL Configure output port

1018 S1: NOP No operation

1019 NOP No operation


101A NOP No operation

101B NOP No operation

101C IN AL,14H Copy 14H to AL-reg

101E MOV DL,AL Copy the Content of AL reg to

DL-reg.

1020 IN AL,14H Copy 14H to AL-reg

1022 OR AL,DL OR the contents of AL with DL

1024 JNZ S1 Jump on no zero to S1

1026 DEC CL Decrement CL-register

1028 JNZ S2 Jump on no zero to S2

102A MOV SI,1500H Copy SI-reg with data 1500H

102E MOV AL,[SI] Copy the content of SI-reg to AL

1030 INC AL Increment AL-register

1032 MOV [SI],AL Copy the content of AL reg to SI-

reg

1034 CMP AL,3CH Compare AL with 3CH

1037 JNZ START Jump on no zero to start


1039 MOV AL,00H Copy AL with data 00H

103C MOV [SI],AL Copy the content of Al to SI-reg

103E INC SI Increment SI-register

103F MOV AL,[SI] Copy the content of SI-reg to AL

1041 INC AL Increment AL-register

Copy the content of AL reg to SI-


1043 MOV [SI],AL Reg

83

1045 CMP AL,3CH Compare AL with 3CH

1048 JNZ START Jump on no zero to start

104A MOV AL,0 Copy AL with data 00H

104D MOV [SI],AL Copy the content of AL reg to SI-

Reg

104F INC SI Increment SI-register

1050 MOV AL,[SI] Copy the content of SI-reg to AL

1052 INC AL Increment AL-register

1054 MOV [SI],AL Copy the content of AL reg to SI-

reg

1056 CMP AL,18H Compare AL with 18H

1059 JNZ START Jump on no zero to start

105B MOV AL,0 Copy AL with data 00H


105E MOV [SI],AL Copy the content of AL reg to SI-

reg

1060 JMP START Jump to start

1063 DISPLAY: MOV AH,06H Copy 06H to AH-register

1066 MOV DX,1600H Copy 1600H to DX-register

106A MOV CH,01H Copy 01H to CH-register

106D MOV CL,0H Copy 00H to CL-register

1070 INT 5 Call Interrupt

1072 RET Return from subroutine

1073 CONVERT: MOV SI,1500H Copy 1500H to SI-register

1077 MOV BX,1608H Copy 1608H to BX-register

107B MOV AL,24H Copy 24H to AL-register

107E MOV [BX],AL Copy the content of AL-reg to BX

1080 MOV AL,[SI] Copy the content of SI-reg to AL

1082 MOV AH,0 Copy AL with data 00H

1085 MOV DH,0AH Copy the data 0AH to DH-register

1088 DIV DH Divide DH-reg by AH reg

108A ADD AH,30H Add the data 30H with AH-reg

108D DEC BX Decrement BX-register

108E MOV [BX],AH Copy the data from AH to DH-

reg

1090 DEC BX Decrement BX-register


1091 ADD AL,30H Add the data 30H with AL-reg

1094 MOV [BX],AL Copy the data from AL to BX-reg

1096 DEC BX Decrement BX-register

1097 MOV AL,3AH Copy the 3AH to AL-reg

109A MOV [BX],AL Copy the data from AL to BX-reg

109C DEC BX Decrement BX-register

109D INC SI Increment SI-register

109E MOV AL,[SI] Copy the content of SI-reg to AL

10A0 MOV AH,0 Copy the data 0 to AH-reg

10A3 MOV DH,0AH Copy the data 0AH to DH-register

10A6 DIV DH Divide DH-reg by AH reg

84

10A8 ADD AH,30H Add the data 30H with AH-reg

10AB MOV [BX],AH Copy the data from AH to BX-

reg

10AD DEC BX Decrement BX-register

10AE ADD AL,30H Add the data 30H with AL-reg

10B1 MOV [BX],AL Copy the data from AL to BX-reg

10B3 DEC BX Decrement BX-register

10B4 MOV AL,3AH Copy the 3AH to AL-reg


10B7 MOV [BX],AL Copy the data from AL to BX-reg

10B9 DEC BX Decrement BX-register

10BA INC SI Increment SI-register

10BB MOV AL,[SI] Copy the content of SI-reg to AL

10BD MOV AH,0 Copy the data 0 to AH-reg

10C0 MOV DH,0AH Copy the data 0AH to DH-register

10C3 DIV DH Divide DH-reg by AH reg

10C5 ADD AH,30H Add the data 30H with AH-reg

10C8 MOV [BX],AH Copy the data from AH to BX-

reg

10CA DEC BX Decrement BX-register

10CB ADD AL,30H Add the data 30H with AL-reg

10CE MOV [BX],AL Copy the data from AL to BX-reg

10D0 RET Return from subroutine

10D1 GETC: IN AL,02H Copy 02H to AL-reg

10D3 AND AL,0FFH AND data AL with 0FFH

10D6 CMP AL,0F0H Compare AL with 0F0H

10D9 JNE GETC If no zero jump to getc

OUTPUT:

1500- 00 SECONDS

1501- 00 MINUTES

1502- 09 HOURS
Exp setup 30

Program 40

Output 20

Viva 10

Total 100

RESULT:

Thus an assembly language Program for 8086 microprocessor to verify the operation
of digital clock kit is written and executed and output is verified.
EXP.NO:21 DATE:

PRINTER STATUS

AIM:

To write and execute an assembly language program for printer interface with
microprocessor 8086 kit and to print a single character “A”.

APPARATUS REQUIRED:

1. 8086 microprocessor kit/MASM ----2


2. Centronics printer interface board ----1
3. Power card ----1
4. Keyboard ----1
PROGRAM:

00C8 DATA EQU 00C8H

00D0 CONTL EQU 00D0H

00C0 STUS EQU 00C0H

ADDRESS OPCODE LABEL MNEMONICS COMMENTS

1000 Org 1000h Starting address of the program

1000 B0 05 MOV AL,05H Load the AL-reg with value 05H

1002 E6 D0 OUT CONTL,AL Copy the contents of AL-reg to

CONTL

1004 E4 C0 IN AL,STUS Load the contents of STUS to AL-

register.

1006 24 20 AND AL,20H Logically AND the contents of AL-

reg with 20H

1008 3C 20 CMP AL,20H Compare the contents of AL-reg

with 20H

100A 75 44 JNZ ERR Jump on no-zero to label ERR


Exp setup 30

Program 40

Output 20

Viva 10

Total 100

RESULT:

Thus an assembly language program for printer interface to print a single


character “A” is written and executed and output is verified.

You might also like