Why is my masm32 program crashing whenever I try using interrupts?

Posted by incrediman on Stack Overflow See other posts from Stack Overflow or by incrediman
Published on 2010-03-01T06:11:47Z Indexed on 2010/04/13 16:43 UTC
Read the original article Hit count: 463

Filed under:
|
|
|
|

Here's the code:

.386 ;target for maximum compatibility
.model small,stdcall ;model
.code
    main:
        int 20h
    END main

Result: http://img705.imageshack.us/img705/3738/resultom.png

"test.exe has stopped working" - always right when it reaches the interrupt.

This is the interrupt I'm trying to use. It should simply exit the program. Others I've tried include character input/output, etc.. Nothing works.

I'm on windows 7, using masm32 with the WinAsm IDE.

There are so many cool things it seems I should be able to do with interrupts... however, it crashes whenever I try to use an interrupt - always the same way.

This seems related and possibly useful: http://stackoverflow.com/questions/1414260/dos-interrupt-in-masm-x86-assembly-crashing

...but I haven't really been able to figure anything out from it.

Any suggestions?

© Stack Overflow or respective owner

Related posts about assembly

Related posts about masm32