Created
November 2, 2015 19:09
-
-
Save comtom/0fd966370688463362db to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
format PE | |
entry main | |
section '.text' code readable executable | |
main: | |
push label_input | |
push _format_output | |
call [printf] | |
add esp, 8 | |
push buffer | |
push _format_input | |
call [scanf] | |
add esp, 8 | |
xor ebx, ebx | |
mov ebx, buffer | |
procesa: | |
movzx eax, byte[ebx] | |
cmp eax, 0 | |
je termina | |
cmp al, $61 | |
jl mayus | |
; resta 32 | |
sub al, 32d | |
jmp continua | |
mayus: | |
add al, 32d | |
continua: | |
; guardo en memoria | |
mov [ebx], al | |
add ebx, 1 | |
jmp procesa | |
termina: | |
push buffer | |
push _format_output | |
call [printf] | |
add esp, 8 | |
push buffer | |
push _format_input | |
call [scanf] | |
add esp, 8 | |
ret | |
section '.data' data readable writeable | |
string rb 128 | |
_format_input db "%s",0 | |
_format_output db "%s",10,0 | |
buffer dq ? | |
label_input db "Ingrese frase para cambiar case:",10,0 | |
section '.idata' data import readable | |
include "macro\import32.inc" | |
library msvcrt, "MSVCRT.DLL" | |
import msvcrt,\ | |
printf ,'printf',\ | |
scanf ,'scanf',\ | |
exit ,'exit' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment