views:

234

answers:

1

I've tried the following forms and masm doesnt like any of them:

mov byte [myVariable], al
mov byte ptr [myVariable], al
mov [byte myVariable], al

what am i missing? why cant i seem to use indirect addressing.

the error i get from masm is 'Missing operator in expression" on some of the lines, some of them say "Structure field expected"

+2  A: 
mov [myVariable], al

should be sufficient, or even just:

mov myVariable, al

But then again mov byte ptr [myVariable], al should also work, which makes me wonder "what is 'myVariable'"?

danbystrom
it is an address that is declared at the top such asmyVariable equ 0404h.then some of the calls are using registers with offsets such as bp+10
Without Me It Just Aweso
the indirect addressing isnt working for and either:and [bp+22h], 77h results in "Invalid instruction operands"
Without Me It Just Aweso
Changed it to mov ds:[myvariable], aland got: "Invalid instruction operands"
Without Me It Just Aweso
That's really odd. Maybe you should create a really really tiny full example and show us?
danbystrom
Without Me It Just Aweso
.186? That's new to me... have you tried without it? Now I'm just guessing wildly...
danbystrom
yea, here is the different processor instructions:http://support.microsoft.com/default.aspx/kb/47504i need the .186 for some of the commands i'm using later. however i have tried without it and it doesnt affect the outcome
Without Me It Just Aweso
Well, then I have no iead. It looks fine to me...
danbystrom
I think you got "invalid instruction operands" in your small test program because you can't move immediate to memory. (mov ds:[myValue2],1) You have to go through a register.
I. J. Kennedy