ALP to find even numbers and odd numbers in a given series
DATA
SEGMENT
SERIES
DB 12H, 13H, 22H, 23H, 32H
COUNT DB 05H
EVEN DB 01H DUP(?)
ODD DB 01H DUP(?)
DATA
ENDS
CODE
SEGMENT
START: MOV AX, DATA
MOV DS, AX
XOR DX, DX
XOR BX, BX
MOV
BH, COUNT
MOV
CL, 01H
LEA
SI, SERIES
LOOP2: MOV BL, [SI]
SHR
BL, CL
JC
LOOP1
INC
DL
JMP LOO3
LOOP1: INC DH
LOOP3: INC SI
LOOP3: INC SI
DEC
BH
JNZ
LOOP2
LEA
DI, EVEN
MOV
[DI], DL
LEA
DI, ODD
MOV
[DI], DH
MOV AH, 4CH
INT 21H
CODE ENDS
END START
No comments:
Post a Comment