X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: "Rod Pemberton" Newsgroups: comp.os.msdos.djgpp Subject: Re: Get XMS version code Date: Mon, 21 Nov 2005 00:09:58 -0500 Organization: Aioe.org NNTP Server Lines: 56 Message-ID: References: <1132226267 DOT 238205 DOT 60500 AT g14g2000cwa DOT googlegroups DOT com> <1132546146 DOT 464807 DOT 81190 AT g44g2000cwa DOT googlegroups DOT com> NNTP-Posting-Host: pCFjXAYAthfOLF6YhIh1ZA.758.domitilla.aioe.org X-Complaints-To: abuse AT aioe DOT org X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 X-Priority: 3 X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MSMail-Priority: Normal To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com wrote in message news:1132546146 DOT 464807 DOT 81190 AT g44g2000cwa DOT googlegroups DOT com... > Thanks for Rod Pemberton's reply > > i had tried for these 2 problem again. > > First problem: should i ingnore any segment value(es,ds...) > when i use 32 bits compiler > > Second problem: > i re-write my code again. but it still fail when i excute on From your assembly, I think, the code I wrote (below) is what you want. Or, at least, it is somewhat similar... Rod Pemberton #include #include __dpmi_regs r; int main(void) { r.x.ax = 0x4300; __dpmi_int (0x2f, &r); if(r.h.al!=0x80) { /* no XMS */ printf("1\n"); } else { /* XMS */ printf("2\n"); r.x.ax = 0x4310; __dpmi_int (0x2f, &r); r.h.ah=0x00; r.x.cs=r.x.es; r.x.ip=r.x.bx; __dpmi_simulate_real_mode_procedure_retf(&r); // __dpmi_simulate_real_mode_procedure_iret(&r); if (r.x.ax==0x0300) { /* OK */ printf("3\n"); } else { /* NG */ printf("4\n"); } } return(0); }