OCLOCK -- a simple clock counter for the Osborne 1 page 1 Copyright 1982 Michael M Rubenstein This document and the accompanying program may be distributed freely provided the copyright notice is retained and no fee is charged. OCLOCK implements a simple counting clock on the Osborne 1. The clock consists of two bytes at location 000BH. Once the command oclock is executed, this location will be incremented every 1/60 second until the system is cold booted or the command oclock off is executed. The clock's accuracy is limited by the operating system disabling interrupts for disk i/o. Errors of 5-10% are typical during normal activity. OCLOCK uses one page in high memory. However, since it locks the ccp into memory, the net effect is to reduce the tpa by 2.25k. OCLOCK may be used with the Software Toolworks C/80 compiler cprof program to give an execution profile of a c program. Make sure TICCNT is defined as 11 in cprof (it is distributed that way, but may have been modified for no clock). Follow the Software Toolworks C/80 instructions for use of cprof with either AS or M80. There is a bug in cprof which causes the profile to omit some functions from the display, but not from the total time. In particular, if exit is called, the main function will not be displayed in the profile. This bug can be fixed by inserting the line if (!q[-1]) q[-1] = 1; after the line for (q = LINKPT; q != -1; q = q[-3]) { in cprof.c. If this patch is made, the number of calls displayed in the profile will be the number of returns that the function made, except that func- tions which had never executed a return when exit was called will have a count of one.