Was going through threads-intro/loop.s.
This is what it looks like:
.main
.top
sub $1,%dx
test $0,%dx
jgte .top
halt
If I run: ./x86.py -p loop.s -t 1 -i 100 -R dx -c, I get the following output:
dx Thread 0
0
-1 1000 sub $1,%dx
-1 1001 test $0,%dx
-1 1002 jgte .top
-1 1003 halt
My doubt is the following:
If dx is initialised to 0.
By 1001 test $0, %dx, it becomes -1, and here the constant 0 is greater than -1.
So in 1002 jgte .top should send the process in a loop, shouldn't it?
Or am I missing something?
Was going through
threads-intro/loop.s
. This is what it looks like:If I run:
./x86.py -p loop.s -t 1 -i 100 -R dx -c
, I get the following output:My doubt is the following: If
dx
is initialised to0
. By1001 test $0, %dx
, it becomes-1
, and here the constant0
is greater than-1
. So in1002 jgte .top
should send the process in a loop, shouldn't it? Or am I missing something?