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

📄 sum.s

📁 UNIX v6源代码 这几乎是最经典的unix版本 unix操作系统设计和莱昂氏unix源代码分析都是用的该版
💻 S
字号:
/	example of UNIX fortran/	calling interface to machine code/	this example is a function that/	returns the single precision /	sum of all of its single precision arguments./	for example:/		f = sum(1.,2.,3.)/	sets f to 6..globl	sum.				/ defination of entry.globl	retrn				/ reference of returnsum.:					/ entry point	value				/ location of return value	.+2				/ pointer to execution code	setf				/ no d/f i/l modes guaranteed	mov	*2(sp),r0		/ arg count	mov	r3,r1			/ r3 points to arg list	tst	(r1)+			/ zeroth arg is old r3	clrf	fr0			/ start of actual function1:	addf	*(r1)+,fr0		/ add in each argument	sob	r0,1b			/ for each argument	movf	fr0,value		/ make returned value available	jmp	retrn			/ actual return.bssvalue:	.=.+4				/ space for return value/ synopsis:/	1. save registers r3, sp/	2. arg list (pointers to values)/	   begins at 2(r3)/	3. entry name is name of function/	   followed by "."/	4. first word after entry point is/	   location of return value. this is/	   true for both functions and subroutines/	5. second word after entry point is/	   pointer to pdp-11 code body/	6. return is expedited by a jump to/	   the globl routine "retrn"

⌨️ 快捷键说明

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