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 / POKE1.CMD < prev    next >
OS/2 REXX Batch file  |  1990-07-21  |  4KB  |  125 lines

  1. *
  2. *               poke1.cmd
  3. *
  4. set echo off
  5. set talk off
  6. erase
  7. *
  8. *       display current fcb
  9. *
  10. store (5*16)+13 to fcb1
  11. store 0         to count
  12. store ' '       to s
  13. *
  14. do  while count<12
  15.     store s+chr(peek(fcb1+count)) to s
  16.     store count+1                 to count
  17. enddo  count
  18. *
  19. store len(s) to lenofs
  20. @ 10,0  say 'Current fcb ===>'+$(s,2,lenofs)+'<==='
  21. *
  22. *        blank the fcb
  23. poke fcb1,32,32,32,32,32,32,32,32,32,32,32,0,0,0,0,0
  24. *
  25. store 0         to count
  26. store ' '       to s
  27. *
  28. do  while count<12
  29.     store s+chr(peek(fcb1+count)) to s
  30.     store count+1                 to count
  31. enddo  count
  32. @ 12,0  say 'fcb after poke ===>'+'&s'+'<==='
  33. *
  34. *        get parameters for called pgm
  35. *
  36. *store 'abc def **' to param
  37. store '                    ' to param
  38. @ 23,0 say 'Enter a string to use in the poke';
  39.        get param
  40. *
  41. read
  42. *
  43. *
  44. *        truncate, capitalize for CP/M
  45. *
  46. store trim(param) to param
  47. ****store !(param)    to param
  48. *
  49. *        convert ascii to decimal
  50. *
  51. store ' !"#$%&'       to tab1a
  52. store chr(39) to tab1b
  53. store '()'  to tab1c
  54. store '*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`' to tab2
  55. store 'abcdefghijklmnopqrstuvwxyz{|}~' to tab3
  56. store tab1a + tab1b + tab1c + tab2 + tab3 to table
  57. *
  58. store 31   to base
  59. store ' '  to dstring
  60. store 0    to pointer
  61. *
  62. do  while pointer<len(param)
  63.     store $(param,pointer+1,1)               to srchchar
  64.     store @(srchchar,table)                  to position
  65.     store dstring+str(position+base,3) + ',' to dstring
  66.     store pointer + 1                        to pointer
  67. *   ? 'srchchar=',srchchar
  68. *   ? 'position=',position
  69. *   wait
  70. enddo  pointer
  71. *
  72. *        take off last comma
  73. *
  74. store len(dstring)        to leng
  75. store $(dstring,1,leng-1) to dstring
  76. *
  77. *        poke the fcb
  78. *
  79. store 5*(16)+13 to fcb1
  80. poke fcb1,&dstring
  81. *
  82. store 0         to count
  83. store ' '       to s
  84. *
  85. do  while count<len(param)
  86.     store s+chr(peek(fcb1+count)) to s
  87.     store count+1                 to count
  88. enddo  count
  89. @ 14,0 say 'fcb after param poke ===>'+'&s'+'<==='
  90. *
  91. *        set up the call address
  92. *
  93. store 10*(16*16*16)  to ca
  94. store ca+(4*(16*16)) to ca
  95. set call to ca
  96. store 'dummy' to adress 
  97. *
  98. *        do the call
  99. *
  100. *   call adress
  101. return
  102. +tab3 to table
  103.  
  104. *
  105. store 31   to base
  106. store ' '  to dstring
  107. store 0    to pointer
  108. *
  109. do  while pointer<len(param)
  110.     store $(param,pointer+1,1)               to srchchar
  111.     store @(srchchar,table)                  to position
  112.     store dstring+str(position+ba='
  113. *
  114. *        set up the call address
  115. *
  116. store 10*(16*16*16)  to ca
  117. store ca+(4*(16*16)) to ca
  118. set call to ca
  119. store 'dummy' to adress 
  120. *
  121. *        do the call
  122. *
  123. *   call adress
  124. return
  125. ÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