ASSUME CS:CODE, DS:DATA
DATA SEGMENT
ORG 5000H
SERIES DB 35H,66H,11H,12H,22H,56H,8H,2H,1H,9H
COUNT DB 0AH
ODDCOUNT DB 00H
EVENCOUNT DB 00H
DATA ENDS
CODE SEGMENT
START: MOV AX, DATA
MOV DS, AX
LEA SI, SERIES
MOV CL, COUNT
NEXT: MOV AX, [SI]
ROR AX, 01
JNC EVENV
INC ODDCOUNT
JMP OTHER
EVENV: INC EVENCOUNT
OTHER: INC SI
DEC CL
JNZ NEXT
MOV AH, 4CH
INT 21H
CODE ENDS
END START
bro is it for 8 bit ?
ReplyDeleteThis for 8 bit.
Deletegood and thanks
ReplyDeleteWhy use int 21h
ReplyDeleteobserve the line before the int 21h
Deletewe are moving 4CH to the AH register and executing the INT 21H.
INT 21H is the interrupt handler available in the DOS. Its behavior is dependent on the data available in various registers.
The data available in AH register before executing INT 21H is 4CH.
4CH indicates terminate the program with code.
you can get more info at
https://en.wikipedia.org/wiki/MS-DOS_API
Needed explaination
ReplyDelete