Seph
Seph

Reputation: 109

If Statements counterpart in assembly (NASM)?

I am looking for a command works similar to an if statement in Java, C, etc. for assembly language and I am using the NASM.

If want it to branch the program if the input nummer is smaller than zero, greater than one-hundred or is between zero and one-hundred. And I have not got a clue how to realize this checkback.

Upvotes: 4

Views: 10132

Answers (1)

Seph
Seph

Reputation: 109

Thanks Corbin, I solved it with this

;check if n is between 0 and 100
cmp     eax, [e2]
jg      end_if1
jmp         next

next:
cmp     eax,[e1]
jl      end_if2
jmp         math

Your link helped me a lot :) Have a nice day Sir!

Upvotes: 2

Related Questions