add the c99 isblank() function

This commit is contained in:
Kelvin Sherlock 2018-03-04 22:28:30 -05:00
parent 8533ea221c
commit 6006cefc70
2 changed files with 29 additions and 2 deletions

View File

@ -101,6 +101,32 @@ yes lda #1
rtl
end
****************************************************************
*
* int isblank (int c)
*
* Inputs:
* 4,S - digit to test
*
* Outputs:
* A - result
*
****************************************************************
*
isblank start
lda 4,S fetch the operand
tax
lda 2,S remove parm from stack
sta 4,S
pla
sta 1,S
inx form the result
lda >__ctype2,X
and #_blank
rtl
end
****************************************************************
*
* int iscntrl (int c)
@ -844,7 +870,7 @@ __ctype2 start
dc i1'0' $06
dc i1'0' $07
dc i1'0' $08
dc i1'0' $09
dc i1'_blank' $09
dc i1'0' $0A
dc i1'0' $0B
dc i1'0' $0C
@ -867,7 +893,7 @@ __ctype2 start
dc i1'0' $1D
dc i1'0' $1E
dc i1'0' $1F
dc i1'0' ' '
dc i1'_blank' ' '
dc i1'0' !
dc i1'0' "
dc i1'0' #

View File

@ -36,6 +36,7 @@ _print gequ $80 [' '..'~']
_csym gequ $01 ['0'..'9','A'..'Z','a'..'z','_']
_csymf gequ $02 ['A'..'Z','a'..'z'.'_']
_octal gequ $04 ['0'..'7']
_blank gequ $08 ['\t', ' ']
;
; signal numbers
;