hton86.s
来自「minix操作系统最新版本(3.1.1)的源代码」· S 代码 · 共 26 行
S
26 行
! htonX(), ntohX() - Host to network byte order conversion! Author: Kees J. Bot! 7 Jan 1997!! This is a little endian 8086, so we swap bytes to/from the big endian network! order. The normal <net/hton.h> macros are not used, they give lousy code..text.define _htons, _ntohs_htons:_ntohs: mov bx, sp movb ah, 2(bx) ! Load bytes into ax in reverse order movb al, 3(bx) ret.define _htonl, _ntohl_htonl:_ntohl: mov bx, sp movb dh, 2(bx) ! Load bytes into dx:ax in reverse order movb dl, 3(bx) movb ah, 4(bx) movb al, 5(bx) ret
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?