shithub: riscv

ref: 65ef69a85d1c0f4694a361f5a0a99bdbb4f2cd95
dir: /sys/src/libc/arm/main9p.s/

View raw version
arg=0
sp=13
sb=12
lr=14

TEXT	_mainp(SB), 1, $0
	SUB	$8, R(sp)
	MOVW	$setR12(SB), R(sb)
	MOVW	R(arg), _tos(SB)

	MOVW	$_profmain(SB), R(arg)
	MOVW	$0, R(lr)
	B	_callmain(SB)

	MOVW	$_div(SB), R(arg)	/* force loading of div */
	MOVW	$_profin(SB), R(arg)	/* force loading of profile */

TEXT	_saveret(SB), 1, $0
TEXT	_savearg(SB), 1, $0
	RET

TEXT	_callpc(SB), 1, $-4
	MOVW	0(R13), R(arg)
	RET