home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / amiga / os / bsdss4.tz / bsdss4 / bsdss / server / i386 / ntoh.s < prev    next >
Encoding:
Text File  |  1992-04-22  |  1.3 KB  |  51 lines

  1. /* 
  2.  * Mach Operating System
  3.  * Copyright (c) 1992 Carnegie Mellon University
  4.  * All Rights Reserved.
  5.  * 
  6.  * Permission to use, copy, modify and distribute this software and its
  7.  * documentation is hereby granted, provided that both the copyright
  8.  * notice and this permission notice appear in all copies of the
  9.  * software, derivative works or modified versions, and any portions
  10.  * thereof, and that both notices appear in supporting documentation.
  11.  * 
  12.  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
  13.  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
  14.  * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
  15.  * 
  16.  * Carnegie Mellon requests users of this software to return to
  17.  * 
  18.  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
  19.  *  School of Computer Science
  20.  *  Carnegie Mellon University
  21.  *  Pittsburgh PA 15213-3890
  22.  * 
  23.  * any improvements or extensions that they make and grant Carnegie Mellon 
  24.  * the rights to redistribute these changes.
  25.  */
  26. /*
  27.  * HISTORY
  28.  * $Log:    ntoh.s,v $
  29. # Revision 2.1  92/04/21  17:19:04  rwd
  30. # BSDSS
  31.  *
  32.  */
  33.  
  34. #include <i386/asm.h>
  35.  
  36. Entry(ntohl)
  37. ENTRY(htonl)
  38.     movl    4(%esp), %eax
  39.     rorw    $8, %ax
  40.     ror    $16,%eax
  41.     rorw    $8, %ax
  42.     ret
  43.  
  44.  
  45. Entry(ntohs)
  46. ENTRY(htons)
  47.     movzwl    4(%esp), %eax
  48.     rorw    $8, %ax
  49.     ret
  50.