Xref: news2.mv.net comp.os.msdos.djgpp:7813 From: "Justin Frankel" Newsgroups: comp.os.msdos.djgpp Subject: Re: Screen Read problems (mode 13h) Date: 23 Aug 1996 16:11:04 GMT Organization: Nullsoft Lines: 54 Message-ID: <01bb9105$305a2a20$793055ce@Pmud> References: <3216B47D DOT EDA AT sprynet DOT com> NNTP-Posting-Host: client51.sedona.net To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp John Luebs wrote in article <3216B47D DOT EDA AT sprynet DOT com>... > I use this function to put a row of pixels into the video buffer > offset is an int that contains the starting pixel value > work_back is a long* to the data to be put to the screen, and > sprite_width > is the number of pixels in the transfer. > > This function works fine! > __asm__ __volatile__ ("pushw %%es\n > movl $0xa0000h, %%edi\n > addl %0, %%edi\n > movw %1, %%es\n > movl %2, %%esi\n > movl %3, %%ecx\n > cld\n > rep\n > movsb\n > popw %%es\n" > : > : "g" (offset), "g" (_dos_ds), "g" (work_back), "g" (sprite_width) > : "cx", "di", "si" > ); > > I use this to do the opposite, however I get GPFs. Any Suggestions?? > > __asm__ __volatile__ ("pushw %%ds\n > pushw %%es\n > movw %%ds, %%ax\n > movl $0xa0000h, %%esi\n > addl %0, %%esi\n > movw %1, %%ds\n > movl %2, %%edi\n > movw %%ax, %%es\n > movl %3, %%ecx\n > cld\n > rep\n > movsb\n > popw %%es\n > popw %%ds\n" > : > : "g" (offset), "g" (_dos_ds), "g" (work_back), "g" (sprite_width) > : "ax", "cx", "di", "si" > ); > > Any help appreciated! > > John Luebs > Try loading DS after loading ecx, edi, and esi. Justin