⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 memset.s

📁 好强悍的minix2.0的源码,是你学习操作系统和Linux编程不可或缺的源码!这个东西可费了我一周的时间才从网上弄到的!要好好珍惜!!
💻 S
字号:
!	memset()					Author: Kees J. Bot!								27 Jan 1994.sect .text; .sect .rom; .sect .data; .sect .bss! void *memset(void *s, int c, size_t n)!	Set a chunk of memory to the same byte value.!.sect .text.define _memset_memset:	push	bp	mov	bp, sp	push	di	mov	di, 4(bp)	! The string	movb	al, 6(bp)	! The fill byte	mov	cx, 8(bp)	! Length	cld	cmp	cx, #16	jb	sbyte		! Don't bother being smart with short arrays	test	di, #1	jnz	sbyte		! Bit 0 set, use byte storesword:	movb	ah, al		! One byte to two bytes	sar	cx, #1    rep	stos			! Store words    	adc	cx, cx		! One more byte?sbyte:    rep	stosb			! Store bytesdone:	mov	ax, 4(bp)	! Return some value you have no need for	pop	di	pop	bp	ret

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -