Mode 13h in DOS

Started by
18 comments, last by misterags 21 years, 10 months ago
Can someone give me the code to switch to mode 13h in DOS, (in C++ form), I am wanting to load bitmaps, if someone wants to show me the full code to load a bitmap, that would be great too. (By the way, all in DOS) misterags.
Advertisement
  asm mov ax, 13;asm int 10h;  

Of course, whether or not this will work depends on what compiler you are using.

~~~~~~~~~~
Martee
ReactOS - an Open-source operating system compatible with Windows NT apps and drivers
Thanks but that didn''t work... I''m using MS VC++ 6.0. Umm, asm doesn''t seem to be a key word. here are the errors:

error C2061: syntax error : identifier ''move''

error C2059: syntax error : ''bad suffix on number''

error C2062: type ''int'' unexpected
VC++ is Win32 only so there is absolutely no way you can write a DOS program with it. DOS is dead so I would recommend working with something else, however if your learning to program in DOS (which I think is pretty cool) you can download Turbo C from Borland for free which supports the asm command. I believe that DJGPP, also a free compiler, will allow that command as well but it is 32bit protected mode DOS so it is considerable more complicated. Best of Luck.

The Hero

P.S. VC++ supports the asm command but it will not allow you to directly access mode 13h so the errors you are getting are because it is mov not move and VC++ does not support interrupts (the int command)

Edited by - vTheHero on August 5, 2001 12:58:59 AM
As a side note, mov ax,13 won''t work either. There is a reason it is called mode 13h you know =). use "mov ax,0x13" to get the proper mode.
The keyword for inline assembly in VC++ is __asm:

__asm{    mov ax, 0x13    int 10h} 


Check the following links for DOS graphics programming tutorials:

http://www.theparticle.com/pgraph.html
http://atschool.eduweb.co.uk/camdean/pupils/amac/vga.htm
http://mega.ist.utl.pt/~fjds//vga13tut1.html
http://www.programmersheaven.com/

That should get you started... good luck!



MatrixCubed
http://MatrixCubed.org






You don''t need asm, simply do:

if( OperatingSystem == MS_DOS )
{
printf("You are in middle age\n");
exit(1);
}

sorry, but you said VC++ does not support interrupts?

but what''s this, i heard it''s a user defined breakpoint, and int simply is an interrupt:

__asm int 3;

Are you trying to program DOS-stuff in VC++? To be honest, that sounds quite wierd, why don''t you get DJGPP? It''s a 32-bits compiler for DOS, and a free one too! Go to http://www.delorie.com.

I''ve got my reasons why not to use VC++ in DOS:
Unnecessarily big sourcecodes and binaries
Slower
DJGPP is made for DOS-programming, not VC++

There are some more...

If you decide to get DJGPP, check out my homepage; http://seawasp.hjorten.nu/~coelurus for some sourcecodes (algorithms, graphics, 3d etc).
You forgot the main reason: VC++ cannot produce DOS applications!

~~~~~~~~~~
Martee
ReactOS - an Open-source operating system compatible with Windows NT apps and drivers

This topic is closed to new replies.

Advertisement