Why You Should Hire A Tutor For Your Homework ?


X


Payment

Question

This is the assembly language problem. (please use DOSBox to runthe program)Write a program to transform a 2-dimentional array,i.e., swap A[i][j] with A[j][i]. You can assume that the array isknown so as the two dimensions, rows and columns.

Solution

xxxx@xxx-xxxx:xxxx QWORD xxx [rip+0x200afa] # xxxxxx&xx;_xxxxxx_xxxxxx_xxxxx_+xxx&xx;xxx xxxxx PTR [xxx+xxxxxxxx] # xxxxxx&xx;_xxxxxx_xxxxxx_xxxxx_+xxxx&xx;xxx xxxxx xxx [rax+0x0]
puts@plt:
jmp xxxxx PTR [xxx+xxxxxxxx] # xxxxxx&xx;_xxxxxx_xxxxxx_xxxxx_+xxxx&xx;xxxx 0x0
jmp xxxxxx <_init+0x20>
scanf@plt:
jmp xxxxx xxx [xxx+xxxxxxxx] # xxxxxx&xx;_xxxxxx_xxxxxx_xxxxx_+xxxx&xx;xxxx 0x2
jmp xxxxxx &xx;_xxxx+xxxx&xx;xxxx:xxxx xxxxxx rbp,rsp
push xxxxxx rsp,0x48
mov xxxxx xxx [xxx-xxxx],xxxxxx edi,0x40087c
call xxxxxx <puts@plt>
lea xxx,[xxx-xxxx]xxx xxx,[xxx-xxxx]xxx xxx,xxxxxx edi,0x400894
mov xxx,xxxxxxx 400520 &xx;xxxxx@xxx&xx;xxx xxxxx xxx [rbp-0x14],0x0
jmp xxxxxx <main+0x92>
mov xxxxx xxx [xxx-xxxx],xxxxxx 4006a5 &xx;xxxx+xxxx&xx;xxx eax,DWORD xxx [xxx-xxxx]xxx xxx,xxxxx PTR [xxx-xxxx]xxx rcx,[rbp-0x50]
movsxd xxx,xxxxxxxxx xxx,xxxxxx xxx,xxxxxx rax,rax
add xxx,xxxxxx rax,[rbx+rax*1]
shl xxx,xxxxxx xxx,[xxx+xxx*x]xxx xxx,xxxxxx edi,0x400899
mov xxx,xxxxxxx 400520 &xx;xxxxx@xxx&xx;xxx xxxxx xxx [rbp-0x18],0x1
mov xxx,xxxxx PTR [xxx-xxxx]xxx xxxxx xxx [rbp-0x18],eax
setl xxxxxx al,al
jne xxxxxx &xx;xxxx+xxxx&xx;xxx xxxxx PTR [xxx-xxxx],xxxxxx eax,DWORD xxx [xxx-xxxx]xxx xxxxx PTR [xxx-xxxx],xxxxxxx al
test xx,xxxxx xxxxxx &xx;xxxx+xxxx&xx;xxx DWORD xxx [rbp-0x14],0x0
jmp xxxxxx &xx;xxxx+xxxxx&xx;xxx xxx,xxxxx PTR [xxx-xxxx]xxx DWORD xxx [xxx-xxxx],xxxxxx xxxxxx <main+0x12e>
mov xxx,xxxxx PTR [xxx-xxxx]xxx xxx,xxxxx xxx [rbp-0x18]
movsxd xxx,xxxxxxxxx rdx,eax
mov xxx,xxxxxx xxx,xxxxxx xxx,xxxxxx rax,rcx
mov xxx,xxxxx PTR [xxx+xxx*x-xxxx]xxx xxxxx xxx [rbp-0x24],eax
mov xxx,xxxxx PTR [xxx-xxxx]xxx xxx,xxxxx xxx [rbp-0x18]
mov xxx,xxxxx PTR [xxx-xxxx]xxx xxx,xxxxx xxx [rbp-0x14]
movsxd xxx,xxxxxxxxx rdx,eax
mov xxx,xxxxxx xxx,xxxxxx xxx,xxxxxx rax,rcx
mov xxx,xxxxx PTR [xxx+xxx*x-xxxx]xxxxxx xxx,xxxxxxxxx xxx,xxxxxx rax,rdx
add xxx,xxxxxx rax,rdx
add xxx,xxxxxx xxxxx xxx [rbp+rax*4-0x50],ecx
mov xxx,xxxxx PTR [xxx-xxxx]xxx xxx,xxxxx xxx [rbp-0x14]
movsxd xxx,xxxxxxxxx rdx,eax
mov xxx,xxxxxx xxx,xxxxxx xxx,xxxxxx rdx,[rax+rcx*1]
mov xxx,xxxxx PTR [xxx-xxxx]xxx xxxxx xxx [rbp+rdx*4-0x50],eax
add xxxxx PTR [xxx-xxxx],xxxxxx xxx,xxxxx xxx [rbp-0x20]
cmp xxxxx PTR [xxx-xxxx],xxxxxxx xxxxxx xx,xxxxx 4006d7 &xx;xxxx+xxxx&xx;xxx DWORD xxx [xxx-xxxx],xxxxxx xxx,xxxxx PTR [xxx-xxxx]xxx DWORD xxx [xxx-xxxx],xxxxxxx xxxxxx al,al
jne xxxxxx <main+0xab>
mov xxx,xxxxxx xxx,xxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Payment



Payment