static inline void
insw(int port, void *addr, int cnt)
{
asm volatile("cld\n\trepne\n\tinsw"
: "=D" (addr), "=c" (cnt)
: "d" (port), "0" (addr), "1" (cnt)
: "memory", "cc");
}
Hey guys, I am feeling kinda confused about this code snippet while I was reading the code. I was wandering cnt looks like a loop counter, why it is not stored into ECX straightly but use "1" as input constrain. Seems like we can save one more register. I am new to this area, leave me few more steps if I made any newbie mistake. Cheers.