File:  [MW Coherent from dump] / coherent / g / usr / lib / misc / memxch.m
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Wed May 29 04:56:35 2019 UTC (7 years ago) by root
Branches: MarkWilliams, MAIN
CVS tags: relic, HEAD
coherent

/*
 * void * memxch(void *buf1, void *buf2, size_t size)
 * exchanges buf1 & buf2 for size.
 */
#include <larges.h>
buf1	=	LEFTARG
buf2	=	buf1+DPL
size	=	buf2+DPL
	Enter(memxch_)
	mov	cx, size(bp)
	Les	si, buf1(bp)
	Lds	di, buf2(bp)
	shr	cx, $1
	jnc	1f
	movb	al, Pes (di)
	movsb
	movb	-1(si), al
1:
	jcxz	3f
2:
	mov	ax, Pes (di)
	movs
	mov	-2(si), ax
	loop	2b
3:
	Leave

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.