mov operand type mismatch problem
Posted: Thu Jan 31, 2019 6:56 pm
I'm trying to enable paging. For some reason, I keep getting this error:
here is my assembly code:
Can anyone help me with this?
Code: Select all
make[1]: Entering directory '/mnt/c/Users/tim21/Projects/firststep/arch/i686'
i686-elf-as paging_init.s -o paging_init.o
paging_init.s: Assembler messages:
paging_init.s:17: Error: operand type mismatch for `mov'
Makefile:14: recipe for target 'paging_init.o' failed
make[1]: *** [paging_init.o] Error 1
make[1]: Leaving directory '/mnt/c/Users/tim21/Projects/firststep/arch/i686'
Makefile:28: recipe for target 'arch.o' failed
make: *** [arch.o] Error 2
Code: Select all
.section .text
.global loadPageDirectory
loadPageDirectory:
push %ebp
mov %esp, %ebp
mov 8(%esp), %eax
mov %eax, %cr3
mov %ebp, %esp
pop %ebp
ret
.global enablePaging
enablePaging:
push %ebp
mov %esp, %ebp
mov %cr0, $eax
or $0x80000000, %eax
mov %eax, %cr0
mov %ebp, %esp
pop %ebp
ret