xinc386.s 417 B

1234567891011121314151617181920212223242526272829
  1. /*#define XADDL(s,d) BYTE $0x0F; BYTE $0xC1; BYTE $((0<<6)|(s<<3)|(d))*/
  2. /*TEXT xadd(SB),$0 /* long xadd(long *, long); */
  3. /* MOVL l+0(FP),BX
  4. /* MOVL i+4(FP),AX
  5. /* LOCK
  6. /* XADDL(0,3)
  7. /* RET
  8. */
  9. TEXT _xinc(SB),$0 /* void _xinc(long *); */
  10. MOVL l+0(FP),AX
  11. LOCK
  12. INCL 0(AX)
  13. RET
  14. TEXT _xdec(SB),$0 /* long _xdec(long *); */
  15. MOVL l+0(FP),AX
  16. LOCK
  17. DECL 0(AX)
  18. JZ iszero
  19. MOVL $1, AX
  20. RET
  21. iszero:
  22. MOVL $0, AX
  23. RET