From: Alan Cox Date: Fri, 25 Mar 2016 17:38:28 +0000 (+0000) Subject: htonl/s: Z80 implementation X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=e932853c8c09ee1fba4d93016f87c04694532b29;p=FUZIX.git htonl/s: Z80 implementation --- diff --git a/Library/libs/htonl-z80.s b/Library/libs/htonl-z80.s new file mode 100644 index 00000000..8d47d330 --- /dev/null +++ b/Library/libs/htonl-z80.s @@ -0,0 +1,21 @@ +; +; SDCC makes a bit of a mess of this so do it by hand +; + .area _CODE + + .globl _htonl + +_htonl: + pop bc + pop hl + pop de + push de + push hl + push bc + ld a,l + ld l,d + ld d,a + ld a,h + ld h,e + ld e,a + ret diff --git a/Library/libs/htons-z80.s b/Library/libs/htons-z80.s new file mode 100644 index 00000000..e162f293 --- /dev/null +++ b/Library/libs/htons-z80.s @@ -0,0 +1,16 @@ +; +; SDCC makes a bit of a mess of this so do it by hand +; + .area _CODE + + .globl _htons + +_htons: + pop de + pop hl + push hl + push de + ld a,h + ld h,l + ld l,a + ret