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

  • Home
  • SEARCH
  • 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 829307
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T03:51:42+00:00 2026-05-15T03:51:42+00:00

I would like to dynamically create a set of labels in an assembly function

  • 0

I would like to dynamically create a set of labels in an assembly function using a gas macro. I would like to do something like this:

 .macro set_up_jumptab_entry prefix, from=0, to=10
     .quad \prefix_\item
     .if \to-\from
     set_up_jumptab_entry \prefix,"(\from+1)",\to
     .endif
 .endm
 set_up_jumptab_entry myfunc 0 10

Here \prefix_\item would be something like myfunction_7. Now, I can find lots of examples of recursive invocation, but I haven’t found one of just label concatenation involving passed-in macro arguments. Gas is quite poorly documented, so answering this question is difficult for me.

  1. Can you concatenate arguments to macros with other tokens to make single tokens?
  2. What’s your favorite gas assembler reference?
  • 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-15T03:51:43+00:00Added an answer on May 15, 2026 at 3:51 am

    things like

    \argA\()\argB :
    

    should create a label composed by argA and argB.

    EDIT

    Testing, \() seems to be not necessary; the test code was:

        .file   "test.c"
    
    .macro prova argA, argB
    \argA\argB :
     .endm
        .text
    .globl main
        .type   main, @function
    main:
        leal    4(%esp), %ecx
        andl    $-16, %esp
        pushl   -4(%ecx)
        pushl   %ebp
        movl    %esp, %ebp
        pushl   %ecx
        movl    $0, %eax
        popl    %ecx
        popl    %ebp
        leal    -4(%ecx), %esp
            prova abc, def
            jmp  abcdef
        ret
        .size   main, .-main
        .ident  "GCC: (GNU) 4.3.2"
        .section    .note.GNU-stack,"",@progbits
    

    which is just gcc -S test.c output (lazyness:D) of a minimal C code. (prova means test in italian)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 515k
  • Answers 515k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer use set_error_handler and set_exception_handler to intercept errors and exceptions so… May 16, 2026 at 6:36 pm
  • Editorial Team
    Editorial Team added an answer I think you are connecting two different settings. Netsh can… May 16, 2026 at 6:36 pm
  • Editorial Team
    Editorial Team added an answer Try overriding the original styles, with either more specificity or… May 16, 2026 at 6:36 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

The code below creates a column of three labels. I would like to take
I using jquery's $.post to pull information from a database dynamically. This works fine
I am looking for the best way to dynamically arrange the location of labels
I am using a JPanel (with several labels inside) to add a dynamic information
Very common scenario using Ajax is to parse the response and create the user
I try to add dynamically an iframe to a web page using JavaScript. I
I'm developing a GTK app, and would like to print some messages over existing
Im using LinqDataSource like that: <asp:LinqDataSource ID=LinqDataSource3 runat=server OnSelecting=LinqDataSource3_OnSelecting> </asp:LinqDataSource> And I have ASPxGridView
Let's say I have a string that I retrieve from a DB like: Lorem
This is a simplified version of the original problem. I have a class called

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.