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 1050443
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T16:46:17+00:00 2026-05-16T16:46:17+00:00

This does not look too friendly: __asm(command 1 command 2 command 3); Do I

  • 0

This does not look too friendly:

__asm("command 1"
      "command 2"
      "command 3");

Do I really have to put a doublequote around every line?

Also… since multiline string literals do not work in GCC, I could not cheat with that either.

  • 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-05-16T16:46:18+00:00Added an answer on May 16, 2026 at 4:46 pm

    I always find some examples on Internet that the guy manually insert a tab and new-line instead of \t and \n, however it doesn’t work for me. Not very sure if your example even compile.. but this is how I do:

    asm volatile(           // note the backslash line-continuation
       "xor %eax,%eax          \n\t\
        mov $0x7c802446, %ebx  \n\t\
        mov $1000, %ax         \n\t\
        push %eax              \n\t\
        call *%ebx             \n\t\
        add $4, %esp           \n\t\
        "
        : "=a"(retval)        // output in EAX: function return value
        :
        : "ecx", "edx", "ebx"   // tell compiler about clobbers
      // Also x87 and XMM regs should be listed.
     );
    

    Or put double quotes around each line, instead of using \ line-continuation. C string literals separately only by whitespace (including a newline) are concatenated into one long string literal. (Which is why you need the \n inside it, so it’s separate lines when it’s seen by the assembler).

    This is less ugly and makes it possible to put C comments on each line.

    asm volatile(
        "xor %eax,%eax          \n\t"
        "mov $0x7c802446, %ebx  \n\t"
        "mov $1000, %ax         \n\t"
        "push %eax              \n\t"  // function arg
        "call *%ebx             \n\t"
        "add $4, %esp           \n\t"  // rebalance the stack: necessary for asm statements
      : "=a"(retval)
      :
      : "ecx", "edx", "ebx"    // clobbers.  Function calls themselves kill EAX,ECX,EDX
      // function calls also clobber all x87 and all XMM registers, omitted here
    );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First look at this url: https://stackoverflow.com/questions/tagged/xoxoxo/ This directory does not exists but somehow stackoverflow
This does not really apply to any language specifically, but if it matters I
I have a question very similar to this one but the answer does not
This does NOT work: Sub X() Dim A As Access.Application Set A = CreateObject(Access.Application)
Ops: This does not belong to ServerFault because it focuses on Programing Architecture. I
Is it true that this does not necessarily mean the stream has been disposed
can anyone tell me why this does not work Excel.Worksheet ws_res = (Excel.Worksheet) wb.Worksheets.Add(mis,
I just found my code like this does not compile right? Is there any
How can I ensure that this does NOT open in a new window?? onclick=ob=this.form.table;window.open(ob.options[ob.selectedIndex].value)/>
This works: require 'csv' file = CSV.open(filename) puts file.shift This does not: require 'csv'

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.