ALP to find positive numbers and negative numbers in a given series
DATA SEGMENT
SERIES DB 12H, 13H, 22H, 23H, 32H
COUNT DB 05H
POS DB 01H DUP(?)
NEG 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]
SHL BL, CL
JC LOOP1
INC DL
JMP LOO3
LOOP1: INC DH
LOOP3: INC SI
LOOP3: INC SI
DEC BH
JNZ LOOP2
LEA DI, POS
MOV [DI], DL
LEA DI, NEG
MOV [DI], DH
MOV AH, 4CH
INT 21H
CODE ENDS
END START
No comments:
Post a Comment