[comp.lang.c] Turbo C && Video && memmove - help ?

eric@uwovax.uwo.ca (07/20/90)

I have these two neat little routines that work ok in compact and large
models (Turbo C) but I am having problems making them work in
models which are small data (small, medium...)

They use TC's void *memmove(void *dest, const coid *src, size_tn)

void *pushscreen(void)
{
	unsigned *sbuf;

	sbuf = malloc(4096);
	memmove(sbuf, Vpage, 4096);
	return(sbuf);
}

void popscreen(unsigned *sbuf);
{
	memmove(Vpage, sbuf, 4096);
	free(sbuf);
}


where Vpage has been previously defined as 
#define Vpage (unsigned far *)0xb8000000

Any suggestions ?  (other than use a different model...)
merci.
-e

berg@cip-s01.informatik.rwth-aachen.de (AKA Solitair) (07/27/90)

I'd say, link in the library module for memmove out of the compact library.
You'll have to extract it, and then link it in over the obj file.
But, be sure to include the appropriate prototype for the function, and
make sure no other library routine uses memmove internally, otherwise
you'll have to change the name of memmove.
--
Sincerely,                 berg%cip-s01.informatik.rwth-aachen.de@unido.bitnet
           Stephen R. van den Berg.
"I code it in 5 min, optimize it in 90 min, because it's so well optimized:
it runs in only 5 min.  Actually, most of the time I optimize programs."