The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: lelejau on December 22, 2010, 07:13:23 PM

Title: error in MOV
Post by: lelejau on December 22, 2010, 07:13:23 PM
I'm trying to do this MOV:

MOV EDX,DWORD PTR SS:[ESP+B8]

But, I'm getting this error:

undefined symbol B8

:( Why is that?

Do not treat this forum like a paid help desk with the [SOLVED] in the topic line.
Title: Re: error in MOV
Post by: qWord on December 22, 2010, 07:18:17 PM
hi,

numeric constants must begin with an numeric digit (0-9). Hexadecimal numbers also requite the 'h' suffix:
QuoteMOV EDX,DWORD PTR SS:[ESP+0B8h]

qWord
Title: Re: error in MOV
Post by: lelejau on December 22, 2010, 07:26:33 PM
thanks,  :clap:
Title: Re: [SOLVED] error in MOV
Post by: dedndave on December 22, 2010, 08:18:57 PM
        MOV     EDX,[ESP+0B8h]

dword ptr is not needed, as EDX is a dword sized register
size need not be specified when the destination and/or target is a register, except with MOVZX or MOVSX

SS: segment override is also not needed, as addressing with ESP references the SS selector by default
Title: Re: [SOLVED] error in MOV
Post by: clive on December 22, 2010, 10:56:19 PM
Quote from: dedndave
SS: segment override is also not needed, as addressing with ESP references the SS selector by default

This is also the case for EBP, if used as the base register.

mov edx,[ebx + ebp*1 + 0xB8h] ; would use the DS selector
mov edx,[ebp + ebx*1 + 0xB8h] ; would use the SS selector
Title: Re: error in MOV
Post by: lelejau on December 23, 2010, 04:50:10 PM
Quote from: lelejau on December 22, 2010, 07:13:23 PM
Do not treat this forum like a paid help desk with the [SOLVED] in the topic line.
Sorry hutch.  :U