Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Other Programming > BOOK: Professional Assembly Language
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional Assembly Language
This is the forum to discuss the Wrox book Professional Assembly Language by Richard Blum; ISBN: 9780764579011
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Assembly Language section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old May 2nd, 2007, 11:06 PM
Registered User
 
Join Date: May 2007
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default understand a piece of code in assembler

Hi, i am new in assembler code, i started to understand a program, but i am stock in the switch statement of this code:

08048b7b <phase_3>:
 8048b7b: 55 push %ebp
 8048b7c: 89 e5 mov %esp,%ebp
 8048b7e: 83 ec 24 sub $0x24,%esp
 8048b81: 8d 45 f8 lea 0xfffffff8(%ebp),%eax
 8048b84: 50 push %eax
 8048b85: 8d 45 f7 lea 0xfffffff7(%ebp),%eax
 8048b88: 50 push %eax
 8048b89: 8d 45 fc lea 0xfffffffc(%ebp),%eax
 8048b8c: 50 push %eax
 8048b8d: 68 26 97 04 08 push $0x8049726
 8048b92: ff 75 08 pushl 0x8(%ebp)
 8048b95: e8 de fc ff ff call 8048878 <sscanf@plt>
 8048b9a: 83 c4 20 add $0x20,%esp
 8048b9d: 83 f8 02 cmp $0x2,%eax
 8048ba0: 7f 05 jg 8048ba7 <phase_3+0x2c>
 8048ba2: e8 99 08 00 00 call 8049440 <explode_bomb>
 8048ba7: 83 7d fc 07 cmpl $0x7,0xfffffffc(%ebp)
 8048bab: 0f 87 bd 00 00 00 ja 8048c6e <phase_3+0xf3>
 8048bb1: 8b 45 fc mov 0xfffffffc(%ebp),%eax
 8048bb4: ff 24 85 30 97 04 08 jmp *0x8049730(,%eax,4)
 8048bbb: 81 7d f8 37 01 00 00 cmpl $0x137,0xfffffff8(%ebp)
 8048bc2: 0f 84 af 00 00 00 je 8048c77 <phase_3+0xfc>
 8048bc8: e8 73 08 00 00 call 8049440 <explode_bomb>
 8048bcd: b0 69 mov $0x69,%al
 8048bcf: e9 a5 00 00 00 jmp 8048c79 <phase_3+0xfe>
 8048bd4: 81 7d f8 7d 01 00 00 cmpl $0x17d,0xfffffff8(%ebp)
 8048bdb: 0f 84 96 00 00 00 je 8048c77 <phase_3+0xfc>
 8048be1: e8 5a 08 00 00 call 8049440 <explode_bomb>
 8048be6: b0 69 mov $0x69,%al
 8048be8: e9 8c 00 00 00 jmp 8048c79 <phase_3+0xfe>
 8048bed: 81 7d f8 20 03 00 00 cmpl $0x320,0xfffffff8(%ebp)
 8048bf4: 75 04 jne 8048bfa <phase_3+0x7f>
 8048bf6: b0 77 mov $0x77,%al
 8048bf8: eb 7f jmp 8048c79 <phase_3+0xfe>
 8048bfa: e8 41 08 00 00 call 8049440 <explode_bomb>
 8048bff: b0 77 mov $0x77,%al
 8048c01: eb 76 jmp 8048c79 <phase_3+0xfe>
 8048c03: 81 7d f8 9f 02 00 00 cmpl $0x29f,0xfffffff8(%ebp)
 8048c0a: 75 04 jne 8048c10 <phase_3+0x95>
 8048c0c: b0 75 mov $0x75,%al
 8048c0e: eb 69 jmp 8048c79 <phase_3+0xfe>
 8048c10: e8 2b 08 00 00 call 8049440 <explode_bomb>
 8048c15: b0 75 mov $0x75,%al
 8048c17: eb 60 jmp 8048c79 <phase_3+0xfe>
 8048c19: 83 7d f8 35 cmpl $0x35,0xfffffff8(%ebp)
 8048c1d: 75 04 jne 8048c23 <phase_3+0xa8>
 8048c1f: b0 61 mov $0x61,%al
 8048c21: eb 56 jmp 8048c79 <phase_3+0xfe>
 8048c23: e8 18 08 00 00 call 8049440 <explode_bomb>
 8048c28: b0 61 mov $0x61,%al
 8048c2a: eb 4d jmp 8048c79 <phase_3+0xfe>
 8048c2c: 81 7d f8 ac 03 00 00 cmpl $0x3ac,0xfffffff8(%ebp)
 8048c33: 75 04 jne 8048c39 <phase_3+0xbe>
 8048c35: b0 7a mov $0x7a,%al
 8048c37: eb 40 jmp 8048c79 <phase_3+0xfe>
 8048c39: e8 02 08 00 00 call 8049440 <explode_bomb>
 8048c3e: b0 7a mov $0x7a,%al
 8048c40: eb 37 jmp 8048c79 <phase_3+0xfe>
 8048c42: 81 7d f8 bd 03 00 00 cmpl $0x3bd,0xfffffff8(%ebp)
 8048c49: 75 04 jne 8048c4f <phase_3+0xd4>
 8048c4b: b0 70 mov $0x70,%al
 8048c4d: eb 2a jmp 8048c79 <phase_3+0xfe>
 8048c4f: e8 ec 07 00 00 call 8049440 <explode_bomb>
 8048c54: b0 70 mov $0x70,%al
 8048c56: eb 21 jmp 8048c79 <phase_3+0xfe>
 8048c58: 81 7d f8 80 03 00 00 cmpl $0x380,0xfffffff8(%ebp)
 8048c5f: 75 04 jne 8048c65 <phase_3+0xea>
 8048c61: b0 6d mov $0x6d,%al
 8048c63: eb 14 jmp 8048c79 <phase_3+0xfe>
 8048c65: e8 d6 07 00 00 call 8049440 <explode_bomb>
 8048c6a: b0 6d mov $0x6d,%al
 8048c6c: eb 0b jmp 8048c79 <phase_3+0xfe>
 8048c6e: e8 cd 07 00 00 call 8049440 <explode_bomb>
 8048c73: b0 72 mov $0x72,%al
 8048c75: eb 02 jmp 8048c79 <phase_3+0xfe>
 8048c77: b0 69 mov $0x69,%al
 8048c79: 3a 45 f7 cmp 0xfffffff7(%ebp),%al
 8048c7c: 74 05 je 8048c83 <phase_3+0x108>
 8048c7e: e8 bd 07 00 00 call 8049440 <explode_bomb>
 8048c83: c9 leave
 8048c84: c3 ret

