Implement the following operation in assembly program for IA
Implement the following operation in assembly program for IA-32 without using mul & div instructions (7(AX) - 5(BX) - (BX/8)) rightarrow AX Write a assembly program for IA-32 to count up the number of even numbers in the memory locations from 00000 to 000FF.
Solution
DATA SEGMENT
A DW 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 (// where 10->a,11->b, 12->c, 13->d,14->e,15->f => from 00000 to 000FF)
DATA ENDS
CODE SEGMENT
ASSUME DS:DATA1,CS:CODE
START:
MOV AX,DATA1
MOV DS,AX
LEA SI,A
MOV DX,0000
MOV BL,02
MOV CL,10
Lone:MOV AX,WORD PTR[SI]
DIV BL
CMP AH,00
JNZ Ltwo
INC DH
JMP Lthree
Ltwo:INC DL
Lthree:
ADD SI,2
DEC CL
CMP CL,00
JNZ Lone
MOV AH,4CH
INT 21H
CODE ENDS
END START
