It's me again, I have a new problem in my idt.S file (Intel syntax compiled with gcc). When I try to compile the following code:
load_idt:
mov edx, (esp + 4) ; On this line
lidt (edx)
sti
ret
I get an error that I really don't know how to fix:
Error: too many memory references for `mov'
If you are assembling with GCC using something like:
gcc -c -m32 -masm=intel idt.S -o idt.o
The problems are:
.intel_syntax noprefix
to the top of your file. By default GCC assembles .s
and .S
files assuming Intel syntax requires the %
prefix on all the registers. That directive eliminates that requirement.[
and ]
rather than parentheses (
and )
.#
instead of ;
. The code should look like:
.intel_syntax noprefix
load_idt:
mov edx, [esp + 4] # On this line
lidt [edx]
sti
ret
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With