ToLowerStringEx function

The ToLowerStringEx function converts the string pointed to by the stack pointer to lowercase and stores the pointer on the top of the stack and in AX. It does not align the stack, which allows nested calls (for example, WriteStringEx(ToLowerStringEx(string))).

Parameters (stack): 1. Pointer to the string.

Return value: AX: pointer to the converted string (it also remains on the stack).

Flag state: The function does not modify the flags.

Program source code

Intel 8086 assembly program example demonstrating the use of the ToLowerStringEx function to convert and print a string.

title Author: Evgeny Sergeevich Dovgopolov

.286C
.model small
.stack 100h

data segment public
    string db "HELLO, WORLD OF ASSEMBLY 8086!\0"
data ends

code segment public
    assume  ds:data, cs:code
    include Handyfar.inc         ; Include the file with functions
    include Handymac.inc         ; Include the file with macros

    main proc
        call    SetDataSegment   ; Call the SetDataSegment procedure

        pushs   ds:[string]      ; Push the address of variable string onto the stack
        call    ToLowerStringEx  ; Call procedure ToLowerStringEx(string)
        call    WriteStringEx    ; Call procedure WriteStringEx(value from the stack)

        push    0                ; Push the byte return code onto the top of the stack
        call    ExitProcessEx    ; Call the ExitProcessEx(0) procedure
    main endp

code ends
end main

hello, world of assembly 8086!

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