"D.Sn" <no*@moreply.com> wrote in message
news:uQ**************@TK2MSFTNGP10.phx.gbl...
Hi all
I need to implement interrupt functioality like Int86() in C, In VB
I have an idea. What about precompiled assembly language use using
"CallWindowProc" .
I am not clear what situating this "CallWindowProc" is used.Thougth the
help for the function is avilable in MSDN i want to what is input and where the
output comes?how to acess the output registers/values?,Situating where
this function can be used?.
So dynamically create optcode for the interrupt function and use
CallWindowProc get return value?
What tools are required to create assembly (note: i am not a master in
assembly language)?. How to get the optcode?
Pl. explain with example? It would be great halp.
"D.Sn" -
It kind of worries me that you are asking what tools are required for
assembly, and how to use it. You may be better off writing a C DLL, and
exporting functions which can be called from VB. You also might be way off
track - are you sure that what you want to do requires calling interrupts?
There may be another way.
But all I know, you might be a genius who thrives on "challenges". Get a
book on assembly code, and download "Microsoft Macro Assembler", which I
believe is still free on the microsoft download site. This should get you
started. Allow a month or two to get used to it.
As for CallWindowProc() - that function is for use with subclassing windows.
so it isn't ideal. However, you can use it to indirectly call a machine
code routine embedded into your VB code as a Byte array.
----------------
Sub MachineCode(ByVal lParam1 As Long, ByVal lParam2 As Long, ByVal lParam3
As Long, ByVal lParam4 As Long)
Dim abytCode(1 To 64) As Byte
' Load the machine code instructions into this array.
abytCode(1) = 10
abytCode(2) = 1
...
abytCode(n-1) = <ret> ' Ensure this is the code for ret.
abytCode(n) = 3 ' Just in case.
CallWindowProc VarPtr(abytCode(1)), lParam1, lParam2, ByVal lParam3,
ByVal lParam4
End Sub
----------------
This gives you a maximum of four integers on the stack that you can use in
your machine code routine. Naturally, you can stick pointers to UDTs on the
stack, if necessary.
--
Mark Bertenshaw
Kingston upon Thames
UK