Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7823325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T08:12:16+00:00 2026-06-02T08:12:16+00:00

When I compile the following code to asm in GCC on cygwin: int scheme_entry()

  • 0

When I compile the following code to asm in GCC on cygwin:

int scheme_entry() {
  return 42;
}

using:

gcc -O3 --omit-frame-pointer -S test1.c

I get the following ‘ASM’ generated:

    .file   "test1.c"
    .text
    .p2align 4,,15
.globl _scheme_entry
    .def    _scheme_entry;  .scl    2;  .type   32; .endef
_scheme_entry:
    movl    $42, %eax
    ret

But the ‘MOVL’ command isn’t actually x86 ASM. From looking at the following lists:

http://ref.x86asm.net/geek.html#x0FA0

http://en.wikipedia.org/wiki/X86_instruction_listings

There is no MOVL command, but there is

CMOVL
CMOVLE
MOVLPS
MOVLPD
MOVLHPS

My question is – is gcc ASM “simplified ASM”? If so – how do I map it to ‘real ASM’?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T08:12:18+00:00Added an answer on June 2, 2026 at 8:12 am

    As mentioned by ughoavgfhw, GCC outputs AT&T syntax by default, which is different to the Intel-style syntax you seem to be expecting. This behaviour, however, is configurable: you can request it to output Intel-style as follows:

    gcc -masm=intel -O3 --omit-frame-pointer -S test1.c
    

    with the key parameter being -masm=intel.

    Using this command line, the assembly output I get (with a few unnecessary lines cut out for brevity) is as follows:

    scheme_entry:
        mov eax, 42
        ret
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The following code throws an compile-time error like Cannot convert type 'string' to 'int'
If I compile the following code snippet with Visual C# 2010 I ALWAYS get
Consider the following condensed code: /* Compile: gcc -pthread -m32 -ansi x.c */ #include
I have inserted the following asm code in my C++ code. I am using
When I try to compile the following code using System; using System.Collections.Generic; using System.Reflection;
When I compile the following code with g++ #include <CoreServices/CoreServices.h> int main(int argc, char
When I compile the following code, I get errors. I don't understand some of
When I compile the following code with GHC (using the -Wall flag): module Main
When I compile the following code, I only see the error during Run-time which
When I compile the following code with g++, the object of class A seems

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.