Jump to content
Semdo

Passar letras todas de uma string para maiusculas em assembly (strToUp)

Recommended Posts

Semdo

Já fiz o código mas ele da-me um erro :wallbash: ao passar as letras todas para o eax, não sei porquê!!!

Alguém me ajuda por favor.    :bye2:

Código:

.intel_syntax noprefix
.text
.global ToUper


ToUper:
push ebp                            
mov ebp, esp
push ebx

mov edx, [ebp+8]
mov eax, [ebp+12]
mov al, [edx]
mov ebx, 0


for:
	mov al, [edx]
cmp ebx,[edx]
je fim
cmp al, 97
jg e_minuscula
add edx,1
mov al, [edx+ebx]
jmp for

e_minuscula:
sub al, 32
mov [eax], al
add edx,1
jmp for

fim:
mov eax, edx
pop ebx
pop ebp
ret

comps

Share this post


Link to post
Share on other sites
mslopes

Uma borla.

.intel_syntax noprefix
.text
.global exc

exc:
push ebp
mov ebp, esp
push ebx
mov eax,[ebp+8]
mov ebx,[ebp+12]
mov ecx , 0
mov edx , 0
for:
	cmp byte ptr[eax+edx],0
	je fim
	mov cl, [eax+edx]
	sub cl , 'a'-'A'
	and cl, 0xff
	mov [ebx+edx], cl
	inc edx
	jmp for
fim:
mov byte ptr[ebx+edx], 0
mov eax,[ebp+12]
pop ebx
pop ebp
ret

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.