Not logged in, Join Here! or Log In Below:  
 
News Articles Search    
 

 Home / General Programming / Inline Assembly Account Manager
 
Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.
 
Todd Casey

August 23, 1999, 06:30 PM

I'm writing a console C application and I need to change the resolution to VGA Mode 13h. I cannot use any grafics libraries so I assume the only way to do it is using inline assembly. I know 16-bit assembly and have a few questions.

Info:
I'm using MSVC++ 6.0 and Windows 98. I have created a Win32 Console Application.

Question 1:
If I am writing a Win32 console application can I use inline 16-bit assembly or do I need to use 32-bit?

Question 2:
If the above question's answer is that 16-bit is okay to use then what am I doing wrong?

void main(void)
{
_asm
{
mov ah,0
mov al,13H
int 10H
}
}

It seems to crashing when it invokes the interupt 10H. What is my problem?

Thanks for any help!

Todd Casey

 
Ian Overgard

August 23, 1999, 09:41 PM

A Win32 Console App is NOT the same as a Dos app. Windows doesn't like it when you try and do stuff like that. I'd just use the DirectDraw or Win32 API calls to change the resolution. Also, a word of advice: Don't go trying to access the video memory directly unless your using something like DirectDraw, its bad coding practice and it's a headache to get to work in windows.

If you don't want to use any graphics API's/Librarys i'd recommend you do your coding in DOS.

--Ian

Todd Casey wrote:
>>I'm writing a console C application and I need to change the resolution to VGA Mode 13h. I cannot use any grafics libraries so I assume the only way to do it is using inline assembly. I know 16-bit assembly and have a few questions.
>>
>>Info:
>>I'm using MSVC++ 6.0 and Windows 98. I have created a Win32 Console Application.
>>
>>Question 1:
>>If I am writing a Win32 console application can I use inline 16-bit assembly or do I need to use 32-bit?
>>
>>Question 2:
>>If the above question's answer is that 16-bit is okay to use then what am I doing wrong?
>>
>>void main(void)
>>{
>> _asm
>> {
>> mov ah,0
>> mov al,13H
>> int 10H
>> }
>>}
>>
>>It seems to crashing when it invokes the interupt 10H. What is my problem?
>>
>>Thanks for any help!
>>
>>Todd Casey

 
BetterAnswerGuy

August 25, 1999, 10:27 PM

Todd Casey wrote:
>>I'm writing a console C application and I need to change the resolution to VGA Mode 13h. I cannot use any grafics libraries so I assume the only way to do it is using inline assembly. I know 16-bit assembly and have a few questions.
>>
>>Info:
>>I'm using MSVC++ 6.0 and Windows 98. I have created a Win32 Console Application.
>>
>>Question 1:
>>If I am writing a Win32 console application can I use inline 16-bit assembly or do I need to use 32-bit?
>>
You can do either. IMHO, Windows O/S should be redfined for 32-bit era. Intel(or some other CPU-developers) made sure that 16-bit operations do not become obsolete(due to the compatibility issue as well as size optimization). In short, you are supposed to be able to put in 16-bit instructions and 32-bit instrucitons together. On the contrary, some books find it wrong. The well-known Visual C++(a lot of people know by now that this compiler wastes a lot of memory but builds slightly faster codes than that of Borland) uses 32-bit instructions from the beginning to the end. Sure we got 100+GB of Hard drive that covers up the memory issue.(here we find another mistakes in Microsoft products which I will not argue here)

>>Question 2:
>>If the above question's answer is that 16-bit is okay to use then what am I doing wrong?
>>
>>void main(void)
>>{
>> _asm
>> {
>> mov ah,0
>> mov al,13H
>> int 10H
>> }
>>}
>>
>>It seems to crashing when it invokes the interupt 10H. What is my problem?
>>
It crashes???!!! Hey that's funny. I tried it on MS-DOS console ON windows and it worked fine. That means VC++ is not so compatible as it used to be. It also entails the fact that VC++ developers do not have the complete understanding of Windows98 O/S.
p.s. I did not bother to try it on VC++. So it might be something else like IDE spec or some cheap virus that knows VC++ application well(this I doubt it but possible)
**Or the virus constantly messes up interrupt vector table or something!!

>>Thanks for any help!
>>
you're welcome. Remember, Microsoft Flight Sim in always in Top Ten Chart but I never met anyone who liked it.

Cal

 
Etienne

September 07, 1999, 07:48 PM

I got the same problem, i tried to write to same same code to change the graphic mode to 13h ans i got a blue screen windows error... I want to practice my skills in C++, and im bored with cin and cout... I dont know how to use directx, and i want to try to make a little game in dos using a little bit of graphics... If i want to understand the structure of windows, and the api calls i think its a good thing to begin in dos. Give me your opinion please!

Etienne

Todd Casey wrote:
>>I'm writing a console C application and I need to change the resolution to VGA Mode 13h. I cannot use any grafics libraries so I assume the only way to do it is using inline assembly. I know 16-bit assembly and have a few questions.
>>
>>Info:
>>I'm using MSVC++ 6.0 and Windows 98. I have created a Win32 Console Application.
>>
>>Question 1:
>>If I am writing a Win32 console application can I use inline 16-bit assembly or do I need to use 32-bit?
>>
>>Question 2:
>>If the above question's answer is that 16-bit is okay to use then what am I doing wrong?
>>
>>void main(void)
>>{
>> _asm
>> {
>> mov ah,0
>> mov al,13H
>> int 10H
>> }
>>}
>>
>>It seems to crashing when it invokes the interupt 10H. What is my problem?
>>
>>Thanks for any help!
>>
>>Todd Casey

 
This thread contains 4 messages.
 
 
Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.