[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.3

Binary Bomb Phase 5

Asked by Risifo in Assembly Programming Language

Tags: Assembly

Infinity08 your comments are really helping me understand this better.  Could you please let me know if what I wrote is going on here is correct.  I can't seem to figure out exactly what this wants, except know it wants a string that is length 6.  Thanks again

Dump of assembler code for function phase_5:
0x08048c6f <phase_5+0>: push   %ebp
0x08048c70 <phase_5+1>: mov    %esp,%ebp
0x08048c72 <phase_5+3>: push   %esi
0x08048c73 <phase_5+4>: push   %ebx
0x08048c74 <phase_5+5>: mov    0x8(%ebp),%esi  //esi=%(ebp+8)
0x08048c77 <phase_5+8>: sub    $0xc,%esp       //esp=esp-12
0x08048c7a <phase_5+11>:        push   %esi    
0x08048c7b <phase_5+12>:        call   0x8048ed7 <string_length>
0x08048c80 <phase_5+17>:        add    $0x10,%esp //esp=esp+16
0x08048c83 <phase_5+20>:        cmp    $0x6,%eax  //if %eax==6 then
0x08048c86 <phase_5+23>:        je     0x8048c8d <phase_5+30> //jump after explosion
0x08048c88 <phase_5+25>:        call   0x80493be <explode_bomb>
0x08048c8d <phase_5+30>:        mov    $0x0,%ecx //%ecx=0
0x08048c92 <phase_5+35>:        mov    $0x0,%edx //%edx=0
0x08048c97 <phase_5+40>:        mov    $0x804a5a0,%ebx  //%ebx=0x804a5a0
0x08048c9c <phase_5+45>:        movsbl (%esi,%edx,1),%eax // makes
0x08048ca0 <phase_5+49>:        and    $0xf,%eax //eax=eax & 15
0x08048ca3 <phase_5+52>:        add    (%ebx,%eax,4),%ecx //%ecx=%(ecx)+%(ebx+4*eax)
0x08048ca6 <phase_5+55>:        inc    %edx edx=(edx+1)
0x08048ca7 <phase_5+56>:        cmp    $0x5,%edx // if %edx<=5
0x08048caa <phase_5+59>:        jle    0x8048c9c <phase_5+45> // then jump back
0x08048cac <phase_5+61>:        cmp    $0x3a,%ecx      // else if %ecx==58
0x08048caf <phase_5+64>:        je     0x8048cb6 <phase_5+71> // then jump past explosion
0x08048cb1 <phase_5+66>:        call   0x80493be <explode_bomb>
0x08048cb6 <phase_5+71>:        lea    0xfffffff8(%ebp),%esp //esp=ebp-8
0x08048cb9 <phase_5+74>:        pop    %ebx
0x08048cba <phase_5+75>:        pop    %esi
0x08048cbb <phase_5+76>:        leave
0x08048cbc <phase_5+77>:        ret
End of assembler dump.

Dump of assembler code for function string_length:
0x08048ed7 <string_length+0>:   push   %ebp
0x08048ed8 <string_length+1>:   mov    %esp,%ebp      // ebp=esp
0x08048eda <string_length+3>:   mov    0x8(%ebp),%edx      // edx=%(ebp+8)
0x08048edd <string_length+6>:   mov    $0x0,%eax      // %eax=0
0x08048ee2 <string_length+11>:  cmpb   $0x0,(%edx)      // if %edx==0 then
0x08048ee5 <string_length+14>:  je     0x8048eee <string_length+23> // jump to end
0x08048ee7 <string_length+16>:  inc    %edx            // else %edx++ and %eax++
0x08048ee8 <string_length+17>:  inc    %eax
0x08048ee9 <string_length+18>:  cmpb   $0x0,(%edx)      // if %edx!=0
0x08048eec <string_length+21>:  jne    0x8048ee7 <string_length+16>// jump back into loop
0x08048eee <string_length+23>:  leave
0x08048eef <string_length+24>:  ret
End of assembler dump.

I'm not sure if it is taking each character in the string and adding them up and the sum should be 58, don't know so because when I type ASDFGH the ending value is 43 in ecx.  Thanks again
[+][-]03/23/08 07:19 PM, ID: 21191568Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zone: Assembly Programming Language
Tags: Assembly
Sign Up Now!
Solution Provided By: Infinity08
Participating Experts: 1
Solution Grade: A
 
[+][-]03/23/08 07:27 PM, ID: 21191603Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03/23/08 11:01 PM, ID: 21192121Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03/23/08 11:06 PM, ID: 21192127Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091021-EE-VQP-81 / EE_QW_2_20070628