error: operand 1: expression is not simple or relocatable
I don't see how I'm doing it wrong because the code looks fine to me.
Wed Mar 23, 2011 4:36 pm
losethos
Joined: Fri Aug 20, 2010 10:04 pm Posts: 41
Re: dd eax not working
"dd" is "define double". Puts a constant in a spot. It is not an instruction.
You want to use the "mov" instruction.
Code:
mov [01000h],eax
Something like that. You better start with a book on asm, honestly.
Thu Mar 24, 2011 1:38 am
jflanagan987
Joined: Thu Dec 23, 2010 1:12 pm Posts: 9
Re: dd eax not working
So
Code:
example: resd 1 mov [example], eax
should work? I'll try it.
Thu Mar 24, 2011 10:13 am
brenden
Site Admin
Joined: Fri Jul 24, 2009 10:02 pm Posts: 247 Location: Las Vegas, NV, US
Re: dd eax not working
Yep, losethos is right, you need to use the `mov` command and they way you are using it now should move the value in `eax` and move it intomemory at the address labeled `example`. But what is the `resd` opcode? I've never seen that and can't find any reference to it in the intel x86 opcode list.
Tue Aug 23, 2011 1:14 am
jflanagan987
Joined: Thu Dec 23, 2010 1:12 pm Posts: 9
Re: dd eax not working
Resd reserves a double word(the 1 means only reserve one) but I have now found out that it can only be used in the bss section. I understand now that DD actually puts the value in that place in the executable which ends up in ram.
Users browsing this forum: No registered users and 1 guest
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum