From: Alan Cox Date: Wed, 13 Jan 2016 18:39:55 +0000 (+0000) Subject: cpu-z80: add ntohl X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=b64e62d57182e247117707cfe6e93e5e62c237bf;p=FUZIX.git cpu-z80: add ntohl --- diff --git a/Kernel/cpu-z80/cpu.h b/Kernel/cpu-z80/cpu.h index 9e5fe12a..6c18da17 100644 --- a/Kernel/cpu-z80/cpu.h +++ b/Kernel/cpu-z80/cpu.h @@ -82,3 +82,5 @@ typedef union { /* this structure is endian dependent */ #define COMMON_MEMORY static void COMMONSEG(void) __naked { __asm .area _COMMONMEM __endasm; } #define ntohs(x) ((((x) & 0xFF) << 8) | (((x) & 0xFF00) >> 8)) +#define ntohl(x) ((((x) & 0xFF) << 24) | (((x) & 0xFF00) << 8) | \ + (((x) & 0xFF0000) >> 8) | (((x >> 24) & 0xFF)))