0% found this document useful (0 votes)
95 views5 pages

MPMC 4 Programs

The document describes four assembly language programs written for the 8086 microprocessor to perform various operations: 1. Logical manipulations like AND, OR, XOR and NOT on data stored in registers and memory. 2. Transfer of a block of data from one memory location to another without overlap using index registers and a loop. 3. Conversion of a hexadecimal number to its equivalent ASCII value by adding constants to the register value. 4. Addition of two BCD numbers in memory by manipulating the values in registers and storing the result back in memory.

Uploaded by

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

MPMC 4 Programs

The document describes four assembly language programs written for the 8086 microprocessor to perform various operations: 1. Logical manipulations like AND, OR, XOR and NOT on data stored in registers and memory. 2. Transfer of a block of data from one memory location to another without overlap using index registers and a loop. 3. Conversion of a hexadecimal number to its equivalent ASCII value by adding constants to the register value. 4. Addition of two BCD numbers in memory by manipulating the values in registers and storing the result back in memory.

Uploaded by

Jansi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

1.

Logical Manipulations (AND, OR, XOR, NOT)

AIM:
To write an assembly language program to perform logical manipulations using 8086
microprocessor instructions.

APPARATUS REQUIRED:
1. 8086-Microprocessor Kit.
2. DC Power supply – 5V.
ALGORITHM:
1. Initialize the SI register and store the data.
2. Move the contents from memory to AH and AL registers.
3. Perform AND, OR, NOT and XOR operations based on the values stored in AH and AL
register.
4. Store the results in the memory location.

PROGRAM:
MOV SI,1200
MOV AH,[SI]
MOV AL,[SI+1]
AND AH,0FH
OR AH,20H
XOR AH,AL
NOT AH
MOV [SI+2],AH
HLT

OBSERVATION:
Input Output
Address Data Address Data
1200 03 1202 D9

1201 05

RESULT:
Thus the assembly language program for performing various logical
operationsusing 8086 was executed and verified successfully .
1
2. Move a data block without overlap

AIM:
To write an assembly language program to move a block of data from one memory location
to another without overlap.

APPARATUS REQUIRED:
1. 8086-Microprocessor Kit.
2. DC Power supply – 5V.
ALGORITHM:
1. Initialize the address register.
2. Initialize a count for number of elements to be transferred in register CL.
3. Load the contents in SI and DI index register.
4. Move the contents from register SI to DI.
5. Till the counter reaches zero, repeat step 4.

PROGRAM:
MOV SI, 1200
MOV CL, [1200]
MOV DI, 1500
INC SI
LOOP1: LODSB
MOV [DI], AL
INC DI
DEC CL
JNZ LOOP1
HLT

OBSERVATION:
Input Output
Addres Data Address Data
s
1200 04 1500 05

1201 05 1501 07

1202 07 1502 0A

1203 0A 1503 FF

1204 FF

RESULT:
Thus the assembly language program for block transfer of data without overlap
using 8086 was executed and verified successfully.

2
3. HEX to ASCII Conversion

AIM:
To write an assembly language program to convert a hexadecimal number to its equivalent
ASCII value.

APPARATUS REQUIRED:
1. 8086-Microprocessor Kit -1.
2. DC Power supply – 5V.
ALGORITHM:
1. Loads register AL with input data(HEX value).
2. Compare the input data with 0A.
3. Check if AL<0A, if so add 30 with register AL else goto step 4.
4. Add 7 with the register AL.
5. Store the result in register AL.
PROGRAM:
MOV SI, 2000
MOV AL, [SI]
CMP AL, 0AH
JC NEXT
ADD AL, 07H
JMP END
NEXT: ADD AL, 30H
END:MOV [SI+1], AL
HLT

OBSERVATION:
Input Output
Address Data Address Data
2000 05 2001 35

RESULT:
Thus the assembly language program for Hex to ASCII conversion using 8086 was
executed and verified successfully.

3
4. BCD Addition

AIM:
To write an assembly language program for performing addition and subtraction of two
BCD numbers using 8086 microprocessor.

APPARATUS REQUIRED:
1. 8086-Microprocessor Kit -1.
2. DC Power supply – 5V.
ALGORITHM:
1. Initialize the pointer to memory for data and result.
2. Load CL with count.
3. Add two matrices by each element.
4. Store the result into memory.
PROGRAM:
MOV SI, 3000H
       MOV AH,[SI]     
MOV AL, [SI+1]
       MOV DI, 4000H           
MOV BH,[DI]
MOV BL, [DI+1]
       ADD      AL, BL            
       DAA                        
       MOV     BL, AL            
       ADC      AH, BH          
       MOV     AL, AH           
       DAA                        
       MOV     BH, AL                                
       MOV     CH, 04H        
       MOV     CL, 04H
L2:ROL       BX, CL           
       MOV     DL, BL           
       AND      DL, 0FH
       CMP     DL, 09          
       JBE       L4
       ADD      DL, 07          
L4: ADD      DL, 30H
       DEC      CH               
       JNZ       L2
MOV [SI+2], BH
MOV [SI+3], BL
       HLT

4
OBSERVATION:
Input Output
Address Data Address Data Address Data
3000 36 4000 47 3002 83

3001 29 4001 38 3003 67

RESULT:
Thus the assembly language program for BCD addition and subtraction using 8086
was executed and verified successfully.

You might also like