Turbo C++ 3.0 And BootProg
Posted: Sun Jul 19, 2009 10:05 pm
Hello,
I'm using bootprog to load STARTUP.BIN (compiled using Turbo C++ 3.0). After loading it nothing happens. I only used BIOS interrupts so everything should work properly. I'm using the Small Memory Model. The code works fine under MS-DOS. No warnings or errors while compiling. I would be very pleased if you help me with this. Thanks for your help.
crt.h
startup.c
I'm using bootprog to load STARTUP.BIN (compiled using Turbo C++ 3.0). After loading it nothing happens. I only used BIOS interrupts so everything should work properly. I'm using the Small Memory Model. The code works fine under MS-DOS. No warnings or errors while compiling. I would be very pleased if you help me with this. Thanks for your help.
crt.h
Code: Select all
byte X1 = 0, Y1 = 0, X2 = 79, Y2 = 24, TextAttr = 7;
enum {Black = 0, Blue, Green, Cyan, Red, Magenta, Brown, LightGray, DarkGray, LightBlue, LightGreen, LightCyan, LightRed, LightMagenta, Yellow, White, Blink = 128};
void ClrScr(void)
{
_AH = 0x6;
_AL = 0;
_BH = TextAttr;
_CH = Y1;
_CL = X1;
_DH = Y2;
_DL = X2;
asm int 0x10;
_AH = 0x2;
_BH = 0;
_DH = Y1;
_DL = X1;
asm int 0x10;
}
void GotoXY(byte X, byte Y)
{
_AH = 0x2;
_BH = 0;
_DH = Y1 + Y - 1;
_DL = X1 + X - 1;
asm int 0x10;
}
byte ReadKey(void)
{
_AH = 0x0;
asm int 0x16;
return _AL;
}
void TextBackground(byte Color)
{
TextAttr &= 0x0F;
TextAttr |= Color << 4;
}
void TextColor(byte Color)
{
TextAttr &= 0xF0;
TextAttr |= Color;
}
byte WhereX(void)
{
_AH = 0x3;
_BH = 0;
asm int 0x10;
return _DL - X1 + 1;
}
byte WhereY(void)
{
_AH = 0x3;
_BH = 0;
asm int 0x10;
return _DH - Y1 + 1;
}
void Window(byte XA, byte YA, byte XB, byte YB)
{
X1 = XA - 1;
Y1 = YA - 1;
X2 = XB - 1;
Y2 = YB - 1;
}
Code: Select all
typedef unsigned char byte;
typedef unsigned int word;
#include <crt.h>
void main(void)
{
_AH = 0x0; //Set 80x25x16 Text Mode
_AL = 3;
asm int 0x10;
TextBackground(Blue); //Do something
TextColor(Cyan);
Window(1, 1, 80, 1);
ClrScr();
Window(1, 25, 80, 25);
ClrScr();
TextBackground(Cyan);
TextColor(Blue);
Window(1, 2, 80, 24);
ClrScr();
while (1); //stop
}