Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

what code cannot?

Posted on 2000-04-05
14
Medium Priority
?
202 Views
Last Modified: 2010-04-10
Hi experts:
    Would you plz tell me what  assembly code cannot run under WindowXX?

    I try this code but I fail .Program crashed:
    mov ax , 13h
    int 10h
Above I want to switch to mode 13h to draw pixel .

Btw: What interrupt is it : 800*600*256 ?
I know 13h is 320x200x256.

Thank you!!
 
0
Comment
Question by:Babyworship
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 10
  • 3
14 Comments
 

Author Comment

by:Babyworship
ID: 2688808
I feel strange.Does the video card's memory(VRAM) is mapped into the 32bit memory address?
0
 
LVL 4

Accepted Solution

by:
nils pipenbrinck earned 300 total points
ID: 2689226
simple answer:

Under windows the video bios is not available. You can't use int 10h to set a video mode.

I guess you're trying to run a old dos graphics code under windows. Well.. it won't work.

You have two options: either go down to dos and use a dos compiler. In a dos-window int 10h will work quite nice (at least under win98 and win95. I don't know about nt and win2k).

The modern way would be to use some c-code and do a directdraw init. Then you can switch into any videomode supported by your hardware and fool around with the pixels.

Nils
0
 
LVL 3

Expert Comment

by:daitt
ID: 2689329
I think it's fine to run your program as a DOS application (under a DOS session of Windows). But you cannot run a Window application and then call int 10h, because Windows doesn't allow you to access video device that way.
Just want to hear other ideas.
BTW: if you want 800x600*256 you may have to program VESA BIOS (for VESA-compatible video card). For different cards they have different interrupts to control the hardware. It's in DOS only.
In Windows you should have a look at DirectX. Windows doesn't like you to direct access the video memory as well as other devices.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Babyworship
ID: 2690010
Thanks nil and does the video card's memory(VRAM) is mapped into the 32bit memory address in windows?

And can you tell me a general rule ? What code cannot run under window-system window which can under dos?Otherwise,i'm afraind futhur quesiton like this.

Thank you

0
 

Author Comment

by:Babyworship
ID: 2690020
Thanks daitt very much!!
0
 

Author Comment

by:Babyworship
ID: 2690029
Adjusted points from 50 to 60
0
 

Author Comment

by:Babyworship
ID: 2690033
Adjusted points from 60 to 70
0
 

Author Comment

by:Babyworship
ID: 2690043
>Windows doesn't like you to direct >access the video memory as well as >other devices

Sorry,daitt.sorry for my stupidity.
Would you tell me what "direct access" means in fact? It means what in code?

Thanks a lot!!
0
 

Author Comment

by:Babyworship
ID: 2692672
Are you there?!!!!!!!???
0
 

Author Comment

by:Babyworship
ID: 2721476
nils ,would  you tell me what can not I do under windows?
0
 
LVL 3

Expert Comment

by:daitt
ID: 2721641
I'm sorry my email account didn't work well. Direct access I meant calling the Interrupts to perform an action on the device, or changing mapped memory .. In Windows you should control devices through APIs, not through interrupts.
If you want to program graphics in Windows (real Windows application), you should have a look at DirectX. But if you don't have expereince in Windows programming (APIs, Interfaces...) you should learn it first.
Anyway I think you're still able to call some video interrupts under a DOS session in Windows. I saw many games for DOS can run in Full-Screen mode in Windows and they're using mode 13H. If I have time I will write a small program to test that.
Best regards
0
 

Author Comment

by:Babyworship
ID: 2830733
Adjusted points from 70 to 100
0
 

Author Comment

by:Babyworship
ID: 2830734
Thanks,daitt
So , in windows ,why interupts still there ,who use it ? the VxD?

Thanks!!!!!!!!!!!
0
 
LVL 3

Expert Comment

by:daitt
ID: 2831019
I think the kernel and the drivers can use them - actually interrupts are not the only way to control devices (we write to and read from ports and mapped memory). Interrupts are still there I think because the DOS applications still need them and interrupts are part of the machine's language, so nobody can get rid of them. But some interrupts cannot be used safely in Windows because it will conflict with what the drivers doing. The procedure to make the device do something (for example to change to another screen mode) becomes complex (you must call this interrupt .. then call that .. the write this to the port .. and so on) so if you call an interrupt when the device is calling another, you break the procedure. It's not a problem in DOS, because DOS is single tasking. Another thing is that when you change the screen mode, you must do some actions to inform other components in Windows to get the system use your new screen mode. Otherwise everything will be messed up. So programming applications in Windows is calling functions through the interface - API(a contract between you and the device driver(DD) - the DD gives you this function. You call it with some parameters and the DD will finish the task for you. You don't have to understand how the DD access hardware resources (actually each device has its own method to control and there's no standard interrupt for advanced functions of the devices). How to change to a new screen mode is defined by the manufactures. How to inform Windows about new screen mode is defined by the kernel. You can do all of them manually with your code, but there's no official documents for these things, so your program might not be able to run when the user change their hardware or upgrade the operating system.
I don't know which action is legal in windows .. which is not. I think the files interrupts are ok. I/O interrupts are not. Anyway .. there's no reason to use interrupts in a real Windows application. Everything you want to do (and you're allowed to do) should be implemented already in the APIs.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
Suggested Courses

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question