mirror of
https://github.com/cc65/cc65.git
synced 2024-06-01 13:41:34 +00:00
Address Oliver's comments
This commit is contained in:
parent
dfe7562f76
commit
a90aa57510
|
@ -4403,7 +4403,7 @@ to undefined behaviour.
|
||||||
<quote>
|
<quote>
|
||||||
<descrip>
|
<descrip>
|
||||||
<tag/Function/Swaps byte order in a 32 bit word.
|
<tag/Function/Swaps byte order in a 32 bit word.
|
||||||
<tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
|
<tag/Header/<tt/<ref id="inet.h" name="arpa/inet.h">/
|
||||||
<tag/Declaration/<tt/int htonl(val)/
|
<tag/Declaration/<tt/int htonl(val)/
|
||||||
<tag/Description/Converts a 32 bit word from from network byte order
|
<tag/Description/Converts a 32 bit word from from network byte order
|
||||||
(big endian) to little endian (or vice-versa).
|
(big endian) to little endian (or vice-versa).
|
||||||
|
@ -4423,7 +4423,7 @@ be used in presence of a prototype.
|
||||||
<quote>
|
<quote>
|
||||||
<descrip>
|
<descrip>
|
||||||
<tag/Function/Swaps byte order in a 16 bit word.
|
<tag/Function/Swaps byte order in a 16 bit word.
|
||||||
<tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
|
<tag/Header/<tt/<ref id="inet.h" name="arpa/inet.h">/
|
||||||
<tag/Declaration/<tt/int htons(val)/
|
<tag/Declaration/<tt/int htons(val)/
|
||||||
<tag/Description/Converts a 16 bit word from from network byte order
|
<tag/Description/Converts a 16 bit word from from network byte order
|
||||||
(big endian) to little endian (or vice-versa) by swapping both its bytes.
|
(big endian) to little endian (or vice-versa) by swapping both its bytes.
|
||||||
|
@ -5811,7 +5811,7 @@ memory allocated for the driver.
|
||||||
<quote>
|
<quote>
|
||||||
<descrip>
|
<descrip>
|
||||||
<tag/Function/Swaps byte order in a 32 bit word.
|
<tag/Function/Swaps byte order in a 32 bit word.
|
||||||
<tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
|
<tag/Header/<tt/<ref id="inet.h" name="arpa/inet.h">/
|
||||||
<tag/Declaration/<tt/int __fastcall__ ntohl (int val);/
|
<tag/Declaration/<tt/int __fastcall__ ntohl (int val);/
|
||||||
<tag/Description/Converts a 32 bit word from from host byte order (little endian)
|
<tag/Description/Converts a 32 bit word from from host byte order (little endian)
|
||||||
to big endian (or vice-versa).
|
to big endian (or vice-versa).
|
||||||
|
@ -5830,7 +5830,7 @@ be used in presence of a prototype.
|
||||||
<quote>
|
<quote>
|
||||||
<descrip>
|
<descrip>
|
||||||
<tag/Function/Swaps byte order in a 16 bit word.
|
<tag/Function/Swaps byte order in a 16 bit word.
|
||||||
<tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
|
<tag/Header/<tt/<ref id="inet.h" name="arpa/inet.h">/
|
||||||
<tag/Declaration/<tt/int __fastcall__ ntohs (int val);/
|
<tag/Declaration/<tt/int __fastcall__ ntohs (int val);/
|
||||||
<tag/Description/Converts a 16 bit word from from host byte order (little endian)
|
<tag/Description/Converts a 16 bit word from from host byte order (little endian)
|
||||||
to big endian (or vice-versa) by swapping both its bytes.
|
to big endian (or vice-versa) by swapping both its bytes.
|
||||||
|
|
|
@ -1,3 +1,33 @@
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* */
|
||||||
|
/* arpa/inet.h */
|
||||||
|
/* */
|
||||||
|
/* Endianness utilities for cc65 */
|
||||||
|
/* */
|
||||||
|
/* */
|
||||||
|
/* */
|
||||||
|
/* (C) 2023 Colin Leroy-Mira, <colin@colino.net> */
|
||||||
|
/* */
|
||||||
|
/* */
|
||||||
|
/* This software is provided 'as-is', without any expressed or implied */
|
||||||
|
/* warranty. In no event will the authors be held liable for any damages */
|
||||||
|
/* arising from the use of this software. */
|
||||||
|
/* */
|
||||||
|
/* Permission is granted to anyone to use this software for any purpose, */
|
||||||
|
/* including commercial applications, and to alter it and redistribute it */
|
||||||
|
/* freely, subject to the following restrictions: */
|
||||||
|
/* */
|
||||||
|
/* 1. The origin of this software must not be misrepresented; you must not */
|
||||||
|
/* claim that you wrote the original software. If you use this software */
|
||||||
|
/* in a product, an acknowledgment in the product documentation would be */
|
||||||
|
/* appreciated but is not required. */
|
||||||
|
/* 2. Altered source versions must be plainly marked as such, and must not */
|
||||||
|
/* be misrepresented as being the original software. */
|
||||||
|
/* 3. This notice may not be removed or altered from any source */
|
||||||
|
/* distribution. */
|
||||||
|
/* */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
#ifndef _ARPA_INET_H
|
#ifndef _ARPA_INET_H
|
||||||
#define _ARPA_INET_H
|
#define _ARPA_INET_H
|
||||||
|
|
||||||
|
|
|
@ -9,13 +9,11 @@
|
||||||
.importzp tmp1, tmp2, sreg
|
.importzp tmp1, tmp2, sreg
|
||||||
|
|
||||||
_htonl := _ntohl
|
_htonl := _ntohl
|
||||||
.code
|
|
||||||
|
|
||||||
_ntohl:
|
_ntohl:
|
||||||
; The parts of our 32 bit word
|
; The parts of our 32 bit word
|
||||||
; are in sreg+1, sreg, X, A.
|
; are in sreg+1, sreg, X, A.
|
||||||
|
|
||||||
|
|
||||||
; Save A and X
|
; Save A and X
|
||||||
stx tmp1
|
stx tmp1
|
||||||
sta tmp2
|
sta tmp2
|
||||||
|
|
|
@ -9,8 +9,6 @@
|
||||||
|
|
||||||
_htons := _ntohs
|
_htons := _ntohs
|
||||||
|
|
||||||
.code
|
|
||||||
|
|
||||||
_ntohs:
|
_ntohs:
|
||||||
sta tmp1
|
sta tmp1
|
||||||
txa
|
txa
|
||||||
|
|
Loading…
Reference in New Issue
Block a user