any help will be appreciate, i am driving crazy with this piece of code.

Reply With Quote
  #2 (permalink)  
Old January 10th, 2010, 06:45 AM
Authorized User
 
Join Date: Jan 2010
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by rbulus View Post
Hi, i am new in assembler code, i started to understand a program, but i am stock in the switch statement of this code:

08048b7b <phase_3>:
 8048b7b: 55 push %ebp
 8048b7c: 89 e5 mov %esp,%ebp
 8048b7e: 83 ec 24 sub $0x24,%esp
 8048b81: 8d 45 f8 lea 0xfffffff8(%ebp),%eax
 8048b84: 50 push %eax
 8048b85: 8d 45 f7 lea 0xfffffff7(%ebp),%eax
 8048b88: 50 push %eax
 8048b89: 8d 45 fc lea 0xfffffffc(%ebp),%eax
 8048b8c: 50 push %eax
 8048b8d: 68 26 97 04 08 push $0x8049726
 8048b92: ff 75 08 pushl 0x8(%ebp)
 8048b95: e8 de fc ff ff call 8048878 <sscanf@plt>
 8048b9a: 83 c4 20 add $0x20,%esp
 8048b9d: 83 f8 02 cmp $0x2,%eax
 8048ba0: 7f 05 jg 8048ba7 <phase_3+0x2c>
 8048ba2: e8 99 08 00 00 call 8049440 <explode_bomb>
 8048ba7: 83 7d fc 07 cmpl $0x7,0xfffffffc(%ebp)
 8048bab: 0f 87 bd 00 00 00 ja 8048c6e <phase_3+0xf3>
 8048bb1: 8b 45 fc mov 0xfffffffc(%ebp),%eax
 8048bb4: ff 24 85 30 97 04 08 jmp *0x8049730(,%eax,4)
 8048bbb: 81 7d f8 37 01 00 00 cmpl $0x137,0xfffffff8(%ebp)
 8048bc2: 0f 84 af 00 00 00 je 8048c77 <phase_3+0xfc>
 8048bc8: e8 73 08 00 00 call 8049440 <explode_bomb>
 8048bcd: b0 69 mov $0x69,%al
 8048bcf: e9 a5 00 00 00 jmp 8048c79 <phase_3+0xfe>
 8048bd4: 81 7d f8 7d 01 00 00 cmpl $0x17d,0xfffffff8(%ebp)
 8048bdb: 0f 84 96 00 00 00 je 8048c77 <phase_3+0xfc>
 8048be1: e8 5a 08 00 00 call 8049440 <explode_bomb>
 8048be6: b0 69 mov $0x69,%al
 8048be8: e9 8c 00 00 00 jmp 8048c79 <phase_3+0xfe>
 8048bed: 81 7d f8 20 03 00 00 cmpl $0x320,0xfffffff8(%ebp)
 8048bf4: 75 04 jne 8048bfa <phase_3+0x7f>
 8048bf6: b0 77 mov $0x77,%al
 8048bf8: eb 7f jmp 8048c79 <phase_3+0xfe>
 8048bfa: e8 41 08 00 00 call 8049440 <explode_bomb>
 8048bff: b0 77 mov $0x77,%al
 8048c01: eb 76 jmp 8048c79 <phase_3+0xfe>
 8048c03: 81 7d f8 9f 02 00 00 cmpl $0x29f,0xfffffff8(%ebp)
 8048c0a: 75 04 jne 8048c10 <phase_3+0x95>
 8048c0c: b0 75 mov $0x75,%al
 8048c0e: eb 69 jmp 8048c79 <phase_3+0xfe>
 8048c10: e8 2b 08 00 00 call 8049440 <explode_bomb>
 8048c15: b0 75 mov $0x75,%al
 8048c17: eb 60 jmp 8048c79 <phase_3+0xfe>
 8048c19: 83 7d f8 35 cmpl $0x35,0xfffffff8(%ebp)
 8048c1d: 75 04 jne 8048c23 <phase_3+0xa8>
 8048c1f: b0 61 mov $0x61,%al
 8048c21: eb 56 jmp 8048c79 <phase_3+0xfe>
 8048c23: e8 18 08 00 00 call 8049440 <explode_bomb>
 8048c28: b0 61 mov $0x61,%al
 8048c2a: eb 4d jmp 8048c79 <phase_3+0xfe>
 8048c2c: 81 7d f8 ac 03 00 00 cmpl $0x3ac,0xfffffff8(%ebp)
 8048c33: 75 04 jne 8048c39 <phase_3+0xbe>
 8048c35: b0 7a mov $0x7a,%al
 8048c37: eb 40 jmp 8048c79 <phase_3+0xfe>
 8048c39: e8 02 08 00 00 call 8049440 <explode_bomb>
 8048c3e: b0 7a mov $0x7a,%al
 8048c40: eb 37 jmp 8048c79 <phase_3+0xfe>
 8048c42: 81 7d f8 bd 03 00 00 cmpl $0x3bd,0xfffffff8(%ebp)
 8048c49: 75 04 jne 8048c4f <phase_3+0xd4>
 8048c4b: b0 70 mov $0x70,%al
 8048c4d: eb 2a jmp 8048c79 <phase_3+0xfe>
 8048c4f: e8 ec 07 00 00 call 8049440 <explode_bomb>
 8048c54: b0 70 mov $0x70,%al
 8048c56: eb 21 jmp 8048c79 <phase_3+0xfe>
 8048c58: 81 7d f8 80 03 00 00 cmpl $0x380,0xfffffff8(%ebp)
 8048c5f: 75 04 jne 8048c65 <phase_3+0xea>
 8048c61: b0 6d mov $0x6d,%al
 8048c63: eb 14 jmp 8048c79 <phase_3+0xfe>
 8048c65: e8 d6 07 00 00 call 8049440 <explode_bomb>
 8048c6a: b0 6d mov $0x6d,%al
 8048c6c: eb 0b jmp 8048c79 <phase_3+0xfe>
 8048c6e: e8 cd 07 00 00 call 8049440 <explode_bomb>
 8048c73: b0 72 mov $0x72,%al
 8048c75: eb 02 jmp 8048c79 <phase_3+0xfe>
 8048c77: b0 69 mov $0x69,%al
 8048c79: 3a 45 f7 cmp 0xfffffff7(%ebp),%al
 8048c7c: 74 05 je 8048c83 <phase_3+0x108>
 8048c7e: e8 bd 07 00 00 call 8049440 <explode_bomb>
 8048c83: c9 leave
 8048c84: c3 ret

any help will be appreciate, i am driving crazy with this piece of code.
You are calling scanf to determine input on whether to explode the bomb. I would be careful - it might go boom.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Question about a piece of code chobo2 C# 2008 aka C# 3.0 8 November 30th, 2008 10:53 AM
How to delete a piece of code Charlie05 C# 2005 2 August 3rd, 2008 11:32 AM
Assembler code need in C Language rbulus Assembly Language 0 May 2nd, 2007 11:12 PM
This piece of code is giving an error sourik C# 2 July 15th, 2006 09:18 AM
What does this piece of code do? mito_lal Oracle 1 July 11th, 2006 06:44 AM



All times are GMT -4. The time now is 05:09 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.