Hi... I got this code from a tutorial though the two macros that is used in it cannot be found in the library dos.h which should had been. Here is the code, can anyone find a replacement or a suggestion I can make to go around this little problem?
--------------
//here it is:
#include <dos.h>
typedef struct
{
char page;
unsigned int offset;
unsigned int length;
}DMA_block;
void LoadPageAndOffset(DMA_block *blk, char *data)
{
unsigned int temp, segment, offset;
unsigned long foo;
segment = FP_SEG(data);
offset = FP_OFF(data);
blk-> (segment & 0xF000) >> 12;
temp = (segment & 0x0FFF) << 4;
foo = offset + temp;
if(foo > 0xFFFF)
blk->page++;
blk->offset = (unsigned int)foo;
}
-----------
What is strange is that I took a look in the Help Menu in Borland and there is a example using FP_OFF and FP_SEG but when I compile that example it gives me the same error that I get when I run my own prog.
--------------
//here it is:
#include <dos.h>
typedef struct
{
char page;
unsigned int offset;
unsigned int length;
}DMA_block;
void LoadPageAndOffset(DMA_block *blk, char *data)
{
unsigned int temp, segment, offset;
unsigned long foo;
segment = FP_SEG(data);
offset = FP_OFF(data);
blk-> (segment & 0xF000) >> 12;
temp = (segment & 0x0FFF) << 4;
foo = offset + temp;
if(foo > 0xFFFF)
blk->page++;
blk->offset = (unsigned int)foo;
}
-----------
What is strange is that I took a look in the Help Menu in Borland and there is a example using FP_OFF and FP_SEG but when I compile that example it gives me the same error that I get when I run my own prog.