solaris_i386.s
来自「关系型数据库 Postgresql 6.5.2」· S 代码 · 共 34 行
S
34 行
/=============================================================================/ tas.s -- test and set lock for solaris_i386/============================================================================= .file "tas.s" .text .align 16.L1.text: .globl tastas: pushl %ebp /save prev base pointer movl %esp,%ebp /new base pointer pushl %ebx /save prev bx movl 8(%ebp),%ebx /load bx with address of lock movl $255,%eax /put something in ax xchgb %al,(%ebx) /swap lock value with "0" cmpb $0,%al /did we get the lock? jne .Locked subl %eax,%eax /yes, we got it -- return 0 jmp .Finish .align 4.Locked: movl $1,%eax /no, we didn't get it - return 1.Finish: popl %ebx /restore prev bx movl %ebp,%esp /restore stack state popl %ebp ret /return .align 4 .type tas,@function .size tas,.-tas
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?