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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:04:04+00:00 2026-05-27T09:04:04+00:00

I’m struggling with a problem with some AT&T assembly syntax. Im using the as

  • 0

I’m struggling with a problem with some AT&T assembly syntax.

Im using the “as” compiler on linux x86.

Im making a password program but it needs to be case insensitive. To clarify, it should evaluate true regardless of the case of any given character.

I have the normal evaluation process working correctly and i have it set up to iterate through a string.

#Comparison Routine

    movl $Password, %ebx     #Move the entire hardcoded password into ebx
    movl $buffer_data, %edx  #Move the entire input password into edx
    movl $Password_len, %ecx #Move the length of the input password into ecx

0:  
    movb (%ebx), %al         #Move one byte of the hardcoded password into al
    xorb (%edx), %al         #Compare one byte of the input password to one byte of the hardedcoded
    jz SkipCase              #If they match, jump to SkipCase

##### 

    andb $32, %al   # 
    xorb (%edx), %al

    jz SkipCase
    jnz IncorrectOutput #   

SkipCase:
    inc %ebx                #Iterate through the
    inc %edx                #strings and decrease
    dec %ecx                #the length variable
    jnz 0b                  #if we're not finished, continue
    jmp CorrectOutput       #If all is good, goto CorrectOutput

This is the section im struggling with, i can’t figure out how to actually convert the character between cases. I’m aware i need to add or subtract 32 from it but something is amiss. Any comments or suggestions would be very helpful. Thanks.

andb $32, %al   # 
xorb (%edx), %al

This is the section for coverting the case, i have tried add, sub, and and or and i just cant get it to work. i realise the jz SkipCase after this is not nessessary.

The comparison routine is largely based off another question on here that i’ll link if nessessary.

Apologies for layout and excessive hashes, bad commenting style i know.

  • 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-27T09:04:04+00:00Added an answer on May 27, 2026 at 9:04 am

    I see that you first try to match the characters ‘strictly’ and when that fails you proceed with a case insensitive match.

    andb $32, %al     # this 'and' operation only leaves the $32 bit if it is 
                      # present in al, all other bits are set to 0
    
    # al is now either 0 (for a lower case character)
    # or $32 (for an upper case character)
    
    xorb (%edx), %al  # so this operation will become zero if the upper case 
                      # bit ($32) is set in the hardcoded password character
    

    What you instead need to do is something like this:

    xorb $32, %al     # invert case of the character by toggling the upper case bit
    cmp (%edx), %al   # try to match again
    je SkipCase
    

    Hope that helps, I find it really difficult to explain bit operations in a short post like this. 🙂


    Also, I presume this is either homework or some sort of excercise because a real password routine would have to be more clever – e.g. only perform the case insensitive check for letters, never digits or other characters.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm making a simple page using Google Maps API 3. My first. One marker
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I am reading a book about Javascript and jQuery and using one of the
Seemingly simple, but I cannot find anything relevant on the web. What is the

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.