/* This C language subroutine converts an upper case letter to lowercase. The Run Time Library for the C Language. Gordon A. Sterling (617) 461 - 3076 DSP Development Tools Engineering Updated on 5/94 by AS #include
int tolower(int c); */ #include "lib_glob.h" #include "cty_glob.h" .SEGMENT/CODE Code_Space_Name; .FILE RTL_FILENAME; .GLOBAL _tolower; _tolower: R12=90; /* 90 = ASC('Z') */ R8=65; /* 65 = ASC('A') */ R2=32; /* Caps mask */ COMP(R4,R12), R0=R4; /* Test for <= Z */ IF GT R2=R2-R2; /* Zero caps mask */ COMP(R4,R8), FETCH_RETURN /* Test for >= A */ IF GE R0=R4 OR R2; /* If so, mask in caps */ restore_state: RETURN (DB); RESTORE_STACK RESTORE_FRAME .ENDSEG;