]> git.sur5r.net Git - cc65/commitdiff
Added the new toascii function for the CBMs.
authoruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Mon, 2 Nov 2009 16:23:32 +0000 (16:23 +0000)
committeruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Mon, 2 Nov 2009 16:23:32 +0000 (16:23 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@4425 b7a2c559-68d2-44c3-8de9-860c34a00d81

libsrc/cbm/Makefile
libsrc/cbm/toascii.s [new file with mode: 0644]

index 4fd88a2a9ee5ebc4ac4756570f0a8703a042e8fb..3daa254aff4702844bf53e47173930d1a2c76bec 100644 (file)
@@ -79,6 +79,7 @@ S_OBJS =      c_acptr.o       \
                 scratch.o       \
                 sysremove.o     \
                 sysrename.o     \
+                toascii.o       \
                wherex.o        \
                 wherey.o        \
                 write.o
diff --git a/libsrc/cbm/toascii.s b/libsrc/cbm/toascii.s
new file mode 100644 (file)
index 0000000..bea7ca8
--- /dev/null
@@ -0,0 +1,38 @@
+;
+; Ullrich von Bassewitz, 2009-11-02
+;
+; unsigned char __fastcall__ toascii (unsigned char c);
+; /* Convert a target specific character to ascii */
+;
+
+               .export         _toascii
+
+        .macpack        generic
+
+.proc   _toascii
+
+; Check for code between 65 and 90
+
+        cmp     #$41
+        blt     @L1
+        cmp     #$5B
+        bge     @L1
+
+; Code between 65 and 90
+
+        ora     #$20
+        rts
+
+; Check for code between 193 and 219
+
+@L1:    cmp     #$C1
+        blt     @L9
+        cmp     #$DC
+        bge     @L9
+
+; Code between 193 and 219
+
+        and     #$7F
+@L9:    rts
+
+.endproc