0% found this document useful (0 votes)
76 views

EEE316-8086 Microprocessor Assignment

The document contains 3 assembly code programs that perform different tasks: 1. Determines if a number is greater than, equal to, or less than 5 and stores the result in DX. 2. Subtracts two numbers and stores 0 in CX if there is overflow, or 1 if no overflow. 3. Performs addition, subtraction, or negation on two numbers based on different comparisons of the numbers with 1000H and 100H.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
76 views

EEE316-8086 Microprocessor Assignment

The document contains 3 assembly code programs that perform different tasks: 1. Determines if a number is greater than, equal to, or less than 5 and stores the result in DX. 2. Subtracts two numbers and stores 0 in CX if there is overflow, or 1 if no overflow. 3. Performs addition, subtraction, or negation on two numbers based on different comparisons of the numbers with 1000H and 100H.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Home Task : 1

Write an assembly code that will determine whether a number is greater than 5 or equal of less,
and put 0 or 1 or 2 for the conditions in DX.

ASSEMBLY CODE:
CODE SEGMENT
ASSUME CS:CODE,DS:CODE
ORG 1000H
MOV AX,5H
MOV BX,3H
CMP AX,BX
JG AAA
JE BBB
JL CCC
AAA:

MOV DX,0H
JMP LAST

BBB:

MOV DX,1H
JMP LAST

CCC:

MOV DX,2H
JMP LAST

LAST: INT 3
CODE ENDS
END

Home Task : 2
Subtract 86B1H from 3F42H and store 0 in CX if overflow occurs and 1 if no overflow occurs.

ASSEMBLY CODE:
CODE SEGMENT
ASSUME CS:CODE,DS:CODE
ORG 1000H
MOV AX,3F42H
MOV BX,86B1H
SUB

AX,BX

JO OVERFLOW
MOV CX,1
JMP LAST

OVERFLOW: MOV CX,0


JMP LAST
LAST: INT 3
CODE

ENDS
END

Home Task : 3
Take 2 arbitrary numbers x and y. If x>1000H perform x+y. If y<1000H perform x-y. If
x>1000H and y<100H perform x = x.

ASSEMBLY CODE:
CODE SEGMENT
ASSUME CS:CODE,DS:CODE
ORG 1000H
MOV AX,1001H
MOV BX,2002H

CMP AX,1000H
JG

TASK1

CMP BX,1000H
JL TASK3

TASK1:

CMP BX,100H
JL

TASK2

ADD AX,BX
JMP LAST
TASK2:

NOT AX
JMP LAST

TASK3:

SUB AX,BX
JMP LAST

LAST:

INT 3

CODE

ENDS
END

You might also like