htonl.s

来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· S 代码 · 共 39 行

S
39
字号
/*	@(#)htonl.s	4.1	(ULTRIX)	7/3/90				      *//* ------------------------------------------------------------------ *//* | Copyright Unpublished, MIPS Computer Systems, Inc.  All Rights | *//* | Reserved.  This software contains proprietary and confidential | *//* | information of MIPS and its suppliers.  Use, disclosure or     | *//* | reproduction is prohibited without the prior express written   | *//* | consent of MIPS.                                               | *//* ------------------------------------------------------------------ *//* $Header: htonl.s,v 1.1 87/02/16 11:18:27 dce Exp $ *//* * Copyright 1985 by MIPS Computer Systems, Inc. *//* * htonl -- host to network byte order for longs */#include <mips/regdef.h>#include <mips/asm.h>LEAF(htonl)#ifdef MIPSEL	# start with abcd	sll	v0,a0,24	# d000	srl	v1,a0,24	# 000a	or	v0,v1		# d00a	srl	t0,a0,8		# 0abc	and	t1,t0,0xff00	# 00b0	and	v1,t0,0xff	# 000c	sll	v1,16		# 0c00	or	v1,t1		# 0cb0	or	v0,v1		# dcba#else	move	v0,a0#endif	j	ra.end htonl

⌨️ 快捷键说明

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