:add lab7 spoc exercise related codes
This commit is contained in:
15
related_info/lab7/race-condition/looping-race-nolock.s
Normal file
15
related_info/lab7/race-condition/looping-race-nolock.s
Normal file
@@ -0,0 +1,15 @@
|
||||
# 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
|
||||
Reference in New Issue
Block a user