xref: /csrg-svn/lib/libc/sparc/net/htons.s (revision 61168)
154394Storek/*
2*61168Sbostic * Copyright (c) 1992, 1993
3*61168Sbostic *	The Regents of the University of California.  All rights reserved.
454394Storek *
554394Storek * This software was developed by the Computer Systems Engineering group
654394Storek * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
754394Storek * contributed to Berkeley.
854394Storek *
954394Storek * %sccs.include.redist.c%
1054394Storek *
1154394Storek * from: $Header: htons.s,v 1.1 92/06/25 12:47:05 torek Exp $
1254394Storek */
1354394Storek
1454394Storek#if defined(LIBC_SCCS) && !defined(lint)
15*61168Sbostic	.asciz "@(#)htons.s	8.1 (Berkeley) 06/04/93"
1654394Storek#endif /* LIBC_SCCS and not lint */
1754394Storek
1854394Storek/* netorder = htons(hostorder) */
1954394Storek
2054394Storek#include "DEFS.h"
2154394Storek
2254394StorekENTRY(htons)
2354394Storek	sethi	%hi(0xffff0000), %o1
2454394Storek	retl
2554394Storek	 andn	%o0, %o1, %o0
26