Re:A fundamental introduction to x86 assembly programming
by someoneElse123 on Saturday May 14, 2016 @11:08PM
(#11699209)
This is a nice fundamental introduction, but where would I go to see how to actually run code?
[ Parent
| on HN ]
Re:A fundamental introduction to x86 assembly programming
by lallysingh on Saturday May 14, 2016 @11:52PM
(#11699333)
My best introduction to any asm language is just my C compiler putting out asm (gcc -S, I think). I can create small programs to do what I want, and see what the compiler puts out.
Re:A fundamental introduction to x86 assembly programming
by Liblor on Sunday May 15, 2016 @04:05AM
(#11699997)
https://gcc.godbolt.org is also helpful, it colorizes the assembly output corresponding to the C/C++ source. Furthermore, you can simply change between Intel and AT&T synatx.
Re:A fundamental introduction to x86 assembly programming
by pwaring on Sunday May 15, 2016 @03:49PM
(#11702423)
The -S flag also works in clang, although the output may differ. For example, last time I checked a comparison check of i < 10 in a for loop would become:
cmpl $9, -4(%rbp)
jle .L3
under GCC ('if i <= 9, loop') and: cmpl $10, -8(%rbp)
jge .LBB0_4
under clang ('if i >= 10, end the loop'). Neither GCC or clang does an exact conversion, and they both produce different assembly instructions (optimisations disabled in both cases).If you build a cross-compiler, you can also output assembly for architectures other than your local machine, though this can be quite fiddly (see crosstool-ng for a project which has done most of the work for you).
Re:A fundamental introduction to x86 assembly programming
by mafribe on Sunday May 15, 2016 @02:18AM
(#11699735)
I wonder if there is a nice and easy to use x86 simulator like the MARS simulator for MIPS [1]? Some place where I can run (step through) little x86 assembly programs study their effect of the each register.
Re:A fundamental introduction to x86 assembly programming
by wakatana on Sunday May 15, 2016 @07:43AM
(#11700548)
GDB?
Re:A fundamental introduction to x86 assembly programming
by mafribe on Sunday May 15, 2016 @02:39PM
(#11702123)
By GDB, you mean the GNU debugger? I have not used it for over a decade. Is it a convenient interface for toying and experimenting with x86 assembler?
Re:A fundamental introduction to x86 assembly programming
by pkrumins on Sunday May 15, 2016 @04:26AM
(#11700032)
See my comment: https://news.ycombinator.com/item?id=11700030