]>
wirehaze git hosting - MS-DOS.git/blob - v2.0/source/PCLOCK.ASM
1 TITLE CLOCK
- Enable
/disable clock interrupts
3 ; "CLOCK" module for MS-DOS profile program. This implements the
4 ; PROFIL program on the Seattle Computer Products 8086 system
11 CODE SEGMENT BYTE PUBLIC
13 PUBLIC CLOCKON
,CLOCKOFF
,LEAVE_INT
17 ASSUME
CS:CODE, DS:CODE, ES:CODE
27 ;The following mode selects F2 as counter source (400 KHz), reload from
28 ;load, count up once in binary with TC toggle.
31 ;************************************************
32 ;Enable clock and start generating clock interrupt.
33 ; Clock interval in micro seconds passed in DX
35 MOV AL,4 ;Set pointer to mode register 4
37 MOV AL,MODE
AND 0FFH ;Low byte of mode
39 MOV AL,MODE
/100H
;High byte of mode
41 MOV AL,0CH ;Counter 4 load register
43 XCHG AX,DX ;Count in microseconds
46 RCL DX,1 ;Count in DX:AX times 2
51 OUT STCDATA
,AL ;Set the load register
52 MOV AL,0E4H ;Clear output 4
60 ;Set the clock interrupt
61 MOV INTVECTOR
,OFFSET CLK_INTER
68 AND AL,7FH
;Enable counter 4 interrupt
70 MOV AL,68H
;Load and arm counter 4
71 OUT STCCOMND
,AL ;Let her rip!
75 ;************************************************
76 ;Disable clock and clock interrupt
79 OR AL,80H
;Turn off counter 4 interrupt
85 ;************************************************
86 ;This routine is jumped to from the CLK_INTER
87 ; routine to perform and steps to reset the interrupt
90 MOV AL,0E4H ;Clear output 4
92 MOV AL,20H
;End-of-interrupt command
95 MOV AL,68H
;Load and arm counter 4