X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: Honiewelle Newsgroups: comp.os.msdos.djgpp Subject: Re: Flat memory access Date: Wed, 4 Jun 2008 05:24:12 -0700 (PDT) Organization: http://groups.google.com Lines: 44 Message-ID: References: <1df56ce7-2c42-4092-b71b-2c0b988c535e AT d19g2000prm DOT googlegroups DOT com> NNTP-Posting-Host: 218.186.11.3 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1212582252 14549 127.0.0.1 (4 Jun 2008 12:24:12 GMT) X-Complaints-To: groups-abuse AT google DOT com NNTP-Posting-Date: Wed, 4 Jun 2008 12:24:12 +0000 (UTC) Complaints-To: groups-abuse AT google DOT com Injection-Info: q27g2000prf.googlegroups.com; posting-host=218.186.11.3; posting-account=aex66goAAAChGIzur3np6V2SxBId_WZm User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14,gzip(gfe),gzip(gfe) To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com oops sorry, I forgot to include the line for declaring variable value, here's the corrected code: /* code starts here */ #include #include #include #include #include int main (void) { FILE *fp; __dpmi_meminfo mi; int selector; int ctr; int value; mi.address = (0xEC080000); // PCI Base Address register mi.size = 1024; __dpmi_physical_address_mapping (&mi); selector = __dpmi_allocate_ldt_descriptors (1); __dpmi_set_segment_base_address (selector, mi.address); __dpmi_set_segment_limit (selector, mi.size - 1); fp=fopen("bar5.txt","wb"); for (ctr=1;ctr<=1024;ctr++) { value = _farpeekb(_dos_ds, ctr-1); putc(value,fp); } fclose(fp); return 0; } /* code ends here */