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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:08:42+00:00 2026-06-18T01:08:42+00:00

ATT syntax. I’m trying to understand a practice problem we talked about in class.

  • 0

ATT syntax.

I’m trying to understand a practice problem we talked about in class.

We were given the following partial assembly code for a switch statement:

movl  8(%ebp), %eax
addl  $2, %eax
cmpl  $6, %eax
ja    .L2
jmp   *.L8(,%eax,4)

//rest of switch statement would go here

.L8
 .long   .L3
 .long   .L2
 .long   .L4
 .long   .L5
 .long   .L6
 .long   .L6
 .long   .L7

I know that the second portion is the jump table. What I can’t figure out is how to calculate the original C-level switch case values. How can I do this?

  • 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-18T01:08:43+00:00Added an answer on June 18, 2026 at 1:08 am

    Analyze the code.

    The function’s parameter + 2 is used as an index into the table. So, the constants start at -2 and go on to -1, 0, etc.

    The maximum constant is 4, see there’s a check for parameter + 2 > 6, or, equivalently, for parameter > 4. The number of elements in the table reflects that too.

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

Sidebar

Related Questions

ATT syntax. I'm trying to understand what the following piece of assembly code does:
ATT syntax. I've noticed that library routines in C often use the following snippet
I need to write the following query so the att field is always a
I have a class decorated with XML attributes such as [XmlAttribute(att)]. My goal is
I am working on the following query: SELECT att.AttendenceCD, convert(varchar, att.AttDate, 101) AttDate, att.EmployeeCD
I'm trying to execute a Django query: #att.name is a string kwargs = {att.name
Consider class Foo { public $att; public function __construct ( $a ) { $this->att
You have a set of images: <ul class=thumb> <li><a href=#> <img src=images/att.jpg title=Store AT&T
http://krill.larvit.se/resihop_dev/ ,right column ordered list. HTML: <ol class=instructions> <li> <p>För att hitta samåkningar, klicka
i am trying to use the reminder api but with no luck. The code

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.