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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:33:15+00:00 2026-06-17T23:33:15+00:00

Using AT&T assembly syntax, I’m trying to understand how testl is used in assembly

  • 0

Using AT&T assembly syntax, I’m trying to understand how testl is used in assembly code. Specifically:

testl  %edx, %edx
jle    .L3

I know testl does a bitwise and of the same value to set the condition flags, but how can I interpret ‘jump if less than or equal to’ if it isn’t comparing two values?

  • 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-17T23:33:16+00:00Added an answer on June 17, 2026 at 11:33 pm

    Here’s an excerpt from the official documentation from Intel on test:

    Operation
    TEMP ← SRC1 AND SRC2;
    SF ← MSB(TEMP);
    IF TEMP = 0
        THEN ZF ← 1;
        ELSE ZF ← 0;
    FI:
    PF ← BitwiseXNOR(TEMP[0:7]);
    CF ← 0;
    OF ← 0;
    

    And the same on jle:

    Jump if less or equal (ZF=1 or SF≠OF)
    

    So, the jump will be performed if edx is 0 (because edx AND edx = edx and that’s 0 only when edx is 0, and because ZF is set to 1 when the result of AND is 0) or if the most significant bit of edx is 1 (because SF = most significant bit of edx AND edx (or, equivalently, of edx itself) and OF is always 0, which means SF ≠ OF is only true when SF ≠ 0).

    IOW, the jump will be performed only if edx is ≤ 0 when interpreted as a signed integer or, equivalently, when edx is either 0 or greater or equal than 0x80000000 when interpreted as an unsigned integer.

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

Sidebar

Related Questions

How can I prepend a SS: or ES: using AT&T Assembly Syntax without adding
I want to assign an array using inline assembly using the AT&T syntax. I
I'm struggling with a problem with some AT&T assembly syntax. Im using the as
i'm beginning assembly, i'm using nasm for assembling the code, i'm trying to process
edit: this is using AT&T syntax I am learning assembly using the GAS assembler
I am practicing to write a bootstrap using assembly (in AT&T syntax, and gnu/gas).
How to create an IDT using LIDT I work on Intel-Atom 32bits (Assembly AT&T).
I wish to change this following assembly code into UNIX compatible code without using
I have tested a bit of assembler on Linux using the AT&T syntax. One
How might i translate the Java Code below in PseudoCode for assembly language using

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.