This program is used to initialize counter 2 of 8253 in mode 0 with a count of FFAAH
CODE:
COUNTER PROC NEAR
CNT2 EQU 8002H ; ADDRESS OF COUNTER 2
CNTR EQU 8003H ; ADDRESS OF CONTROL REGISTER
MOV AL, B0H ; CONTROL WORD
OUT CNTR, AL
MOV AL, AAH ; INITIALIZING COUNT FFAAH
OUT CNTR2, AL
MOV AL, FFH ; INITIALIZING COUNT FFAAH
OUT CNTR2, AL
READ: MOV AL, 80H ; FOR READING THE COUNT
OUT CNTR, AL
IN AL, CNT2
MOV DL, AL
IN AL, CNT2
OR AL, DL
JNZ READ
RET
COUNTER ENDP
The below table can be referred for better understanding:
If you are satisfied with the above solution please give it a THUMBS UP!!!
Get Answers For Free
Most questions answered within 1 hours.