-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcodigoda4questão.asm
More file actions
76 lines (65 loc) · 1.08 KB
/
codigoda4questão.asm
File metadata and controls
76 lines (65 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
%include "io.inc"
extern scanf
extern printf
section .data
fms db "%c",0
section .bss
aux RESD 1
arrayc RESD 1
section .text
global CMAIN
CMAIN:
mov ebp, esp; for correct debugging
mov esi,0
vet:
push aux
push fms
call scanf
add esp,8
mov ebx,DWORD[aux]
mov DWORD[arrayc+esi*4],ebx
inc esi
cmp esi,10
je verifica
jmp vet
verifica:
mov esi,0
verifi:
mov eax,DWORD[arrayc+esi*4]
cmp eax,'a'
jae verific
cmp eax,'A'
jae verific2
cmp esi,10
je saida
mudandoparamaiusculo:
sub eax,32
mov DWORD[arrayc+4*esi],eax
inc esi
jmp verifi
mudandoparaminusculo:
add eax,32
mov DWORD[arrayc+4*esi],eax
inc esi
jmp verifi
verific:
cmp eax,'z'
jbe mudandoparamaiusculo
verific2:
cmp eax,'Z'
jbe mudandoparaminusculo
saida:
mov esi,0
printrando:
push DWORD[arrayc+esi*4]
push fms
call printf
mov esp,ebp
inc esi
cmp esi,10
je fim
jmp printrando
fim:
;write your code here
xor eax, eax
ret