]> git.sur5r.net Git - cc65/blobdiff - libsrc/common/isspace.s
cleanups and add more comments
[cc65] / libsrc / common / isspace.s
index 1c6cc2e8a6aa763217177d71b8591c8c743c1b75..64849f7f76b117c62befdaa9150c8d3d6db10d32 100644 (file)
@@ -4,12 +4,18 @@
 ; int isspace (int c);
 ;
 
-       .export         _isspace
-       .import         __ctype
+        .export         _isspace
+        .include        "ctype.inc"
 
 _isspace:
-       tay
-       lda     __ctype,y       ; Get character classification
-               and     #$60            ; Mask space bits
-       rts
+        cpx     #$00            ; Char range ok?
+        bne     @L1             ; Jump if no
+        tay
+        lda     __ctype,y       ; Get character classification
+        and     #(CT_SPACE | CT_OTHER_WS)   ; Mask space bits
+        rts
+
+@L1:    lda     #$00            ; Return false
+        tax
+        rts