CMP & TEST(for Pentium PC)

yang.wanlin@mail.zte.com.cn yang.wanlin@mail.zte.com.cn
Thu May 17 20:30:00 GMT 2001


What deffrient with CMP and TEST?

p1:
    movl         8(%ebp),%eax
    movw         6(%eax),%dx
    andl         %edx,0x0000ffff /* (%edx) = 0 */
    test         %edx,%edx /* (%eflag = 0x206 */
    jne          .L8 /* ok, not go to .L8 */
     .
     .
     .

p2:
    movl         8(%ebp),%eax
    movw         6(%eax),%dx
    andl         %edx,0x0000ffff /* (%edx) = 0 */
    cmp          %edx,0          /* (%eflag = 0x246 */
    jne          .L8             /* bad, go to .L8 */
     .
     .
     .



(Embedded image moved to file: pic22593.gif)
Compuserve GIF



More information about the Gcc-bugs mailing list