From e932853c8c09ee1fba4d93016f87c04694532b29 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Fri, 25 Mar 2016 17:38:28 +0000 Subject: [PATCH] htonl/s: Z80 implementation --- Library/libs/htonl-z80.s | 21 +++++++++++++++++++++ Library/libs/htons-z80.s | 16 ++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 Library/libs/htonl-z80.s create mode 100644 Library/libs/htons-z80.s 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 -- 2.34.1