removed some verbose messages
[minix3.git] / lib / i86 / misc / hton86.s
blobdd2246b343c4ae3f93ac60cd50db9c4c4897e2d6
1 ! htonX(), ntohX() - Host to network byte order conversion
2 ! Author: Kees J. Bot
3 ! 7 Jan 1997
5 ! This is a little endian 8086, so we swap bytes to/from the big endian network
6 ! order. The normal <net/hton.h> macros are not used, they give lousy code.
8 .text
9 .define _htons, _ntohs
10 _htons:
11 _ntohs:
12 mov bx, sp
13 movb ah, 2(bx) ! Load bytes into ax in reverse order
14 movb al, 3(bx)
15 ret
17 .define _htonl, _ntohl
18 _htonl:
19 _ntohl:
20 mov bx, sp
21 movb dh, 2(bx) ! Load bytes into dx:ax in reverse order
22 movb dl, 3(bx)
23 movb ah, 4(bx)
24 movb al, 5(bx)
25 ret