]> git.sur5r.net Git - cc65/commitdiff
New module
authorcuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sat, 23 Nov 2002 11:19:51 +0000 (11:19 +0000)
committercuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sat, 23 Nov 2002 11:19:51 +0000 (11:19 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@1602 b7a2c559-68d2-44c3-8de9-860c34a00d81

libsrc/runtime/Makefile
libsrc/runtime/along.s [new file with mode: 0644]

index a7808a82bdc68e24ce6ea9cc11331687c59bb632..ede6e75129ac16f7ca1cbda4b35be5ccb3cdcc51 100644 (file)
@@ -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 (file)
index 0000000..e8707d8
--- /dev/null
@@ -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
+
+