Thread: does ARM have names backwards for inequalities?

  1. #1
    Registered User
    Join Date
    Apr 2010
    Location
    Vancouver
    Posts
    132

    does ARM have names backwards for inequalities?

    < is less than and > is greater than
    In arm if you want to check r1 > r2
    the code is
    Code:
    cmp r1, r2
    blt label1
    Shouldn't the name actually be glt? Or am I confused?

  2. #2
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    You're assuming that because r1 is on the left in the assembly instruction that it corresponds with the left hand side of the express "r1 > r2". That assumption is completely baseless.
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  3. #3
    Registered User
    Join Date
    Nov 2010
    Location
    Long Beach, CA
    Posts
    5,909
    We would need to see the the high-level code and the rest of the assembly code to determine if it's correct. It really depends on whether the branch is taking you to the "if" part, or some "else" part, or the loop condition this belongs to.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Inequalities and others
    By backtobasics in forum C Programming
    Replies: 1
    Last Post: 11-22-2011, 05:59 AM
  2. Mathmatics Question?? Absolute Value and Inequalities
    By xddxogm3 in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 09-27-2004, 04:35 PM
  3. Mathmatics Question?? Powers and inequalities.
    By xddxogm3 in forum A Brief History of Cprogramming.com
    Replies: 10
    Last Post: 09-26-2004, 10:12 PM
  4. Backwards
    By cyberCLoWn in forum C++ Programming
    Replies: 1
    Last Post: 04-07-2004, 08:11 AM
  5. Backwards Up-Down
    By Cactus_Hugger in forum Windows Programming
    Replies: 1
    Last Post: 11-08-2003, 05:56 PM