1 /* Test segment register getting. */
7 unsigned short csw
= -1;
9 unsigned long csq
= -1;
10 unsigned short csw_mem
= -1;
12 __asm__
__volatile__ (
13 "movw %%cs, %0\n" /* mov segReg, r16 */
14 "movl %%cs, %1\n" /* mov segReg, r32 */
15 "movq %%cs, %2\n" /* mov segReg, r64 */
16 "movw %%cs, %3\n" /* mov segReg, mem16 */
17 : "=r" (csw
), "=r" (csl
), "=r" (csq
), "=m" (csw_mem
));
19 printf("cs(w)=%u\n", csw
);
20 printf("cs(l)=%u\n", csl
);
21 printf("cs(q)=%lu\n", csq
);
22 printf("cs(w_mem)=%u\n", csw_mem
);