Guidance
指路人
g.yi.org
software / rapidq / Examples / ASM / AInStr.bas

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
     $ESCAPECHARS ON
     $TYPECHECK ON
     $INCLUDE "RAPIDQ.INC"

' ============================================================
     DECLARE FUNCTION CallAsmProc LIB "user32" ALIAS "CallWindowProcA" _
      (Proc AS LONG, A1 AS LONG, A2 AS LONG, A3 AS LONG, _
      A4 AS LONG) AS LONG
' ============================================================
' ----- START ASM AInstr -----
     DEFBYTE AInstrArray (0 TO 91) = _
      { _
      &HC8, &H00, &H00, &H00, &H56, &H57, &H8B, &H45, &H08, &H83,  _
      &HF8, &H00, &H0F, &H84, &H01, &H00, &H00, &H00, &H48, &H8B,  _
      &H75, &H0C, &H01, &HC6, &H89, &HF0, &H48, &H40, &H89, &HC6,  _
      &H8B, &H7D, &H10, &H80, &H3E, &H00, &H0F, &H84, &H27, &H00,  _
      &H00, &H00, &HFC, &HA6, &H0F, &H85, &HE9, &HFF, &HFF, &HFF,  _
      &H80, &H3F, &H00, &H0F, &H84, &H0B, &H00, &H00, &H00, &H80,  _
      &H3E, &H00, &H0F, &H84, &H0D, &H00, &H00, &H00, &HEB, &HE5,  _
      &H8B, &H75, &H0C, &H29, &HF0, &H40, &HE9, &H05, &H00, &H00,  _
      &H00, &HB8, &H00, &H00, &H00, &H00, &H5F, &H5E, &HC9, &HC2,  _
      &H10, &H00 _
      }
' ----- END ASM AInstr -----
'
' ----- POINTER to use In CallAsmProc -----
'       A Bit Faster than Calling AInstr
     DEFINT ptrAInstr
     ptrAInstr = VARPTR (AInstrArray(0))
'
' ----- RQ CALL AInstr -----
     FUNCTION AInstr (Arg1 AS LONG, Arg2 AS LONG, Arg3 AS LONG) AS LONG
      Result = CallAsmProc (ptrAInstr, Arg1, Arg2, Arg3, 0)
     END FUNCTION
' ============================================================
'
' -------------------------------------------------------------
' Tests AInstr
' ------------
     DEFSTR searchIn = "dhjsjkdhk lzuieyuyrfqs fjkhkyeui  zyrzeuhfjkh   _
fuizeyruizeyrazjkfhsdjkhflqsdhuizey_
abcdefghijklmnopqrstuvwxyz"
'                  12345678901234567890123456
     DEFSTR searchFor = "xyz"
' -------------- ptr to Strings ---------------
     DEFINT ptrSearchIn, ptrSearchFor
     ptrSearchIn  = VARPTR(searchIn)
     ptrSearchFor = VARPTR(searchFor)
'
     PRINT ("ASM AInstr search    Found at : " & STR$(AInstr(1, ptrSearchIn, ptrSearchFor)))
     PRINT ("Same Instr RQ search Found at : " & STR$(INSTR(1, searchIn, searchFor)))
'
' -------------------------------------------------------------
' EXIT CONSOLE
' ------------
     DEFSTR sExit
     INPUT "\n\n                    CR to QUIT \n\n", sExit
     Application.Terminate
     END
掌柜推荐
 
 
¥860.00 ·
 
 
¥410.00 ·
 
 
¥288.00 ·
 
 
¥918.00 ·
 
 
¥288.00 ·
 
 
¥264.00 ·
© Sun 2024-11-24  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2002-08-04 06:47:54