home *** CD-ROM | disk | FTP | other *** search
- FUNCTION Time : REAL;
-
- { Function to demonstrate method of grabbing the 200 hz timer in
- system varialbes area ($4BA)
- Sept. 25, 1986 by M. Curry }
- { Note from Jinfu Chen:
- You can use the built-in function CLOCK in Personal Pascal for less timing
- sensitive application as CLOCK only gives 2 second resolution }
-
- TYPE
- Long_Pointer = ^Long_Integer ;
-
- VAR
- SSP : Long_Integer ;
- hz_200 : RECORD
- CASE BOOLEAN OF
- TRUE : ( l : Long_Integer ) ;
- FALSE : ( p : Long_Pointer ) ;
- END ;
-
- FUNCTION Super( x : long_Integer ) : Long_Integer ;
- GEMDOS($20) ;
- { GEMDOS routine }
-
- BEGIN
- SSP := Super( 0 ) ; {save old supervisor stack and enter super mode}
- hz_200.l := $4ba ; {point at 200 hertz timer}
- {$P-} {turn pointer checking off}
- Time := hz_200.p^ / 200 ; {get the longword at that location and convert it}
- {to second}
- {$P+} {restore old value of pointer checking}
- SSP := Super( SSP ) ; {restore supervisor stack and enter user mode}
- END;
-