The ToLowerChar function

The ToLowerChar function converts a character of the English and Russian alphabet from uppercase to lowercase. If the character is already lowercase or is not a letter, it is returned unchanged.

Parameters: AL: The character to convert.

Return value: AL: The character in lowercase.

Flag state: The function does not modify the flags.

Program source code

An example program for the Intel 8086 assembler demonstrating the use of the ToLowerChar function to convert a character to lowercase.

title Author: Evgeny Sergeevich Dovgopolov

.model small
.stack 100h

code segment public             ; Start of the code segment
    assume  cs:code
    include Handyfar.inc        ; Include the file with functions

    main proc                   ; Start of the main procedure
        call    SetDataSegment  ; Call the SetDataSegment procedure

        mov     al, 'D'         ; Copy the 'D' character value into the al register
        call    ToLowerChar     ; Call the ToLowerChar procedure (al:'D')
        call    PutChar         ; Call the PutChar procedure (al:'d');

        xor     al, al          ; Clear the al register
        call    ExitProcess     ; Call the ExitProcess procedure
    main endp                   ; End of the main procedure

code ends                       ; End of the code segment
end main	                    ; End of file. The main procedure is the entry point

d

Example taken from the textbook "HANDYFAR - MASM (Evgeny Sergeevich Dovgopolov)".