Professional Documents
Culture Documents
EEE 312 LAb Experiments With Assembly Code
EEE 312 LAb Experiments With Assembly Code
Experiment 01: Familiarization with MDA-8086 microprocessor kit and its operation in “Machine
Code” mode.
MOV AX,1234H
MOV BX,5678H
Assembly code :
MOV AX,1234H
MOV BX,5678H
ADD AX,BX
Assembly code :
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
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
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 AX,1
MOV CX,5
START:
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
EXP.08: Logical Rotate (Rotate right and Rotate Left) operations in 8086 microprocessor.
Assembly code:
MOV AX,213BH
MOV CL,02H
Assembly code:
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:
MOV CX,7
XOR SI,SI
Assembly code:
ARRAY1 DB 1,4,5,1,5,7,6,3,9
MOV CX,9
XOR SI,SI
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
.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
LEVEL:
MOV AL,[SI]
ADD AL,1
MOV [SI],AL
INC SI
LOOP LEVEL
Assembly code:
LEN DB $-ARRAY
Assembly code:
Assembly code:
MOV CX,7
MOV AH,2
MOV DL,'#'
START:
INT 21H
LOOP START