ASM & vc

Started by
17 comments, last by Devril 21 years, 11 months ago
Push your registers before using them, then pop them back.
-----------------------------------------------------------"People who usualy use the word pedantic usualy are pedantic!"-me
Advertisement
Why didnt i remembered to do that, thx dude
Damm, it still wont work :|

i tried with the cur code
char milie;

_asm
{
push dx
push ax
mov ah,2ch
int 21h
mov milie, dl
pop ax
pop dx

}
and it still gets that error of ilegal operation
I have no clue on where is the error but i suggest you get a tutorial on how to interface c and assembler when doin dos apps ..
you cannot call the old dos interupts when your program operates under the win32 protected mode.. Even if you make a console app with VC it´s still going to use win32. All interupt handling must be handled by programs that have the rights to use the interupts, such as graphic card drivers etc... If you really need to call thoose interupts you have to either make a program that have the rights to do it, make it a 16bit dos program (VC can´t do this) or get your program running under a diffrent dos extender if you need 32bit program.
Like everyone says, you just can''t use interuppts. Let me know if you want MASM 5.11 which will let you create 16-bit DOS apps (mail me).
Why would anyone want to call a DOS interrupt from a Win32 app?
quote:Original post by lackluster
Like everyone says, you just can''t use interuppts. Let me know if you want MASM 5.11 which will let you create 16-bit DOS apps (mail me).


I have 6.11 but thanx
You are able to make a 16bit DOS program using the lastest MASM if you have it.

You will also need a 16bit linker such as alink

Don't use inline assembly in MSVC since lastest microsoft C compilers are unable to generate DOS exe.


[edited by - __ALex_J_ on May 4, 2002 12:40:44 PM]

This topic is closed to new replies.

Advertisement