2020-01-02 17:57:03 +00:00
|
|
|
; isascii.s
|
|
|
|
;
|
|
|
|
; This file is part of
|
|
|
|
; cc65 - a freeware C compiler for 6502 based systems
|
|
|
|
;
|
2020-02-02 17:21:25 +00:00
|
|
|
; https://cc65.github.io
|
2020-01-02 17:57:03 +00:00
|
|
|
;
|
|
|
|
; See "LICENSE" file for legal information.
|
|
|
|
;
|
|
|
|
; int isascii (int c);
|
|
|
|
;
|
|
|
|
|
|
|
|
.export _isascii
|
|
|
|
|
|
|
|
_isascii:
|
2020-02-02 17:21:25 +00:00
|
|
|
asl a ; high-bit to carry
|
|
|
|
txa ; check range of input param
|
|
|
|
bne @L1 ; out-of bounds?
|
|
|
|
adc #$FF ; calculate return value based on carry
|
2020-01-02 17:57:03 +00:00
|
|
|
rts
|
|
|
|
|
2020-01-05 14:57:44 +00:00
|
|
|
@L1: lda #$00 ; return false
|
2020-01-02 17:57:03 +00:00
|
|
|
tax
|
|
|
|
rts
|