From: Ronnie Collinson <notthinking@gmail.com>
To: "Pascal J. Bourguignon" <pjb@informatimago.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: assembly programming in Emacs how to
Date: Fri, 18 Mar 2011 21:50:22 +1300 [thread overview]
Message-ID: <AANLkTi=0b5wW_5yiCM3Qti8BXZuSY0+nz5A0mA6kGkz7@mail.gmail.com> (raw)
In-Reply-To: <87tyf5o86w.fsf@kuiper.lan.informatimago.com>
Instead of decompiling to see the generated C code, you can tell GCC
to stop before assembling. gcc -S yourcfile.c, or use an option like
--save-temps to see all phases of compilation, and get the executable
On 3/15/11, Pascal J. Bourguignon <pjb@informatimago.com> wrote:
> 김태윤 <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 {}.
>
next prev parent reply other threads:[~2011-03-18 8:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.6.1300112038.27831.help-gnu-emacs@gnu.org>
2011-03-14 16:09 ` assembly programming in Emacs how to rusi
2011-03-14 18:42 ` Pascal J. Bourguignon
2011-03-18 8:50 ` Ronnie Collinson [this message]
[not found] ` <mailman.2.1300438231.3305.help-gnu-emacs@gnu.org>
2011-03-18 9:46 ` Pascal J. Bourguignon
2011-03-14 6:54 김태윤
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='AANLkTi=0b5wW_5yiCM3Qti8BXZuSY0+nz5A0mA6kGkz7@mail.gmail.com' \
--to=notthinking@gmail.com \
--cc=help-gnu-emacs@gnu.org \
--cc=pjb@informatimago.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).