File:  [MW Coherent from dump] / coherent / b / lib / libc / string / i8086 / memset.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

//////////
/ i8086 C string library.
/ memset()
/ ANSI 4.11.6.1.
//////////

//////////
/ char *
/ memset(String, Char, Count)
/ char *String;
/ int Char, Count;
/
/ Set Count bytes of String to Char.
//////////

#include <larges.h>

String	=	LEFTARG
Char	=	String+DPL
Count	=	Char+2

	Enter(memset_)
	mov	cx, Count(bp)	/ Count to CX
	movb	al, Char(bp)	/ Char to AL
	Les	di, String(bp)	/ String address to ES:DI
	cld
	rep
	stosb			/ Copy Char to String
	mov	ax, String(bp)	/ Return the destination in AX
#if	LARGEDATA
	mov	dx, es		/ or DX:AX
#endif
	Leave

unix.superglobalmegacorp.com

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