IsAlphaEx function

The IsAlphaEx function checks whether the character passed through the stack is a letter (Latin or Cyrillic). The function automatically aligns the stack to 2 bytes.

Parameters (stack): 1. Character to check.

Return value: ZF = 1 if the character is a letter; ZF = 0 otherwise.

Flag state: The function affects all processor flags.

Program source code

Intel 8086 assembly program example demonstrating the use of the IsAlphaEx function to check whether a character from the stack is a letter.

title Author: Evgeny Sergeevich Dovgopolov

.286C
.model small
.stack 100h

data segment public
    msg_true  db "TRUE\0"
    msg_false db "FALSE\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

        push    '4'             ; Push the character '4' onto the top of the stack
        call    IsAlphaEx       ; Call the IsAlphaEx('4') procedure

        jne     @False          ; If ZF=0, jump to the label @False

    @True:
        pushs   ds:[msg_true]   ; Push the address of the msg_true variable onto the top of the stack
        jmp     @Done           ; Jump unconditionally to the label @Done

    @False:
        pushs   ds:[msg_false]  ; Push the address of the msg_false variable onto the top of the stack

    @Done:
        call    WriteStringEx   ; Call the WriteStringEx(value from the stack) procedure

        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

FALSE

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