home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / cpm / osborne / clock.lbr / OCLOCK.DZC / OCLOCK.DOC
Encoding:
Text File  |  1988-01-06  |  1.9 KB  |  67 lines

  1. OCLOCK -- a simple clock counter for the Osborne 1     page 1
  2.  
  3.  
  4. Copyright 1982  Michael M Rubenstein
  5.  
  6. This  document and the accompanying program  may  be 
  7. distributed  freely provided the copyright notice is 
  8. retained and no fee is charged.
  9.  
  10. OCLOCK  implements  a simple counting clock  on  the 
  11. Osborne  1.   The  clock consists of  two  bytes  at 
  12. location 000BH.  Once the command
  13.  
  14.           oclock
  15.  
  16. is executed, this location will be incremented every 
  17. 1/60  second until the system is cold booted or  the 
  18. command
  19.  
  20.           oclock off
  21.  
  22. is executed.  The clock's accuracy is limited by the 
  23. operating  system disabling interrupts for disk i/o.  
  24. Errors of 5-10% are typical during normal activity.
  25.  
  26. OCLOCK uses one page in high memory.  However, since 
  27. it locks the ccp into memory,  the net effect is  to 
  28. reduce the tpa by 2.25k.
  29.  
  30. OCLOCK  may be used with the Software Toolworks C/80 
  31. compiler cprof program to give an execution  profile 
  32. of  a c program.   Make sure TICCNT is defined as 11 
  33. in cprof (it is distributed that way,  but may  have 
  34. been  modified for no clock).   Follow the  Software 
  35. Toolworks  C/80  instructions for use of cprof  with 
  36. either AS or M80.
  37.  
  38. There is a bug in cprof which causes the profile  to 
  39. omit  some functions from the display,  but not from 
  40. the total time.   In particular,  if exit is called, 
  41. the  main  function  will not be  displayed  in  the 
  42. profile.   This  bug can be fixed by  inserting  the 
  43. line
  44.  
  45.      if (!q[-1]) q[-1] = 1;
  46. after the line
  47.  
  48.      for (q = LINKPT; q != -1; q = q[-3]) {
  49.  
  50. in  cprof.c.   If this patch is made,  the number of 
  51. calls displayed in the profile will be the number of 
  52. returns  that the function made,  except that  func-
  53. tions  which had never executed a return  when  exit 
  54. was called will have a count of one.
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.