/* This C language subroutine converts a lower case letter into upper case. 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 toupper(int c); */ #include "lib_glob.h" #include "cty_glob.h" .SEGMENT/CODE Code_Space_Name; .FILE RTL_FILENAME; .GLOBAL _toupper; _toupper: R12=122; /*122 = ASC('z')*/ R8=97; /*97 = ASC('a');*/ COMP(R4,R12), R0=R4; /* If c > 'z' return */ IF GT JUMP (PC, restore_state) (DB); COMP(R4,R8), FETCH_RETURN /* else if c >= 'a' */ R2=0xffffffdf; IF GE R0=R0 AND R2; /* mask out lower case */ restore_state: RETURN (DB); RESTORE_STACK RESTORE_FRAME .ENDSEG;