Extern
-
Upload
cesar-gutierrez -
Category
Education
-
view
42 -
download
1
Transcript of Extern
extern _printf, _scanf
segment .datamsj db "introducir cadena con caracteres:",0msj2 db"el umero total de vocales a y u es:%d",0formato db "%s"d dd 100segment .bssc resd 25segment .text
global _main
_main:;---------------------------------------push msjcall _printfadd esp,4
push cpush formatocall _scanfadd esp,8
push ccall cantadd esp,4push esipush msj2call _printfadd esp,8
ret;---------------------------------------;..........subrutina....................cant:xor eax,eaxxor ecx,ecxxor edx,edxxor esi,esipush ebpmov ebp,espmov ebx,[ebp+8]ciclo:mov al,[ebx]cmp al,0x61jz contcmp al,0x75jz contback:inc ebxdec dword[d]jnz ciclo jmp fincont:inc esijmp backfin:mov esp,ebppop ebpret
extern _printf, _scanf
segment .datams1 db "Introducir el numero:",0,10formato db "%d",0,10ms2 db "El caudrado es : %d",0,10segment .bssnum resd 1segment .text global _main _main:;---------------------------------------
push ms1call _printfadd esp,4
push numpush formatocall _scanfadd esp,8
;mov ecx,2xor eax,eaxxor ebx,ebxpush dword [num]
call cuadrado
;..........subrutina...................add esp,4mov [num],eax
push dword [num]push ms2call _printfadd esp,8ret
cuadrado: push ebpmov ebp,esp
mov eax,[ebp+8]mov ebx,[ebp+8]mul ebx
mov esp,ebppop ebpret