Reputation: 1847
assembly programming in Emacs how to? I want Emacs to do following things 1. assembling 2. run the just before made program inside Emacs 3. debugging with watching flags and registers as like ollydbg or softice 4. decompile executable file for see what assembly codes are made by c but I don't know how to do this could somebody let me know ?
Upvotes: 2
Views: 3166
Reputation: 4965
Since you mention SoftICE, I'm assuming you're on windows.
(Good old times, by the way. If anybody ever used SoftICE on windows 9x, he/she will know what I mean :)
I don't use Emacs, but here's how to get started:
Get the tools you need to assemble your program (ie: at least, the assembler and the linker). On windows, the MASM package comes with everything you need : http://www.masm32.com/
Figure out wich commands you need to compile a simple hello world.
Configure Emacs so that it runs the above commands for you
Upvotes: 0
Reputation: 6681
Which operating system (and machine architecture) are you using? I think that's quite essential information for questions about assembly programming.
I'll try to answer your four points anyway:
Just run your assembler (e.g. as
) from M-x compile
.
Run it from a shell buffer or from shell-command
(bound to M-!
).
Emacs' built-in graphical debugging support is started with M-x gdb
. You may have to look for some external debugger support package if GDB is not suitable for your purposes.
For disassembling object code, I'd use GDB. But I think if you have the C sources, it would be better to compile them with the -S
flag to see the assembly code emitted by the compiler instead of what can be reconstructed from the machine code.
Upvotes: 5