DOS: High Intensity Background Color

So I’ve been trying to find on how to set up the VGA text mode to change the background blinking bit to the color intensity bit. Is there a way to do this?
Note: I’m using the 80x50 text mode and Turbo C++ as my compiler if this information helps any.
You need to use the correct interrupt to instruct the EGA/VGA card to treat bit 3 as intensity instead of blink.

Here it is: http://www.ousob.com/ng/bios/ng11418.php

You need to find a good reference for the EGA/VGA BIOS interrupts, and refer to it regularly.


BTW, we're all in 2017, Turbo C++/16-bit DOS is ancient, ancient stuff. If you are emulating on modern hardware, you might as well throw all that away and just use the modern compiler and stuff...

(No value judgement on it, though. I used to really enjoy playing with the EGA/VGA and HGC chipsets on x86/x88 hardware...)
turbo has built-int example programs that show how to do this as well as some simple graphics.

If i remember it the tool has a library that will do this for you fairly painlessly, if you don't want to try to do it with direct manipulation.

I wonder if embedded dos is dead yet? Not "too" long ago you could still get effectively a 386 or 486 PC on an embedded chip, os and cpu and memory and all on one chip(or was it a tiny board, we looked at but didnt use them) and I think a stripped down linux was available as well to use on small-needs systems.

Last edited on
So how do i write the BIOS interrupt in c++. I noticed the inturupt is in assembly but i don't know how to implement assembly in c++.
you can embed assembly directly in c++ but the syntax and "forgiveness" factor vary across compilers.

looks like
asm
{
//assembly instructions here.
}

I don't remember how to do what you are asking, all I can do is point to google or the examples that come with turbo.
never mind got it to work. I am leaving reference code behind so others who whish to know will know.
1
2
3
4
5
6
7
8
void main()
{
     asm{
             mov ax, 1003h
             mov bx, 0
             int 10h};
return 0;
}

if i screwed up the code let me know.
Looks fine to me, glad you got it to work!
1
2
3
4
5
6
7
8
void main()
{
     asm{
             mov ax, 1003h
             mov bx, 0
             int 10h};
return 0;
}


The code you are showcasing is fine. However, your main() function itself is kind of janky.

I guess Turbo C++ allows main to return void, but the standards say it must return an int. So main (with no arguments) must be int main(){...}

However, in line 7 you return an int. So, line 1 is non-compliantly declaring that you are returning void, but you return an int (which is compliant).

Ironic.

turbo predates much of the current standard by decades.
And it was a bit fast and loose with the standard as it was in its own time period.
Registered users can post here. Sign in or register to post.