From: dcn DOT bbs AT titan DOT cc DOT ntu DOT edu DOT tw (天才) Newsgroups: comp.os.msdos.djgpp Subject: Why doesn't my program run correctly? Date: 05 Sep 1997 21:50:46 GMT Organization: Computer Science BBS Lines: 115 Message-ID: <3KQHUN$Qiz@titan.cc.ntu.edu.tw> NNTP-Posting-Host: @titan.cc.ntu.edu.tw To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Why doesn't my program run correctly? What's wrong ? This is my source code. #include #include #define MASK_LINEAR(addr) (addr & 0x000FFFFF) #define RM_TO_LINEAR(addr) (((addr & 0xFFFF0000) >> 12) + (addr & 0xFFFF)) #define RM_OFFSET(addr) (MASK_LINEAR(addr) & 0xFFFF) #define RM_SEGMENT(addr) ((MASK_LINEAR(addr) & 0xFFFF0000) >> 4) typedef struct VESA_INFO /* VESA information block structure */ { unsigned char VESASignature[4] __attribute__ ((packed)); unsigned short VESAVersion __attribute__ ((packed)); unsigned char *OEMStringPtr __attribute__ ((packed)); unsigned char Capabilities[4] __attribute__ ((packed)); unsigned long VideoModePtr __attribute__ ((packed)); unsigned short TotalMemory __attribute__ ((packed)); unsigned short OemSoftwareRev __attribute__ ((packed)); unsigned char *OemVendorNamePtr __attribute__ ((packed)); unsigned char *OemProductNamePtr __attribute__ ((packed)); unsigned char *OemProductRevPtr __attribute__ ((packed)); unsigned char Reserved[222] __attribute__ ((packed)); unsigned char OemData[256] __attribute__ ((packed)); } VESA_INFO; static VESA_INFO vesa_info; /* SVGA info block */ __dpmi_regs _dpmi_reg; /* for calling int 10 bank switch */ static int get_vesa_info() { int c; for (c=0; c