4
« en: Lunes 26 de Noviembre de 2012, 05:47 »
la verdad hice trampa el programa original es en c++ pero visualstudio permite ver el codigo en enssambler y es este
#include <iostream>
using namespace std;
int main()
{
01264EE0 push ebp
01264EE1 mov ebp,esp
01264EE3 sub esp,184h
01264EE9 push ebx
01264EEA push esi
01264EEB push edi
01264EEC lea edi,[ebp-184h]
01264EF2 mov ecx,61h
01264EF7 mov eax,0CCCCCCCCh
01264EFC rep stos dword ptr es:[edi]
01264EFE mov eax,dword ptr ds:[0126F0E0h]
01264F03 xor eax,ebp
01264F05 mov dword ptr [ebp-4],eax
int matriz1 [2][2];
int matriz2 [2][2];
int matrizresultado[2][2];
int i,j;
//ingreso de datos matriz 1
for (int i = 0; i <=1 ; i++)
01264F08 mov dword ptr [ebp-6Ch],0
01264F0F jmp main+3Ah (01264F1Ah)
01264F11 mov eax,dword ptr [ebp-6Ch]
01264F14 add eax,1
01264F17 mov dword ptr [ebp-6Ch],eax
01264F1A cmp dword ptr [ebp-6Ch],1
01264F1E jg main+0AAh (01264F8Ah)
{
for (int j = 0; j <=1; j++)
01264F20 mov dword ptr [ebp-78h],0
01264F27 jmp main+52h (01264F32h)
01264F29 mov eax,dword ptr [ebp-78h]
01264F2C add eax,1
01264F2F mov dword ptr [ebp-78h],eax
01264F32 cmp dword ptr [ebp-78h],1
01264F36 jg main+0A8h (01264F88h)
{
cout<<"ingrese valores primer matriz"<<endl;
01264F38 mov esi,esp
01264F3A mov eax,dword ptr ds:[01270328h]
01264F3F push eax
01264F40 push 126CE54h
01264F45 mov ecx,dword ptr ds:[1270334h]
01264F4B push ecx
01264F4C call std::operator<<<std::char_traits<char> > (012612ADh)
01264F51 add esp,8
{
cout<<"ingrese valores primer matriz"<<endl;
01264F54 mov ecx,eax
01264F56 call dword ptr ds:[127033Ch]
01264F5C cmp esi,esp
01264F5E call __RTC_CheckEsp (0126132Fh)
cin>>matriz1[i][j];
01264F63 mov eax,dword ptr [ebp-6Ch]
01264F66 lea ecx,matriz1[eax*8]
01264F6A mov edx,dword ptr [ebp-78h]
01264F6D lea eax,[ecx+edx*4]
01264F70 mov esi,esp
01264F72 push eax
01264F73 mov ecx,dword ptr ds:[1270394h]
01264F79 call dword ptr ds:[127032Ch]
01264F7F cmp esi,esp
01264F81 call __RTC_CheckEsp (0126132Fh)
}
01264F86 jmp main+49h (01264F29h)
}
01264F88 jmp main+31h (01264F11h)
//ingreso matriz 2
for (int i = 0; i<=1; i++)
01264F8A mov dword ptr [ebp-84h],0
01264F94 jmp main+0C5h (01264FA5h)
01264F96 mov eax,dword ptr [ebp-84h]
01264F9C add eax,1
01264F9F mov dword ptr [ebp-84h],eax
01264FA5 cmp dword ptr [ebp-84h],1
01264FAC jg main+14Dh (0126502Dh)
{
for (int j = 0; j <=1; j++)
01264FAE mov dword ptr [ebp-90h],0
01264FB8 jmp main+0E9h (01264FC9h)
01264FBA mov eax,dword ptr [ebp-90h]
01264FC0 add eax,1
01264FC3 mov dword ptr [ebp-90h],eax
01264FC9 cmp dword ptr [ebp-90h],1
01264FD0 jg main+148h (01265028h)
{
cout<<"ingrese valores segunda matriz"<<endl;
01264FD2 mov esi,esp
01264FD4 mov eax,dword ptr ds:[01270328h]
01264FD9 push eax
01264FDA push 126CD18h
01264FDF mov ecx,dword ptr ds:[1270334h]
01264FE5 push ecx
01264FE6 call std::operator<<<std::char_traits<char> > (012612ADh)
01264FEB add esp,8
01264FEE mov ecx,eax
01264FF0 call dword ptr ds:[127033Ch]
01264FF6 cmp esi,esp
01264FF8 call __RTC_CheckEsp (0126132Fh)
cin>>matriz2[i][j];
01264FFD mov eax,dword ptr [ebp-84h]
01265003 lea ecx,matriz2[eax*8]
01265007 mov edx,dword ptr [ebp-90h]
0126500D lea eax,[ecx+edx*4]
01265010 mov esi,esp
01265012 push eax
01265013 mov ecx,dword ptr ds:[1270394h]
01265019 call dword ptr ds:[127032Ch]
0126501F cmp esi,esp
01265021 call __RTC_CheckEsp (0126132Fh)
}
01265026 jmp main+0DAh (01264FBAh)
}
01265028 jmp main+0B6h (01264F96h)
//suma de matrices
for (int i = 0; i<=1; i++)
0126502D mov dword ptr [ebp-9Ch],0
01265037 jmp main+168h (01265048h)
01265039 mov eax,dword ptr [ebp-9Ch]
0126503F add eax,1
01265042 mov dword ptr [ebp-9Ch],eax
01265048 cmp dword ptr [ebp-9Ch],1
0126504F jg main+1D2h (012650B2h)
{
for (int j = 0; j <=1; j++)
01265051 mov dword ptr [ebp-0A8h],0
0126505B jmp main+18Ch (0126506Ch)
0126505D mov eax,dword ptr [ebp-0A8h]
01265063 add eax,1
01265066 mov dword ptr [ebp-0A8h],eax
0126506C cmp dword ptr [ebp-0A8h],1
01265073 jg main+1D0h (012650B0h)
{
matrizresultado[i][j]=matriz1[i][j]+matriz2[i][j];
01265075 mov eax,dword ptr [ebp-9Ch]
0126507B lea ecx,matriz1[eax*8]
0126507F mov edx,dword ptr [ebp-9Ch]
01265085 lea eax,matriz2[edx*8]
01265089 mov edx,dword ptr [ebp-0A8h]
0126508F mov ecx,dword ptr [ecx+edx*4]
01265092 mov edx,dword ptr [ebp-0A8h]
01265098 add ecx,dword ptr [eax+edx*4]
0126509B mov eax,dword ptr [ebp-9Ch]
012650A1 lea edx,matrizresultado[eax*8]
012650A5 mov eax,dword ptr [ebp-0A8h]
012650AB mov dword ptr [edx+eax*4],ecx
}
012650AE jmp main+17Dh (0126505Dh)
}
012650B0 jmp main+159h (01265039h)
//mostrar resultado
for (int i = 0; i<=1; i++)
012650B2 mov dword ptr [ebp-0B4h],0
012650BC jmp main+1EDh (012650CDh)
012650BE mov eax,dword ptr [ebp-0B4h]
012650C4 add eax,1
012650C7 mov dword ptr [ebp-0B4h],eax
012650CD cmp dword ptr [ebp-0B4h],1
012650D4 jg main+271h (01265151h)
{
for (int j = 0; j <=1; j++)
012650D6 mov dword ptr [ebp-0C0h],0
012650E0 jmp main+211h (012650F1h)
012650E2 mov eax,dword ptr [ebp-0C0h]
012650E8 add eax,1
012650EB mov dword ptr [ebp-0C0h],eax
012650F1 cmp dword ptr [ebp-0C0h],1
012650F8 jg main+26Ch (0126514Ch)
{
cout<<"el resultado es "<<matrizresultado[i][j]<<endl;
012650FA mov esi,esp
012650FC mov eax,dword ptr ds:[01270328h]
01265101 push eax
01265102 mov ecx,dword ptr [ebp-0B4h]
01265108 lea edx,matrizresultado[ecx*8]
0126510C mov edi,esp
0126510E mov eax,dword ptr [ebp-0C0h]
01265114 mov ecx,dword ptr [edx+eax*4]
01265117 push ecx
01265118 push 126CD50h
0126511D mov edx,dword ptr ds:[1270334h]
01265123 push edx
01265124 call std::operator<<<std::char_traits<char> > (012612ADh)
01265129 add esp,8
0126512C mov ecx,eax
0126512E call dword ptr ds:[1270338h]
01265134 cmp edi,esp
01265136 call __RTC_CheckEsp (0126132Fh)
0126513B mov ecx,eax
0126513D call dword ptr ds:[127033Ch]
01265143 cmp esi,esp
01265145 call __RTC_CheckEsp (0126132Fh)
}
0126514A jmp main+202h (012650E2h)
}
0126514C jmp main+1DEh (012650BEh)
getchar();
01265151 mov esi,esp
01265153 call dword ptr ds:[1270470h]
01265159 cmp esi,esp
0126515B call __RTC_CheckEsp (0126132Fh)
system("PAUSE");
01265160 mov esi,esp
01265162 push 126CD64h
01265167 call dword ptr ds:[1270484h]
0126516D add esp,4
01265170 cmp esi,esp
01265172 call __RTC_CheckEsp (0126132Fh)
return 0;
01265177 xor eax,eax
}
01265179 push edx
0126517A mov ecx,ebp
0126517C push eax
0126517D lea edx,ds:[12651A8h]
01265183 call @_RTC_CheckStackVars@8 (01261127h)
01265188 pop eax
01265189 pop edx
0126518A pop edi
0126518B pop esi
0126518C pop ebx
0126518D mov ecx,dword ptr [ebp-4]
01265190 xor ecx,ebp
01265192 call @__security_check_cookie@4 (01261041h)
01265197 add esp,184h
0126519D cmp ebp,esp
0126519F call __RTC_CheckEsp (0126132Fh)
012651A4 mov esp,ebp
012651A6 pop ebp
012651A7 ret
012651A8 add eax,dword ptr [eax]
012651AA add byte ptr [eax],al
012651AC mov al,51h
012651AE add eax,ebp
012651B1 ?? ??
012651B2 ?? ??
012651B3 call dword ptr [eax]
012651B5 add byte ptr [eax],al
012651B7 add ah,ch
012651B9 push ecx
012651BA add eax,edx
012651BD ?? ??
012651BE ?? ??
012651BF call dword ptr [eax]
012651C1 add byte ptr [eax],al
012651C3 add ah,ah
012651C5 push ecx
012651C6 add dword ptr es:[eax+10FFFFFFh],edi
012651CD add byte ptr [eax],al
012651CF add ah,dl
012651D1 push ecx
012651D2 add dword ptr es:[ebp+61h],ebp
012651D6 je std::_Container_base12::_Orphan_all+4h (0126524Ah)
012651D8 imul edi,dword ptr [edx+72h],6C757365h
012651DF je std::_Container_base12::~_Container_base12+2h (01265242h)
012651E1 outs dx,dword ptr fs:[esi]
012651E3 add byte ptr [ebp+61h],ch
012651E6 je std::_Xout_of_range+2h (0126525Ah)
012651E8 imul edi,dword ptr [edx+32h],74616D00h
012651EF jb std::_Xout_of_range+2h (0126525Ah)
012651F1 jp _main+344h (01265224h)
012651F3 add ah,cl