Question about assembly in set bit function for x86 architecture
Anuz Pratap Singh Tomar
chambilkethakur at gmail.com
Sun Apr 19 19:11:29 EDT 2015
On Mon, Apr 20, 2015 at 12:08 AM, Nicholas Krause <xerofoify at gmail.com>
wrote:
>
>
> On April 19, 2015 5:13:20 PM EDT, Anuz Pratap Singh Tomar <
> chambilkethakur at gmail.com> wrote:
> >On Sun, Apr 19, 2015 at 9:51 PM, nick <xerofoify at gmail.com> wrote:
> >
> >> Greetings All,
> >> I am wondering what the below code in the asm modifier does:
> >> static inline void set_bit(int nr, void *addr)
> >> {
> >> asm("btsl %1,%0" : "+m" (*(u32 *)addr) : "Ir" (nr));
> >> }
> >> This would be very helpful as I am new to x86 assembly and don't
> >> even known what register(s)/instruction(s) this touches and therefore
> >this
> >> is impossible for me to look up in the Intel Manuals. If someone
> >either
> >> tells me the registers/instructions this uses or explains the code
> >that
> >> would be very helpful.
> >> Nick
> >>
> >> _______________________________________________
> >> Kernelnewbies mailing list
> >> Kernelnewbies at kernelnewbies.org
> >> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
> >>
> >
> >get a book on i86 assembly and learn it.
> The reason I am asking is that is assembly worth my time to learn for this
> part of the kernel, I understand it's use in boot code but outside of that
> and cache memory lines in architecture directories there is very little, 95
> percent of the kernel is written in C. In addition due to this the only
> practical reason I can thing of is for
> debugging, how useful is assembly for kernel debugging is my other
> question about this topic.
> Nick
> --
> Sent from my Android device with K-9 Mail. Please excuse my brevity.
>
Just read the books, don't be lazy.
--
Thank you
Warm Regards
Anuz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20150420/3e38a2cb/attachment-0001.html
More information about the Kernelnewbies
mailing list