• Advertisement

Archived

This topic is now archived and is closed to further replies.

Writing Assembly interrupt for 13h

This topic is 5930 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m trying to make a program with graphics in Assembly. My computer freezes when I try to use int 10h to load VGA mode 13h. I''m using Windows 2000 on a Thinkpad. If anyone could help, it''d be greatly appreciated.

Share this post


Link to post
Share on other sites
Advertisement
Windows 2000 doesn''t allow direct hardware access. You won''t have much luck trying to change video modes in assembly.

Share this post


Link to post
Share on other sites
*WHY* would you want to use VGA 13h in Windoze?
My suggestion: Either use DOS (since this is more like a DOS programming technique) or switch to DirectX/OpenGL.

---
Allow me to clear my head for once...
Stop polluting the air!

Share this post


Link to post
Share on other sites
quote:
Windows 2000 doesn''t allow direct hardware access. You won''t have much luck trying to change video modes in assembly.

It works fine for me.

Share this post


Link to post
Share on other sites
The NT Virtual Dos Machine(NTVDM) emulates it.

Psalm 137:9: "Happy shall he be, that taketh and dasheth thy little ones against the stones."

Share this post


Link to post
Share on other sites
Let me clarify myself.

I'm writing a DOS program, but I'm trying to run it with a full-screen under Command Prompt in Windows 2000.

The following sequence of instructions freezes my computer:

mov ah, 0
mov al, 13h
int 10h

Is there something I was supposed to do, but I didn't? Is there another register I'm supposed to load that I haven't?

Edited by - Mike38722 on November 20, 2001 3:47:20 PM

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Those instructions are priviledged - can''t be run in user mode - aka "ring3" - they have to be issued at "ring0". DOS doesn''t exist on W2K - don''t confuse a console with DOS - they only look the same :-)
Like the other poster mentioned - you''ll need to use DX, OGL or - gasp - GDI.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
To follow up - there are workarounds - (search google for "callgate" - also search for the online version of "Undocumented Windows NT") - using a dll to interface with device drivers and such. This workaround is such a pain that you might as well use DX/OGL/GDI.

Share this post


Link to post
Share on other sites
quote:
The following sequence of instructions freezes my computer:

mov ah, 0
mov al, 13h
int 10h



Sorry, I can''t help, all I can say is that this code works fine on my computer with Windows 2000, so it seems strange that you have problems...

Share this post


Link to post
Share on other sites
I tried this on WME, works fine. Maybe its the way you're doing it. Try this.

run debug & type this...

edit->
Open the command window (Start->Run->"Cmd")
Load DOS debugger ("Debug"), thanks Ibanez
<-edit

Edit->
Or try command.com and then debug.com,
thanks invective
<-Edit

a100
mov ah,0
mov al,13
int 10
int 3
g=100

it will switch to mode 13 and display the registers

to quit type

q
exit


Edited by - burp on November 20, 2001 6:38:55 PM

Edited by - burp on November 22, 2001 2:54:17 AM

Share this post


Link to post
Share on other sites
I just tried it in Win2k, works fine.

I opened the command window (Start->Run->"Cmd")
Loaded DOS debugger ("Debug")

Did it in there, worked no prob at all.

Share this post


Link to post
Share on other sites
Removed my post...

Sorry for removing 2 in a row but I hadn't read the full forum and the same thing that I was saying was already said more than once..



Edited by - cyberdrek on November 20, 2001 11:53:08 PM

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:
Original post by Martee
Windows 2000 doesn''t allow direct hardware access. You won''t have much luck trying to change video modes in assembly.


Share this post


Link to post
Share on other sites
I don''t know if its at all helpful, but if you want DOS under NT, you need to run command.com -- this is not the same thing as running the NT command prompt cmd.exe

Share this post


Link to post
Share on other sites
heh, that works fine (fact). I think you''ll find there is some code after or before that that is freezing your computer - not the interrupt.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Ummm..., when I read the subject I remembered
that I''ve had problems with mode 13h some time
ago, (well, nowdays making win32/DX software,
but it''s still interesting for me)
so, I add a question here:

