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

📄 strchr.s

📁 好强悍的minix2.0的源码,是你学习操作系统和Linux编程不可或缺的源码!这个东西可费了我一周的时间才从网上弄到的!要好好珍惜!!
💻 S
字号:
!	strchr()					Author: Kees J. Bot!								27 Jan 1994.sect .text; .sect .rom; .sect .data; .sect .bss! char *strchr(const char *s, int c)!	Look for a character in a string.!.sect .text.define _strchr_strchr:	push	bp	mov	bp, sp	push	di	cld	mov	di, 4(bp)	! di = string	mov	dx, #16		! Look at small chunks of the stringnext:	shl	dx, #1		! Chunks become bigger each time	mov	cx, dx	xorb	al, al		! Look for the zero at the end  repne	scasb	pushf			! Remember the flags	sub	cx, dx	neg	cx		! Some or all of the chunk	sub	di, cx		! Step back	movb	al, 6(bp)	! The character to look for  repne	scasb	je	found	popf			! Did we find the end of string earlier?	jne	next		! No, try again	xor	ax, ax		! Return NULL	pop	di	pop	bp	retfound:	pop	ax		! Get rid of those flags	lea	ax, -1(di)	! Address of byte found	pop	di	pop	bp	ret

⌨️ 快捷键说明

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