home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 3 Comm / 03-Comm.zip / debugo.zip / MEMCOUNT.CMD < prev    next >
OS/2 REXX Batch file  |  1994-04-04  |  1KB  |  66 lines

  1. /* Sample REXX program for use with Debugo */
  2. /* Get memory page count report. Works on 2.1 debug kernel */
  3.  
  4. parse arg .
  5.  
  6.  
  7. if "DEBUGO" <> translate(address()) then do
  8.   say 'Expected Debugo environment.'
  9.   exit 0
  10. end
  11.  
  12. say ""
  13.  
  14. /* push to send command to debug kernel */
  15. push "dd _pgphyspages l1"
  16.  
  17. /* get all the lines the debug kernel has to send */
  18. /* use debugo special function sz = getline() to get them */
  19. i = 0
  20. do while queued() > 0
  21.   i = i + 1
  22.   select
  23.     when i=2 then szPhys = word( getline(), 2 )
  24.     otherwise junk = getline()
  25.   end
  26. end
  27.  
  28. push "dd _pgresidentpages l1"
  29. i = 0
  30. do while queued() > 0
  31.   i = i + 1
  32.   select
  33.     when i=2 then szRes = word( getline(), 2 )
  34.     otherwise junk = getline()
  35.   end
  36. end
  37.  
  38. push "dd _pgswappablepages l1"
  39. i = 0
  40. do while queued() > 0
  41.   i = i + 1
  42.   select
  43.     when i=2 then szSwap = word( getline(), 2 )
  44.     otherwise junk = getline()
  45.   end
  46. end
  47.  
  48. push "dd _pgdiscardablepages l1"
  49. i = 0
  50. do while queued() > 0
  51.   i = i + 1
  52.   select
  53.     when i=2 then szDis = word( getline(), 2 )
  54.     otherwise junk = getline()
  55.   end
  56. end
  57.  
  58. sum = 0
  59.  
  60. say 'Physical      ' szPhys
  61. say 'Resident      ' szRes
  62. say 'Swappable     ' szSwap
  63. say 'Discardable   ' szDis
  64. say 'Sum of resident, swappable, discardable:' d2x( x2d(szDis) + x2d( szRes ) + x2d( szSwap ) )
  65. return 0
  66.