Add ntohs, htons, ntohl, htons.

This commit is contained in:
Colin Leroy-Mira
2023-09-06 08:09:00 +02:00
parent e52e350498
commit dfe7562f76
6 changed files with 217 additions and 0 deletions

18
libsrc/common/ntohs.s Normal file
View File

@@ -0,0 +1,18 @@
;
; Colin Leroy-Mira <colin@colino.net>, 2023-09-06
;
; int __fastcall__ ntohs (int val);
;
.export _ntohs, _htons
.importzp tmp1
_htons := _ntohs
.code
_ntohs:
sta tmp1
txa
ldx tmp1
rts