Interrupts in VB (API)

Discussion in 'ASP .Net' started by D.Sn, Jan 12, 2004.

  1. D.Sn

    D.Sn Guest

    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.

    Regards,

    D.Sn.
     
    D.Sn, Jan 12, 2004
    #1
    1. Advertising

  2. "D.Sn" <> wrote in message
    news:...
    > 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
     
    Mark Alexander Bertenshaw, Jan 12, 2004
    #2
    1. Advertising

  3. Please post only to relevant NG's.

    Willy.

    "D.Sn" <> wrote in message
    news:...
    > 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.
    >
    > Regards,
    >
    > D.Sn.
    >
    >
     
    Willy Denoyette [MVP], Jan 12, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ciaran
    Replies:
    12
    Views:
    6,094
    Frank van Eijkelenburg
    Feb 27, 2004
  2. guru10
    Replies:
    1
    Views:
    1,228
  3. Victor Bazarov

    Keyboard interrupts

    Victor Bazarov, Mar 28, 2005, in forum: C++
    Replies:
    8
    Views:
    8,784
    Ioannis Vranos
    Mar 29, 2005
  4. Ajay

    tkinter + interrupts

    Ajay, Sep 15, 2004, in forum: Python
    Replies:
    1
    Views:
    423
    Eric Brunel
    Sep 15, 2004
  5. engsol
    Replies:
    8
    Views:
    696
    Peter Hansen
    Jan 13, 2005
Loading...

Share This Page