ORCALib/ctype.asm

1 line
20 KiB
NASM
Raw Normal View History

2017-10-02 00:00:58 +00:00
keep obj/ctype case on **************************************************************** * * CType - Character Types Library * * This code implements the tables and subroutines needed to * support the standard C library CTYPES. * * July 1988 * Mike Westerfield * * Copyright 1988 * Byte Works, Inc. * **************************************************************** * CType start dummy routine copy equates.asm end **************************************************************** * * int isalnum (int c) * * Inputs: * 4,S - digit to test * * Outputs: * A - result * **************************************************************** * isalnum 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 >__ctype,X and #_upper+_lower+_digit rtl end **************************************************************** * * int isalpha (int c) * * Inputs: * 4,S - digit to test * * Outputs: * A - result * **************************************************************** * isalpha 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 >__ctype,X and #_upper+_lower rtl end **************************************************************** * * int isascii (int c) * * Inputs: * 4,S - digit to test * * Outputs: * A - result * **************************************************************** * isascii start lda 4,S fetch the operand tax lda 2,S remove parm from stack sta 4,S pla sta 1,S cpx #$0080 form the result blt yes lda #0 rtl yes lda #1 rtl end **************************************************************** * * int isctrl (int c) * * Inputs: * 4,S - digit to test * * Outputs: * A - result * **************************************************************** * isctrl 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 >__ctype,X and #_control rtl end **************************************************************** * * int iscsym (int c) * * Inputs: * 4,S - digit to test * * Outputs: * A - result * **************************************************************** * iscsym 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 #_csym rtl end **************************************************************** * * int iscsymf (int c) * * Inputs: * 4,S - digit to test * * Outputs: * A - result * **************************************************************** * iscsymf 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 #_csymf rtl end **************************************************************** * * int isdigit (int c) * * Inputs: * 4,S - digit to test * * Outputs: * A - result * **************************************************************** * isdigit 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 >__ctype,X and #_digit rtl end **************************************************************** * * int isgraph (int c) * * Inputs: * 4,S - digit to test * * Outputs: * A - result * **************************************************************** * isgraph 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 >__ctype,X and #_upper+_lower+_digit+_punctuation rtl end **************************************************************** * * int islower (int c) * * Inputs: * 4,S - digit to test * * Outputs: * A - result * **************************************************************** * islower 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 >__ctype,X and #_lower rtl end **************************************************************** * * int isodigit (int c) * * Inputs: * 4,S - digit to test * * Outputs: * A