home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / C / SASC6571.LZX / rexx / memory.cpr < prev    next >
Encoding:
Text File  |  1996-12-24  |  860 b   |  31 lines

  1. /* Display the Memory regions */
  2. address 'COMMAND'
  3. 'version >nil: exec.library 36 '
  4. lrc = rc
  5.  
  6. if (rc = 0) then
  7.   check = addlib('rexxsupport.library',0,-30,0) 
  8.  
  9. address
  10.  
  11. NULL = "00000000"x
  12. execbase = next("00000004"x)
  13. liboff = 322
  14. nodebase = import(offset(execbase, liboff), 4)
  15.  
  16. do while(import(nodebase,4) ~= NULL)
  17.    attr  = 'attr' c2x(import(offset(nodebase,14),2))
  18.    lower = 'lower' c2x(import(offset(nodebase,20),4))
  19.    upper = 'upper' c2x(import(offset(nodebase,24),4))
  20.    first = import(offset(nodebase,16),4)
  21.    free  = 'free' c2d(import(offset(nodebase,28),4))||'.'
  22.    'd "'||c2x(nodebase) attr lower upper 'first' c2x(first) free||'"'
  23.    do while (first ~= NULL)
  24.       size = import(offset(first,4),4)
  25.       'd "  ' c2x(first) ' size' c2x(size) '('||c2d(size)||'.)"'
  26.       first = import(first,4)
  27.    end
  28.    nodebase = import(nodebase,4)
  29. end
  30. exit(0)
  31.