You are on page 1of 7

EEE 312 (Microprocessor and Interfacing Lab ) Experiments:

Experiment 01: Familiarization with MDA-8086 microprocessor kit and its operation in “Machine
Code” mode.

Operation in "machine code" mode , Assembly code :

MOV AX,1234H

MOV BX,5678H

Experiment 02 : Addition of two Hexadecimal numbers in 8086 Microprocessor.

Assembly code :

MOV AX,1234H

MOV BX,5678H

ADD AX,BX

Experiment 03: Logical operations (AND, OR,NOT,XOR,TEST) in 8086 Microprocessor.

Assembly code :

MOV AX,2053H ;----0010000001010011B

MOV BX,3167H ;----0011000101100111B

AND AX,BX

;OR AX,BX

;NOT AX

;NOT BX

;XOR AX,BX

;TEST AX,BX
Experiment 04 : Perform the logical operation of the following function:

(A+(B⊕C)).D

Also find the 2's complement of the result.

Where, A=21H; B=11H;C=35H; D=57H

Assembly code:

MOV AX,21H

MOV BX,11H

MOV CX,35H

MOV DX,57H

XOR BX,CX

OR AX,BX

AND AX,DX

NEG AX

EXP. 05: Summation of following series in 8086 microprocessor.

3+6+9+................+42

Assembly code:

MOV AX,3

MOV BX,6

MOV CX,13

start:

ADD AX,BX

ADD BX,3

LOOP start
EXP. 06 : FIND THE FACTORIAL OF N in Intel 8086 microprocessor.

;FACTORIAL OF N=1*2*3*...*N

Assembly code:

MOV BX,6 ; FACTORIAL OF 6!=1*2*3*4*5*6=720d

MOV AX,1

MOV CX,5

START:

MUL BX ; BX*AX =AX

DEC BX

LOOP START

EXP.07: Logical Shift (Shift right and Shift Left) operations in 8086 microprocessor.

Assembly code:

MOV AX,1234H

MOV CL,03H

SHL AX,CL ;Shift left

;SHR AX,CL ; Shift right

EXP.08: Logical Rotate (Rotate right and Rotate Left) operations in 8086 microprocessor.

Assembly code:

MOV AX,213BH

MOV CL,02H

ROR AX,CL ;LSB is transferred to MSB

;ROL AX,CL ;MSB is transferred to LSB


EXP.09: PUSH POP operations in 8086 microprocessor.

Assembly code:

MOV AX, 3A02H

MOV BX, 9717H

MOV CX, 2C3CH

PUSH BX

XOR AX,BX

AND AX,CX

NEG AX

PUSH AX

POP BX

POP CX

EXP. 10: Exchange 3rd and 7th Element of an ARRAY in 8086 microprocessor.

Assembly code:

ARRAY1 DW 1027H, 2017H, 3055H, 3 DUP (0), 9736H

MOV CX,7

XOR SI,SI

LEA SI, ARRAY1

MOV AX, [SI+4] ; AX=3055H

MOV BX, [SI+12] ;BX=9736H

XCHG AX, BX ; After the Exchange AX= 9736H ,BX=3055H

MOV [SI+4], AX ; [SI+4]= 9736H

MOV [SI+12], BX ; [SI+12]=3055H


EXP. 11: Summation of all the elements of an array in 8086 microprocessor.

Assembly code:

ARRAY1 DB 1,4,5,1,5,7,6,3,9

MOV CX,9

XOR SI,SI

LEA SI, ARRAY1

MOV AL,0

LEVEL:

ADD AL,[SI]

INC SI

LOOP LEVEL

EXP. 12: Summation of array elements of DW ARRAY (WORD array) in 8086 microprocessor.

Assembly code:

.DATA

MYARRAY DW 1,2,5,9,3,7,5,4,6,4,8,4 ;DW - Define word

.CODE

MOV AX,@DATA

MOV DS,AX

MOV SI,0

MOV CX,12

MOV AX,0

START:

MOV DX,MYARRAY[SI]

INC SI

INC SI

ADD AX,DX

LOOP START
EXP.13: Increase all the elements of an array by 1 in 8086 microprocessor.

Assembly code:

ARRAY1 DB 1,4,5,1,5,7,6

MOV CX,7

XOR SI,SI

LEA SI, ARRAY1

LEVEL:

MOV AL,[SI]

ADD AL,1

MOV [SI],AL

INC SI

LOOP LEVEL

EXP. 14: Determine the Length of an ARRAY in 8086 microprocessor.

Assembly code:

ARRAY DB 0BH, 01BH, 02BH, 03H, 04H, 05H, 06H

LEN DB $-ARRAY

MOV AL, LEN

EXP. 15: To display the character 'A' on the screen.

Assembly code:

MOV DL,'A' ;DL='A'

MOV AH,2h ;character output subprogram

INT 21h ; call ms-dos output character


EXP. 16: For 7 times Do display '# '

Assembly code:

MOV CX,7

MOV AH,2

MOV DL,'#'

START:

INT 21H

LOOP START

You might also like