Introduction: bsfl assembly instruction: intel assembly instruction: bsf oprd1, oprd2; bit scan forward from right to left (from bit 0--> bit 15 or bit 31 The scan word or double word operand oprd2 contains the first bit of "1", and sends the bit number of the first bit containing '1' to the operand oprd1 AT&T format assembly instruction bsfl Bsf, except that the source and destination operands are in reverse order. For example, there is a similar statement analysis on the Internet: .__asm__("bsfl %1,%0/n/t" "jne 1f/n/t" "movl $32, %0/n" "1:" : "=r"(set) :"r"(~ (*p >> bit))); The initial condition before entering the assembly instruction: p: the one at which the start bit pointed to by offset is located Unsigned long type 4B double word at the beginning. Bit: The starting bit pointed to by offset is the first of the unsigned long 4B double words in which it is located. *p >> bit : The pointer to the beginning of the unsigned long type 4B double word at which the start bit pointed to by the offset is located is shifted to the right by the bit, that is, the bit before the start bit pointed to by the offset All are moved out, and the start bit pointed to by offset is shifted to the rightmost end (lowest bit, 0 bit), and the start bit becomes the first bit of the unsigned long type 4B. ~ (*p >> bit) : Invert the bits, originally looking for the first '0' bit from the offset bit. This inversion turns the problem into finding the offset bit. The bit after the first '1' is followed. Bsfl %1,%0 <====> bsfl (~ (*p >> bit)), set finds the first '1' in (~ (*p >> bit)) The bit is stored in the set and returned. Movl $32, %0 : When the next 32 bits from the offset bit are all '0', ie: all '1' before the inversion, then set = 32
About Linux shutdown and restart commands. In fact, the first article should write about Linux inst
In Apple Mac OS and Microsoft Windows have supported multi-touch today, the Linux open source commun
directory summary: /: root directory, generally only the directory under the root directory, do not
According to foreign media reports, many users, like the author, have been intere
Three ways to run PHP under Linux
The final solution for the Eva qq crash of QQ software under Linux
Analysis of the meaning of the Linux kernel Overview
Linux Server Network Development Model
Linux generates random password/modify password
Analyze the normal shutdown command under Linux system
Shared storage area communication instance and analysis
Linux device model analysis drive article
Discussion on GUEST OS Clock (TIMEKEEP) in Virtual Machine
IE9: How to fix the page display size when opening all new windows
Microsoft revenue pull action and Win7/Vista can't compare
WinXP appears to delay write failure error
Cleverly solve the tracking problem of IP address under WinXP
Win8.1 press Win+PrtSC screenshots are not saved to the default location solution
Win8 CP picks up Win7 Beta: the number of public betas in the same period doubled
Windows7 64-bit system NIC driver installation problem solution