I am unable to understand the usefulness of LOOPNE. Even if LOOPNE was not there and only LOOP was there, it would have done the same thing here. Please help me out.
MOV CX, 80
MOV AH,1
INT 21H
CMP AL, ' '
LOOPNE BACK
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
CMPis more or less aSUBinstruction without changing the value, which means that it sets flags such as ZF (the zero flag).LOOPNEhas 2 conditions to loop:cx > 0andZF = 0LOOPhas 1 condition to loop:cx > 0So, a normal
LOOPwould go through all characters, whereasLOOPNEwill go through all characters, or until a space is encountered. Whichever comes first