FAT has a somewhat obnoxious rule: byte E5 in the first position is
encoded as 05. If it was *always* that case we could simply fold it
into the codepage tables, but that rule applies only to the first
character.
Note that in the common codepages (incl. 437), E5 is lower-case sigma
(σ), which we currently upper case to upper case sigma (Σ, E4)
preventing a match -- which DOS *doesn't* do (it thinks of the Greek
characters as symbols, not subject to case distinctions.) Putting
that special case in the codepage-generation scripts seems too ugly,
though.
cmp al,'.' ; Period -> space-fill
je .is_period
xlatb ; Convert to upper case
- stosb
+ mov ah,cl ; If the first byte (only!)...
+ cmp ax,0BE5h ; ... equals E5 hex ...
+ jne .charok
+ mov al,05h ; ... change it to 05 hex
+.charok: stosb
loop .loop ; Don't continue if too long
; Find the end for the benefit of longname search
.find_end: