Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Getting Started With Assembly??!!

Hi. I have zero knowledge of assembly. And I am a civil engg undergraduate too. (Hence the zero knowledge...). But I am an ardent C++ fan. I like programming things in c++. I have a v 3.0 Borland Compiler. I am aware you can do assembly on it...

Lately I simply thought of creating a mouse enabled programme. This requires interrupts. And I don't understand them at all. Can anyone suggest how I can acquire adequate knowledge to at least programme with interrupts?

Can I learn interrput programming without learning assembly?

Comments

  • MT2002MT2002 Member Posts: 1,444
    : Hi. I have zero knowledge of assembly. And I am a civil engg undergraduate too. (Hence the zero knowledge...). But I am an ardent C++ fan. I like programming things in c++. I have a v 3.0 Borland Compiler. I am aware you can do assembly on it...
    :
    : Lately I simply thought of creating a mouse enabled programme. This requires interrupts. And I don't understand them at all. Can anyone suggest how I can acquire adequate knowledge to at least programme with interrupts?
    :
    : Can I learn interrput programming without learning assembly?
    :
    [blue]
    Alot of older C++ compilers provide functions for handling
    interrupts. I *think* the mouse it interrupt 33h.

    If you have , You may be able to use the REGS union
    for regesters, and _geninterrupt() (I think) for interrupts.

    If you want to use ASM for this, try could try the
    Art Of Assembly here:

    http://webster.cs.ucr.edu/AoA/DOS/AoADosIndex.html
    [red]-16 bit version[/red]

    If you are using a 32-bit compiler, you may need to
    go through your OSs API (ie; Win32 API).[/blue]

  • deostrolldeostroll Member Posts: 65
    [blue]
    : Alot of older C++ compilers provide functions for handling
    : interrupts. I *think* the mouse it interrupt 33h.
    [/blue]

    Ok. What is [b]33h[b]? And even if I do know about [b]33h[b]I still need to know how to connect it to my programme/application, right? What is your solution now?
  • deostrolldeostroll Member Posts: 65
    [blue]
    : Alot of older C++ compilers provide functions for handling
    : interrupts. I *think* the mouse it interrupt 33h.
    [/blue]

    Ok. What is [b]33h[/b]? And even if I do know about [b]33h[/b] I still need to know how to connect it to my programme/application, right? What is your solution now?
  • MT2002MT2002 Member Posts: 1,444
    : [blue]
    : : Alot of older C++ compilers provide functions for handling
    : : interrupts. I *think* the mouse it interrupt 33h.
    : [/blue]
    :
    : Ok. What is [b]33h[/b]? And even if I do know about [b]33h[/b] I still need to know how to connect it to my programme/application, right? What is your solution now?
    :
    [blue]
    You need to set the registers up first. The registers
    contain information for the interrupt (think of it
    like a function--the registers are the parms).

    For example, to hide the mouse cursor:[/blue][code]
    mov ax, 0002h ; function number
    int 33h ; interrupt call[/code][blue]
    The function number is what you want to do with the
    interrupt. ie; function 2h hides the cursor, function
    3h returns its position. [b]The function number is
    always in AX[/b].

    Additional information are placed in other registers
    via BX,CX, DX, etc:[/blue][code]
    [green]; position mouse cursor[/green]
    mov ax, 0004h [green]; function 04h of int 33h[/green]
    mov cx, 0 [green]; column to set cursor to[/green]
    mov dx, 0 [green]; row to set cursor to[/green]
    int 33h [green]; call int 33h--set cursor position![/green]
    [/code][blue]
    Check out Ralf Brown's interrupt list for all interrupts
    and functions here:
    http://www.ctyme.com/rbrown.htm


    If you are using C for this, take a look at the REGS
    union for setting registers with [/blue]

    Good Luck;[/blue]

Sign In or Register to comment.