-3

I'm trying learning assembly language and i need to know how to read the assembly varsion of a c program from the windows 10 command prompt. I've tried using C:\users\prete\Desktop\booksrc$ gcc -g firstprog.c but it doesn't work

please help me thank you!

4
  • Do you mean something like adding the option -S to the command line and using a text editor to look at firstprog.s? Commented Sep 23, 2018 at 21:40
  • 1
    "Doesn't work" is not a good problem description. What happens? What's the exact error you get? Do you even have gcc installed? Can you run it? Do you just have problem with getting the assembly listing? Commented Sep 23, 2018 at 21:57
  • @PeterCordes : Jester may be onto something I didn't catch at first. The OPis getting an error which could suggest this is a GCC installation issue or GCC not being on the path. Commented Sep 23, 2018 at 22:42
  • @MichaelPetch: I wondered that, too, but no point in anyone wasting their time answering the current question until / unless the OP edits the question to clarify, e.g. with an actual error message to make a minimal reproducible example. As asked, it's either a non-MCVE or a duplicate, so for now at least it should be closed. Commented Sep 23, 2018 at 22:56

1 Answer 1

2

I am not sure about windows, but as far as I know, the assembly output is gained by the -S option for gcc.

Try gcc -S firstprog.c

The output will be firstprog.s in AT&T syntax. If you want it in the intel syntax (might be rather helpful if you use NASM/MASM/YASM and such for assembling), try:

gcc -S -masm=intel firstprog.c
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.