Advertisement

ASM in VISUAL C++

Started by January 17, 2001 05:10 AM
2 comments, last by ahw 24 years ago
Here''s the problem (''cause of course, there IS a problem) I am coding some simple routines in ASM, for instance, I call int 10h so that I can set up the video mode to my liking. Very simple, works perfect in Borland C++ Convert it to Visual C++, compile it, build it, run it, CRASH. WTF is wrong with Visual ? I read the MSDN and there are tons of articles and bug reports on how Visual C++ doesnt handle ASM routines very well. HAs any one else got this kinda crap happening to them, and how did they work around it ? The way I see it, I am gonna have to create a set of routines and get the .OBJ code with Borland, but I have no clue as to how to do that really ... anyone has ever ran into this kind of problem ? Thanks. youpla :-)
-----------------------------Sancte Isidore ora pro nobis !


Edited by - NickB on January 17, 2001 6:44:29 PM
Advertisement


Edited by - NickB on January 17, 2001 6:45:01 PM
Hi,

Basically your problem is that Visual C++ will only compile 32bit .exe''s for Protected mode Windows (ring 3). To use BIOS routines you can only safely do this in Dos (ring 0). Borland C++ can compile your app for Dos, which makes it safe to access the ''int 0xxh'' routines. Put another way ''int'' instructions are protected instructions in ring 3 mode (ie Windows).

If you know how to (or learn how to) write VxD''s for Windows you can access the int routines, because VxDs execute at ring 0 privelege, where there aren''t any protected instructions.

Hope this explains something about this problem,

Nick B.

PS. Oh yea, work arounds - learn DirectX to set video modes, access the frame buffer directly etc. (I like OpenGL better though)

This topic is closed to new replies.

Advertisement