2014-09-01 07:28:45 +00:00
|
|
|
; int __cdecl tolower(int ch)
|
2014-11-05 17:20:02 +00:00
|
|
|
_tolower proc
|
2014-09-01 07:28:45 +00:00
|
|
|
@@ch = word ptr dPtrSize + 2
|
|
|
|
|
|
|
|
push bp
|
|
|
|
mov bp, sp
|
|
|
|
push si
|
|
|
|
push di
|
|
|
|
mov dx, [bp+@@ch]
|
|
|
|
cmp dx, -1
|
|
|
|
jnz short @@isupper
|
|
|
|
mov ax, -1
|
|
|
|
jmp short @@ret
|
|
|
|
|
|
|
|
@@isupper:
|
|
|
|
mov al, dl
|
|
|
|
mov ah, 0
|
|
|
|
mov bx, ax
|
|
|
|
test (__ctype+1)[bx], 4
|
|
|
|
jz short @@ret_ch
|
|
|
|
mov al, dl
|
|
|
|
mov ah, 0
|
|
|
|
add ax, 20h
|
|
|
|
jmp short @@ret
|
|
|
|
|
|
|
|
@@ret_ch:
|
|
|
|
mov al, dl
|
|
|
|
mov ah, 0
|
|
|
|
|
|
|
|
@@ret:
|
|
|
|
pop di
|
|
|
|
pop si
|
|
|
|
pop bp
|
|
|
|
ret
|
|
|
|
_tolower endp
|