I used 13h long time with DOS 16bit,
and when I got a DOS 32bit compiler,
the program crashed, when I tried to switch to
mode 13h with the bios and then
accessing the VRAM at 0A000H.

Has that something to do with the different
memory handling in DOS32 ?

How can I access the VRAM then?


Share this post


Link to post
Share on other sites
In 32 bits, that sort of thing is completely compiler dependent. You can''t just use interrupts as you normally would. For example, DJGPP has the __dpmi family of functions. __dpmi_int() allows you to call interrupts and change video modes.

Share this post


Link to post
Share on other sites
Since I am not using win2000, I wouldn''t know if this is possible but can''t you just shut down windows and go the "real dos environment"??

Share this post


Link to post
Share on other sites
Nope. Windows 2000 does not include any form of DOS, and you can''t reboot in DOS mode. There is no "real DOS enviromnent". You could use a boot disk, of course.

Share this post


Link to post
Share on other sites
Umm, I thought video mode switchs were made by the BIOS, not DOS. So you should be ok if you use the BIOS to switch to mode 13h, unfortunely I don't have my assembly book with me at the moment to confirm what the answer is.
But I think it goes some like this,
mov al,13h
int 10h

you'll have to wait until I get home before i can confirmed this.

-BM-

Edited by - Black Marq on November 22, 2001 4:54:32 PM

Share this post


Link to post
Share on other sites
BIOS Functions(pre VGA and VGA)
INT 10h
Function 00h
Set Video Mode
Selects and initializes the video mode and clears the screen.

Input
AH = 00h
AL = Video Mode

---|Text-|Pixel|Graphic|Colours|Disp|Screen-|VGA|
---|Resol|-Box-|-Resol-|-------|Page|Address|YES|
00h|40x25|-8x8-|-none--|-B&W---|-8--|-B800--|YES|
01h|40x25|-8x8-|-none--|-16----|-8--|-B800--|YES|
02h|80x25|-9x16|-none--|-B&W---|-4--|-B800--|YES|
03h|80x25|-9x16|-none--|-16----|-4--|-B800--|YES|
---|80x25|-8x8-|-none--|-16----|-8--|-B800--|YES|
04h|40x25|-8x8-|320x200|-4-----|-1--|-B800--|YES|
05h|40x25|-8x8-|320x200|-4gray-|-1--|-B800--|YES|
06h|80x25|-8x8-|640x200|-B&W---|-1--|-B800--|YES|
07h|80x25|-9x14|-none--|-mono--|-1--|-B000--|YES|
---|80x25|-----|-none--|-------|-8--|-B000--|YES|
08h|20x25|-8x8-|160x200|-16----|----|-B800--|-NO|
09h|40x25|-8x8-|320x200|-16----|----|-B800--|-NO|
0ah|80x25|-8x8-|640x200|-4-----|----|-B800--|-NO|
0bh|reserved---|-------|-------|----|-------|YES|
0ch|reserved---|-------|-------|----|-------|YES|
0dh|40x25|-8x8-|320x200|-16----|-8--|-A000--|YES|
0eh|80x25|-8x8-|640x200|-16----|-4--|-A000--|YES|
0fh|80x25|-8x14|640x350|-mono--|-2--|-A000--|YES|
10h|80x25|-8x14|640x350|-4-----|-2--|-A000--|-NO|
---|80x25|-8x14|640x350|-16----|-2--|-A000--|YES|
11h|80x30|-8x16|640x480|-2-----|----|-A000--|YES|
12h|80x30|-8x16|640x480|-16----|----|-A000--|YES|
13h|40x30|-8x8-|640x480|-256---|----|-A000--|YES|

Enter into Standard VGA graphics mode 13h, 256 colours 320x200 pixels via BIOS.
xor ax,ax
mov al,13h
int 10h

Return to typical DOS TEXT mode 3 via BIOS(not DOS).
mov ax,3 ; Text Mode
int 10h

Should work be ok in Windows 2000 pro


-BM-

Share this post


Link to post
Share on other sites

  • Advertisement