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

📄 find.s

📁 Version 6 Unix 核心源代码 Version 6 Unix 核心源代码
💻 S
字号:
i=r3.globl lptr,rptr,sptr.globl succ,fail.globl iget.globl find,enter.globl seekchar,getword,getchar.globl putword,putchar,alterword.globl getcstr,rewcstr.globl length,rewindindex=0tablep=2temp=4which=6framel=10find:	mov	pc,-(sp)	/which(sp)	br	1fenter:	clr	-(sp)1:	jsr	pc,rewcstr	jsr	pc,getcstr	bne	1f	tst	(sp)+	jmp	fail1:	clr	-(sp)	/temp(sp)	jsr	pc,iget	mov	(r0),-(sp)	/tablep(sp)	clr	-(sp)	/index(sp)right:	add	$rptr,index(sp)	br	1fleft:	add	$lptr,index(sp)1:			/get index of next entry	mov	tablep(sp),r1	mov	index(sp),r0	jsr	pc,seekchar	jsr	pc,getword	tst	r0	beq	nomore	mov	r0,index(sp)	add	$sptr,r0	jsr	pc,seekchar	jsr	pc,rewcstr1:			/comparison loop	mov	tablep(sp),r1	jsr	pc,getchar	mov	r0,-(sp)	jsr	pc,getcstr	cmp	r0,(sp)+	bgt	right	blt	left	tst	r0	beq	found	br	1bnomore:		/not in table	tst	which(sp)	beq	1f	tst	(i)+	/exit from find	add	$framel,sp	jmp	fail1:	mov	tablep(sp),r1	jsr	pc,length	mov	r0,temp(sp)	clr	r0	jsr	pc,putword	/scratch word	jsr	pc,putword	/left pointer	jsr	pc,putword	/right	mov	index(sp),r0	jsr	pc,seekchar	mov	temp(sp),r0	mov	r0,index(sp)	jsr	pc,alterword	jsr	pc,rewcstr1:			/copy loop	jsr	pc,getcstr	mov	tablep(sp),r1	jsr	pc,putchar	tst	r0	bne	1bfound:	jsr	pc,iget	mov	index(sp),(r0)	add	$framel,sp	jmp	succ

⌨️ 快捷键说明

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