home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / BEEHIVE / UTILITYS / BITS.ARC / SHOWMEM.CMD < prev    next >
OS/2 REXX Batch file  |  1990-07-21  |  5KB  |  153 lines

  1. *
  2. *               showmem.cmd
  3. *
  4. *               This command module is used to display memory
  5. *               on the console.  Only printable characters show,
  6. *               non-printable characters are shown as a period.
  7. *               Memory is displayed in 64-byte chunks.
  8. *
  9. set echo off
  10. set talk off
  11. set bell off
  12. erase
  13. *
  14. *       display memory
  15. *
  16. store '0123456789ABCDEF' to hextable
  17. store ' ' to line
  18. store '    ' to start
  19. store '    ' to end
  20. store t to reading
  21. do while reading
  22.     erase
  23.     store t to badans
  24.     do while badans
  25.         @ 1,0 say '       To exit this function enter XXXX  '
  26.         @ 2,0 say 'Enter the starting address to display (in hex 0-F) ===>';
  27.               get start;
  28.               picture '!!!!'
  29. *
  30.         read
  31. *
  32.         if  start = 'XXXX'
  33.             return
  34.         endif  start
  35. *
  36.         @ 3,0 say 'Enter the ending address to display   (in hex 0-F) ===>';
  37.               get end;
  38.               picture '!!!!'
  39. *
  40.         read
  41. *
  42.         store $(start,1,1) to start1
  43.         store $(start,2,1) to start2
  44.         store $(start,3,1) to start3
  45.         store $(start,4,1) to start4
  46. *
  47.         store $(end,1,1)   to end1
  48.         store $(end,2,1)   to end2
  49.         store $(end,3,1)   to end3
  50.         store $(end,4,1)   to end4
  51. *
  52.         store @(start1,hextable)  to st1
  53.         store @(start2,hextable)  to st2
  54.         store @(start3,hextable)  to st3
  55.         store @(start4,hextable)  to st4
  56. *
  57.         store @(end1,hextable)    to en1
  58.         store @(end2,hextable)    to en2
  59.         store @(end3,hextable)    to en3
  60.         store @(end4,hextable)    to en4
  61. *
  62.         if  st1 = 0 .or.;
  63.             st2 = 0 .or.;
  64.             st3 = 0 .or.;
  65.             st4 = 0 .or.;
  66.             en1 = 0 .or.;
  67.             en2 = 0 .or.;
  68.             en3 = 0 .or.;
  69.             en4 = 0     
  70.             store t to badans
  71.             @ 23,0 say 'ERROR - use only 0-F to enter the address'
  72.         else
  73.         store f to badans
  74.             @ 23,0 say '                                         '
  75.         endif  st1/en1
  76. *
  77.     enddo  badans
  78. *
  79.     store (st1-1)*(16*16*16) to saddr1
  80.     store (st2-1)*(16*16)    to saddr2
  81.     store (st3-1)*(16)       to saddr3
  82.     store (st4-1)            to saddr4
  83. *
  84.     store saddr1 + saddr2+ saddr3 + saddr4 to saddr
  85. *
  86.     store (en1-1)*(16*16*16) to eaddr1
  87.     store (en2-1)*(16*16)    to eaddr2
  88.     store (en3-1)*(16)       to eaddr3
  89.     store (en4-1)            to eaddr4
  90. *
  91.     store eaddr1 + eaddr2 + eaddr3 + eaddr4 to eaddr
  92. *
  93.     erase
  94.     ? 'Displaying from &start hex to &end hex'
  95.     ? '       Press escape to interrupt'
  96.     ? ' '
  97.     store 0 to cnt
  98.     store ' ' to line
  99.     do while cnt < (eaddr - saddr)
  100.         do while len(line) < 65
  101.             store chr(peek(saddr+cnt)) to byte
  102.             if  byte < ' ' .or.;
  103.                 byte > '~'
  104.                 store '.' to byte
  105.             endif  byte
  106. *
  107.             store line + byte to line
  108.             store cnt + 1 to cnt
  109.         enddo  line
  110. *
  111.         ? '===>' + $(line,2,64) + '<==='
  112.         store ' ' to line
  113.     enddo  cnt
  114. *
  115.     store ' ' to ans
  116.     set intensity off
  117.     set colon off
  118.     ? ' '
  119.     ? ' '
  120.     ? 'Press any key to continue'
  121.     @ 0,0 get ans
  122. *
  123.     read
  124. *
  125.     set intensity on
  126.     set colon on
  127. *
  128. enddo reading
  129.           store line + byte to line
  130.             store cnt + 1 to cnt
  131.         enddo  line
  132. *
  133.         ? '===>' + $(line,2,64) +       showmem.cmd
  134. *
  135. *               This command module is used to display memory
  136. *               on the console.  Only printable characters show,
  137. *               non-printable characters are shown as a period.
  138. *               Memory is displayed in 64-byte chunks.
  139. *
  140. set echo off
  141. set talk off
  142. set bell off
  143. erase
  144. *
  145. *       display memory
  146. *
  147. store '0123456789ABCDEF' to hextable
  148. store ' ' to line
  149. store '    ' to start
  150. store '    ' to end
  151. store t to reading
  152. do while reading
  153.     er÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