943,936 Members | Top Members by Rank

Ad:
  • Assembly Discussion Thread
  • Unsolved
  • Views: 1562
  • Assembly RSS
You are currently viewing page 1 of this multi-page discussion thread
Oct 31st, 2009
0

add [bx+si],al means what?

Expand Post »
Hi fellas,
I have a question about disassembled code. I have a very simple assembly code that prints "Hello world" to screen. When I disassembled it by using nasm(ndisasm), I got a text file. After that I opened it and started to analyze it. However, in a section that comes after " int 0x80" there are a lot of "add [bx+si],al" statement. What does it means? Can you explain me?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
kemaletikan is offline Offline
3 posts
since Oct 2009
Oct 31st, 2009
0
Re: add [bx+si],al means what?
Hi fellas,
I have a question about disassembled code. I have a very simple assembly code that prints "Hello world" to screen. When I disassembled it by using nasm(ndisasm), I got a text file. After that I opened it and started to analyze it. However, in a section that comes after " int 0x80" there are a lot of "add [bx+si],al" statement. What does it means? Can you explain me?
Depends really...it could be a bunch of data that the de-compiler is having trouble with...more likely, its just the header or footer information that comes with every executable...If you want to look your code try objdump instead. Objdump conveniently removes all this extra data...
Reputation Points: 499
Solved Threads: 367
Postaholic
gerard4143 is offline Offline
2,196 posts
since Jan 2008
Oct 31st, 2009
0
Re: add [bx+si],al means what?
Click to Expand / Collapse  Quote originally posted by gerard4143 ...
Depends really...it could be a bunch of data that the de-compiler is having trouble with...more likely, its just the header or footer information that comes with every executable...If you want to look your code try objdump instead. Objdump conveniently removes all this extra data...
thanks for your help. I tried objdump and I got a clear code. add [bx+si],al are lost. Are you sure it is de-compiler problem? Can it be something important about program?
The program writes on screen. Can it be related with writing operation?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
kemaletikan is offline Offline
3 posts
since Oct 2009
Nov 1st, 2009
0
Re: add [bx+si],al means what?
thanks for your help. I tried objdump and I got a clear code. add [bx+si],al are lost. Are you sure it is de-compiler problem? Can it be something important about program?
The program writes on screen. Can it be related with writing operation?
Like I said its probably the header or footer information that's added to the exe. This information. header/footer is used by the linker and operating system...

If you really want to see what's in your file then open it in a hexeditor and check the result against the objdump. You'll easy see where the header, footer and your code begins and ends.
Last edited by gerard4143; Nov 1st, 2009 at 12:15 am.
Reputation Points: 499
Solved Threads: 367
Postaholic
gerard4143 is offline Offline
2,196 posts
since Jan 2008
Nov 1st, 2009
0
Re: add [bx+si],al means what?
Click to Expand / Collapse  Quote originally posted by gerard4143 ...
Like I said its probably the header or footer information that's added to the exe. This information. header/footer is used by the linker and operating system...

If you really want to see what's in your file then open it in a hexeditor and check the result against the objdump. You'll easy see where the header, footer and your code begins and ends.
Thanks pal, you are really for me. I appreciate it.
Best regards.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
kemaletikan is offline Offline
3 posts
since Oct 2009
Nov 1st, 2009
0
Re: add [bx+si],al means what?
Thanks pal, you are really for me. I appreciate it.
Best regards.
If your looking for a good 32/64 bit disassembler that works in Linux then check out Biew at:

http://biew.sourceforge.net/en/biew.html
Reputation Points: 499
Solved Threads: 367
Postaholic
gerard4143 is offline Offline
2,196 posts
since Jan 2008
Nov 1st, 2009
0
Re: add [bx+si],al means what?
To be quite literal it means to add the register al to the address at bx+si.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
cyb3rl0rd1867 is offline Offline
6 posts
since Oct 2009
Feb 21st, 2011
0
Re: add [bx+si],al means what?
As I think, it's the way the exe uses to give control back to the OS, giving info about it's return status. Not quite sure, I would like to know for sure. "This question is not relevant" is NEVER the answer to any question.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
pepsieudonim is offline Offline
1 posts
since Feb 2011
Jan 3rd, 2012
0
Re: add [bx+si],al means what?
My disassembler (ndisasm under cygwin) gives me a bunch of
00004164  0000              add [bx+si],al
00004166  0000              add [bx+si],al
00004168  0000              add [bx+si],al
...
If you look at the opcode "0000" you can easily see that this is something like blank area of a program, to fill a unit of memory (page, segment...)
Reputation Points: 10
Solved Threads: 0
Newbie Poster
programagor is offline Offline
2 posts
since Jan 2012
Jan 3rd, 2012
0
Re: add [bx+si],al means what?
The case you see the "add [bx+si],al" instruction is that the disassembler decodes the "0000" opcode so. Look into an instruction set specifications to see which instruction has which opcode and how the operands are represented (like this one: http://www.cs.ucla.edu/~kohler/class.../i386/ADD.html )
Reputation Points: 10
Solved Threads: 0
Newbie Poster
programagor is offline Offline
2 posts
since Jan 2012
Message:
Previous Thread in Assembly Forum Timeline: New to assembly.NASM problem
Next Thread in Assembly Forum Timeline: Displaying numbers between two numbers.





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC