TimerDemo: set up and initiate count
; timerdemo an 8088 assembly language program to illustrate
; use of timer 2 of the 8253 inside a PC
mov dx, pcctcw ; set up dx for control word
mov al, 10110100xb ; counter 2, least/most, mode2, binary
mov dx, pcct2 ; set up dx to load initial count
mov al, 0ffh ; initial count will be 0ffffh
out dx, al ; low byte of count
out dx, al ; high byte of count
mov dx, pcchb ; this block changes only PB0 and causes a positive edge
in al, dx ; read current status of port b
and al, 11111110xb ; pb0 = 0, others unchanged
or al, 1 ; pb0 = 1, others unchanged
out dx, al ; positive edge starts count