Xref: news2.mv.net comp.os.msdos.djgpp:3376 From: ao950 AT FreeNet DOT Carleton DOT CA (Paul Derbyshire) Newsgroups: comp.os.msdos.djgpp Subject: Re: Simple ASM question (direction flag) Date: 2 May 1996 12:08:35 GMT Organization: The National Capital FreeNet Lines: 43 Sender: ao950 AT freenet5 DOT carleton DOT ca (Paul Derbyshire) Message-ID: <4ma8k3$spj@freenet-news.carleton.ca> References: Reply-To: ao950 AT FreeNet DOT Carleton DOT CA (Paul Derbyshire) NNTP-Posting-Host: freenet5.carleton.ca To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Lennart Steinke (steinke AT zeus DOT adv-boeblingen DOT de) writes: > Hi! > > I need something like memcpy(), > but with inverted direction flag. So that > the dest. pointer points to the end of the used > memory, not to the beginning. I need the > same for memset(), too. > > This can't be that hard, but > a) I'm not fluid in ASM, especially not with DJGPP, > b) have no ASM books here at work, and > c) have only the bins of DJGPP v2, so I can't look > into the source of the above mentioned funcs. > > I need these funcs to blit an bitmap mirrored to the > screen. I wrote something that did that once. It copied the memory "manually" (but fast) using a tight loop with a register char *sp counting the bytes backward at one end and a register char *dp counting forward at the other end: register *sp, register *dp; int i; [initialise them to respectively end of source block and start byte of end block] for (i=0; i