[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: assembly programming in Emacs how to
From: |
Pascal J. Bourguignon |
Subject: |
Re: assembly programming in Emacs how to |
Date: |
Mon, 14 Mar 2011 19:42:15 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) |
김태윤 <kty1104@gmail.com> writes:
> assembly programming in Emacs how to?
> I want Emacs to do following things
0. edit an assembler file.
Just open a file with the .s extension, or add a comment on the first
line with: -*- mode:asm -*-
> 1. assembling
M-x compile RET C-a C-k gcc -o pgm pgm.s RET
> 2. run the just before made program inside Emacs
That would depend on the kind of user interface your program uses, and
whether you want to run it with debugging or not.
Without debugging:
- a daemon can be launched with:
M-! pgm RET
- a program with dumb terminal I/O (just read and write lines):
M-x shell RET
pgm RET
- a program with sophisticated terminal I/O (ncurses):
M-x term RET
pgm RET
M-x terminal-emulator RET
pgm RET
M-! xterm -e pgm & RET
- a program with GUI:
M-! pgm & RET
See also
http://groups.google.com/group/gnu.emacs.help/msg/458f28dae283b4da?hl=en
> 3. debugging with watching flags and registers as like ollydbg or
> softice
With debugging:
- a daemon, or a program with dumb terminal I/O (just read and write
lines), or a program with GUI can be launched with:
M-x shell RET
gdb pgm RET
run RET
- a program with sophisticated terminal I/O (ncurses):
M-x term RET
gdb pgm RET
run RET
M-x terminal-emulator RET
gdb pgm RET
run RET
M-! xterm -e gdb pgm & RET
run RET
There's also gud:
M-x gud-gdb RET pgm RET
which offers better integration between the debugger and emacs, but I'm
not sure about the program I/O requirements.
> 4. decompile executable file for see what assembly codes are made by c
> but I don't know how to do this.
You may use commands such as objdump, or otool or disasm.
--
__Pascal Bourguignon__ http://www.informatimago.com/
A bad day in () is better than a good day in {}.