From 365042276939037eb2bd0df22bfa79769806f631 Mon Sep 17 00:00:00 2001 From: cuz Date: Sat, 23 Nov 2002 11:19:51 +0000 Subject: [PATCH] New module git-svn-id: svn://svn.cc65.org/cc65/trunk@1602 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- libsrc/runtime/Makefile | 1 + libsrc/runtime/along.s | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 libsrc/runtime/along.s diff --git a/libsrc/runtime/Makefile b/libsrc/runtime/Makefile index a7808a82b..ede6e7512 100644 --- a/libsrc/runtime/Makefile +++ b/libsrc/runtime/Makefile @@ -13,6 +13,7 @@ OBJS = add.o \ addeqsp.o \ addysp.o \ + along.o \ and.o \ aslax1.o \ aslax2.o \ diff --git a/libsrc/runtime/along.s b/libsrc/runtime/along.s new file mode 100644 index 000000000..e8707d8c6 --- /dev/null +++ b/libsrc/runtime/along.s @@ -0,0 +1,24 @@ +; +; Ullrich von Bassewitz, 23.11.2002 +; +; CC65 runtime: Convert char in ax into a long +; + + .export aulong, along + .importzp sreg + +; Convert A from char to long in EAX + +aulong: ldx #0 + stx sreg + stx sreg+1 + rts + +along: cmp #$80 ; Positive? + bcc aulong ; Yes, handle like unsigned type + ldx #$ff + stx sreg + stx sreg+1 + rts + + -- 2.39.5