1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-25 02:29:52 +00:00
cc65/libsrc/common/isascii.s

25 lines
554 B
ArmAsm
Raw Normal View History

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