+ 2

Assembly Jumpsā€™ Limits

Assembly uses jumps for conditionals and such, but why the jump is limited? Why ā€œjeā€ and ā€œjneā€ can jump less than ā€œjmpā€?

23rd Jun 2020, 12:18 PM
RinasSam
RinasSam - avatar
1 Answer
+ 1
Jump statements are limited to the maximum length of the instruction addressing format. For Example : In my Hypothetical Instruction Set, I have a maximum of of 128 bits for a literal after jump. So, the max I can jump is (2^128)-1 memory spaces. je and jne can jump the exact same distance if I want because I made my machine that way. So, there is no hard rule why je and jne jump less than jmp, it's just a convention carried on by keeping backwards compatibility for something we don't really use now.
23rd Jun 2020, 3:26 PM
Anubhav Mattoo
Anubhav Mattoo - avatar