Name: Anonymous 2009-07-13 13:47
Write a routine which makes string uppercase or lowercase in language of your choice in least possible execution time.
:toupper
push esi
push edi
mov esi, [esp+8]
mov edi, esi
mov ecx, ebx
mov ebx, .uptab
.uploop
lodsb
or al, al
jz .upexit
xlat
stosb
jmps .uploop
.upexit
mov ebx, ecx
pop edi
pop esi
ret
.uptab
; the content of the table is left as an exercise for the programmer.