os_kernel_lab/related_info/ostep/ostep11-threadintro/looping-race-nolock.s

16 lines
246 B
ArmAsm
Raw Normal View History

2015-03-15 16:54:19 +08:00
# assumes %bx has loop count in it
.main
.top
# critical section
mov 2000, %ax # get the value at the address
add $1, %ax # increment it
mov %ax, 2000 # store it back
# see if we're still looping
sub $1, %bx
test $0, %bx
jgt .top
halt