mcount.s

来自「操作系统SunOS 4.1.3版本的源码」· S 代码 · 共 53 行

S
53
字号
	.data	.asciz	"	@(#)mcount.s	1.1	92/07/30	Copyr 1983 Sun Micro"|	Copyright (c) 1983 by Sun Microsystems, Inc.	.even_profiling:	.long	3_countbase:	.long	0_numctrs:	.long	0_cntrs:	.long	0	.text	.globl	mcountmcount:	tstl	_profiling | check recursion	jne	3$	movl	#1,_profiling	tstl	a0@	   | have we passed this way before?	jne	2$	tstl	_countbase | no: check initialization	jeq	1$	movl	_cntrs,d0  | is there space left?	addql	#1,_cntrs	cmpl	_numctrs,d0	jeq	4$	   | no space in the place	movl	_countbase,a1	movl	sp@,a1@	   | snag return address	addql	#4,a1	movl	a1,a0@	   | initialize indirect cell with count cell address	addql	#1,a1@	   | then increment count cell	addql	#8,_countbase1$:	clrl	_profiling3$:	rts2$:	movl	a0@,a0     | we've been here before:	addql	#1,a0@     | just increment indirect	clrl	_profiling	rts4$:	.data15$:	.ascii	"mcount\72 counter overflow\12\0"	.text	pea	26:w	pea	5$	pea	2:w	jsr	_write	addw	#12,sp	rts

⌨️ 快捷键说明

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