TIM_8253_BASE EQU 080H
TIM_COUNT0 EQU TIM_8253_BASE+00H*2
TIM_COUNT1 EQU TIM_8253_BASE+01H*2
TIM_COUNT2 EQU TIM_8253_BASE+02H*2
TIM_MODE EQU TIM_8253_BASE+03H*2
TIM_MODE0_VALUE EQU 16H
TIM_COUNT0_VALUE EQU 20
CODES SEGMENT
ASSUME CS:CODES,DS:DATAS,SS:STACKS
START:
MOV DX, TIM_MODE ; 定时器方式控制字
MOV AL, TIM_MODE0_VALUE
OUT DX, AL
MOV DX,TIM_COUNT0 ;装入计数初值
MOV AL,TIM_COUNT0_VALUE
OUT DX, AL
CODES ENDS
END START