Write a assembly program for IA32 to count up the number of
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 (00000 to 000FF)
DATA ENDS
CODE SEGMENT
ASSUME DS:DATA,CS:CODE
START:
MOV AX,DATA
MOV DS,AX
LEA SI,A
MOV DX,0000 (starting from the address 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
