What does JS do in Assembly x86?

cmp %al, %cl
js x

I am confused by what js does (jump on a sign). Does this say that if al is positive and cl is negative, then vice versa?

Also, what happens if% cl is 0, or is there nothing in it?

Thanks!

+4
source share
1 answer

JSwill jump if the sign flag is set (by an earlier instruction). CMP will always change flags by subtracting, in this case %al - %cl. (assuming Intel syntax, not AT & T).

Due to the length of the instructions, the character will be bit 7 of the% al-% cl expression (and which is discarded).

% cl == 0, % al , % al. , , % al .

.

+8

Source: https://habr.com/ru/post/1527650/


All Articles