I am trying to follow the instructions in this thread to turn of CPU caches for research purposes. I have tried to convert the code from the page into AT&T format, but am having trouble getting assembler code to compile. Here is the code:
.section .text
.global main
main:
mov %cr0, %eax
or $1<<30, %eax
and $~(1<<29), %eax
mov %eax, %cr0
wbinvd
xor %eax, %eax
xor %edx, %edx
mov $0x2ff, %ecx
wrmsr
wbinvd
ret
I get the following errors quite persistently:
$ gcc -o asm asm.s
asm.s: Assembler messages:
asm.s:4: Error: unsupported instruction `mov'
asm.s:7: Error: unsupported instruction `mov'
I have tried to replace mov with movl to no effect. You might guess assembly is not my domain. Help... please.