Assembly x86 check if 3 values can form a triangle
I have to do this problem where I have the sides and I have to check if they can form a triangle. Now I have this code but I don't know why I get both of the messages.I am new to the assembly language. .model small .stack 128 .data a dw 1 b dw 20 c dw 3 msg1 db 'The sides can form a triangle$' msg2 db 'The sides cannot form a triangle$' .code mov AX, @data mov DS, AX MOV AX,a add AX,b mov bX,b add bX,c mov cX,a add cX,c CMP AX,c JAE L1 mov dx, offset msg2 mov ah,9 int 21h L1: CMP bX,a JAE L2 mov dx, offset msg2 mov ah,9 int 21h L2: CMP cX,b JAE L3 mov dx, offset msg2 mov ah,9 int 21h L3: mov d
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.