C DEVCOMFTN.FTN JFH 24-NOV-81 PROGRAM DEVCOM C James F. Harrison, MP-1, MS 828, Los Alamos National Lab, C Los Alamos, NM 87545 (505) 667-5688 C This program is an example of the use of RSX11M device commons. C C A programmable clock is used to time a section of code. C In the first case MACRO subroutines are used to turn the clock C on and off. In the second case I/O page registers are manipulated C directly from this Fortran program. Note the line frequency clock C is turned off during the execution of the code to be timed. BYTE IOPAG INTEGER*2 TIME,CSR,CSB,CTR,LKS COMMON /IOPAGE/IOPAG(8192) ! Must use 8190 or less if APR 7 ! maps I/O page C Programmable clock registers (must add 1 since Fortran starts array C index with 1 instead of 0) EQUIVALENCE (IOPAG("12541),CSR) ! Control and status (17772540) EQUIVALENCE (IOPAG("12543),CSB) ! Count set buffer EQUIVALENCE (IOPAG("12545),CTR) ! Counter C Line frequency clock register EQUIVALENCE (IOPAG("17547),LKS) ! Control and status (17777546) C *** CASE 1 C Start the programmable clock CALL START C Beginning of code to be timed DO 100 I=1,100 100 CONTINUE C End of code to be timed -- stop the programmable clock CALL STOP(TIME) C Type out time to execute code TYPE 200,TIME 200 FORMAT(1X,I6,'0 MICRO SECONDS') C *** CASE 2 C Turn clock on from Fortran program LKS=0 ! turn line frequency clock off CSB=0 ! clear count set buffer CSR="21 ! count up, 100KHZ, start clock DO 300 I=1,100 300 CONTINUE CSR=0 ! stop clock LKS="100 ! turn line frequency clock on C type out time to execute code TYPE 200,CTR STOP END