Added the new toascii function for the CBMs.

git-svn-id: svn://svn.cc65.org/cc65/trunk@4425 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz
2009-11-02 16:23:32 +00:00
parent 38641d9af8
commit 3b06aaaf85
2 changed files with 39 additions and 0 deletions

38
libsrc/cbm/toascii.s Normal file
View File

@@ -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