TOC PREV NEXT INDEX

Put your logo here!


4 Character Classification and Utilities Module (chars.hhf)


The HLA CHARS module contains several procedures that classify and convert various character subtypes. Conversion routines include upper and lower case conversion. Classification routines include checking for alphabetic characters, numeric characters, whitespace characters, etc.

4.1 Conversion Functions

chars.toUpper( c:byte );  @returns( "AL" ); 
 

This routine returns the character passed as a parameter in the AL register. If the character passed as a parameter was a lower case alphabetic character, this procedure converts it to upper case before returning it.

 chars.toLower( c:byte );  @returns( "AL" );
 

This routine returns the character passed as a parameter in the AL register. If the character passed as a parameter was an upper case alphabetic character, this procedure converts it to lower case before returning it.

4.2 Predicates (Tests)

The following functions test characters in the seven-bit ASCII character set. These functions produce undefined results for other character sets.

chars.isAlpha( c:byte ); @returns( "EAX" );
 

This routine returns true in the EAX register if the parameter is an alphabetic character.

chars.isUpper( c:byte ); @returns( "EAX" );
 

This routine returns true in the EAX register if the parameter is an upper case alphabetic character.

chars.isLower( c:byte ); @returns( "EAX" );
 

This routine returns true in the EAX register if the parameter is a lower case alphabetic character.

chars.isAlphaNum( c:byte ); @returns( "EAX" );
 

This routine returns true in the EAX register if the parameter is an alphanumeric character.

chars.isDigit( c:byte ); @returns( "EAX" );
 

This routine returns true in the EAX register if the parameter is a decimal digit character.

chars.isXDigit( c:byte ); @returns( "EAX" );
 

This routine returns true in the EAX register if the parameter is a hexadecimal digit character.

chars.isGraphic( c:byte ); @returns( "EAX" );
 

This routine returns true in the EAX register if the parameter is a printable character (this excludes spaces and control characters; also, this function only applies to ASCII characters).

chars.isSpace( c:byte ); @returns( "EAX" );
 

This routine returns true in the EAX register if the parameter is a white space character. A white space character is a space, carriage return, linefeed, or tab character.

chars.isASCII( c:byte ); @returns( "EAX" );
 

This routine returns true in EAX if the parameter byte is an ASCII character (value in the range $0..$7F).

chars.isCtrl( c:byte ); @returns( "EAX" );
 

This function returns true in EAX if the parameter is a control character ($0..$1F or $7F).



TOC PREV NEXT INDEX