We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,560 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

If then statement

Can someone please help translate this statement to assembly language

if X <= Y then
if Y = V then
call Path1
end if
else
if X > Z then
call Path2
else
call Path3
endif
endif

2
Contributors
1
Reply
7 Hours
Discussion Span
9 Months Ago
Last Updated
2
Views
risen375
Newbie Poster
4 posts since May 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

Without knowing what X, Y, V & Z are, I'm going to assume 32 bit integers
Source is NASM

V   dd  1
Z   dd  1

    ; EAX = "X"
    ; ECX = "Y"

    cmp eax, ecx
    ja  .L1

    cmp ecx, [V]
    jnz .Done

    call    Path1
    jmp .Done

.L1 cmp eax, [Z]
    ja  .L2
    call    Path3
    jmp .Done

.L2 call    Path2   

.Done   ret

Path1:  nop
Path2:  nop
Path3:  ret
ShiftLeft
Light Poster
31 posts since Jun 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.0710 seconds using 2.67MB