Dos2Linux
How do I translate the following piece of DOS-code to linux?
static union {
unsigned int *a; // One 32 bits address unsigned long l; // One 32 bits long unsigned int w[2]; // Two 16 bits words unsigned char b[4]; // Four 8 bits bytes
} DMAaddr;
static union {
signed int w; // One 16 bits words
signed char b[2]; // Two 8 bits bytes
} DMAcntr;
...
static void setadr( unsigned int far *buff, unsigned int length ) {
unsigned int lw;
lw = FP_SEG( buff ); // Segment address of buffer
DMAaddr.w[1] = ( lw >> 12 ) & 0xf; // Makes real 32bit address
DMAaddr.w[0] = ( lw << 4 ) & 0xfff0;
DMAaddr.l += ( unsigned long )FP_OFF( buff );
DMAcntr.w = length;
}
Thanks,
mc303
Signature · 5 lines
Ing. Bart Vandewoestyne [email protected] Hugo Verrieststraat 48 GSM: +32 (0)478 397 697 B-8550 Zwevegem http://users.pandora.be/vandewoestyne ---------------------------------------------------------------------- "Any fool can know, the point is to understand." - Albert Einstein