2014-09-01 08:10:31 +00:00
|
|
|
; int __cdecl toupper(int ch)
|
2014-11-05 17:20:02 +00:00
|
|
|
_toupper proc
|
2014-09-01 08:10:31 +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 @@islower
|
|
|
|
mov ax, -1
|
|
|
|
jmp short @@ret
|
|
|
|
|
|
|
|
@@islower:
|
|
|
|
mov al, dl
|
|
|
|
mov ah, 0
|
|
|
|
mov bx, ax
|
|
|
|
test (__ctype+1)[bx], 8
|
|
|
|
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
|
|
|
|
_toupper endp
|