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

  1. /* */
  2.  
  3. if "Debugo" <> address() then do
  4.   say 'Execute from Debugo.'
  5.   exit 0
  6. end
  7.  
  8.  
  9. push "ln"
  10. i = 0
  11. do while queued() > 0
  12.   i = i + 1
  13.   select
  14.     when i = 2 then nearestsymbol = getline()
  15.     otherwise junk = getline()
  16.   end
  17. end
  18.  
  19. nPos = pos( "OS2_PM_DRV_ENABLE", nearestsymbol )
  20.  
  21. if nPos = 0 then do
  22.   say 'Expected ENABLE to be nearest symbol'
  23.   exit 0
  24. end
  25.  
  26. n = length( nearestsymbol ) - nPos
  27.  
  28. if pos( '+', right( nearestsymbol, n )) > 0 then do
  29.   /* get value of ebp */
  30.   push "? ebp"
  31.   i = 0
  32.   do while queued() > 0
  33.     i = i + 1
  34.     select
  35.       when i = 2 then EBP = word( getline(), 1 )
  36.       otherwise junk = getline()
  37.     end
  38.   end
  39.   szAddress =  EBP'+8'
  40. end
  41. else do
  42.   /* get value of esp */
  43.   push "? esp"
  44.   i = 0
  45.   do while queued() > 0
  46.     i = i + 1
  47.     select
  48.       when i = 2 then ESP = word( getline(), 1 )
  49.       otherwise junk = getline()
  50.     end
  51.   end
  52.   szAddress =  ESP'+4'
  53. end
  54.  
  55.  
  56.  
  57. push 'dd ss:'szAddress  'L3'
  58. i = 0
  59. do while queued() > 0
  60.   i = i + 1
  61.   select
  62.     when i=2 then sz1 = getline()
  63.     otherwise junk = getline()
  64.   end
  65. end
  66.  
  67.  
  68. subfunc = x2d( word( sz1, 2 ))
  69.  
  70. select
  71.   when subfunc = 1 then szfunc = 'FILL_LOGICAL        '
  72.   when subfunc = 2 then szfunc = 'FILL_PHYSICAL       '
  73.   when subfunc = 4 then szfunc = 'DISABLE_PHYSICAL    '
  74.   when subfunc = 5 then szfunc = 'ENABLE_DC           '
  75.   when subfunc = 6 then szfunc = 'DISABLE_DC          '
  76.   when subfunc = 7 then szfunc = 'SAVE_DC             '
  77.   when subfunc = 8 then szfunc = 'RESTORE_DC          '
  78.   when subfunc = 9 then szfunc = 'RESET_DC            '
  79.   when subfunc =10 then szfunc = 'COMPLETE_OPEN_DC    '
  80.   when subfunc =11 then szfunc = 'BEGIN_CLOSE_DC      '
  81.   otherwise szfunc = 'weirdness'
  82. end
  83.  
  84. say 'Subfunc=' subfunc szfunc
  85. say 'parm 1 =' word( sz1, 3 )
  86. say 'parm 2 =' word( sz1, 4 )
  87.  
  88. exit 0
  89.