Write a program in assembly language(8086) to find the average of two values stored in memory locations named FIRST and SECOND.
DATA SEGMENT
FIRST DB 90h
SECOND DB 78h
AVGE DB ?
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE, DS:DATA
START:
MOV AX, DATA
MOV DS, AX
MOV AL, FIRST
ADD AL, SECOND
MOV AH, 00h
ADC AH, 00h
MOV BL, 02h
DIV BL
MOV AVGE, AL
CODE ENDS
END START
No comments:
Post a Comment