when i use things like
db A1h,00h
it saz when compliling error A1h not defined,
any one know why it wont recognize it???
EDIT:
also i am gettting problems with this
mov DWORD PTR [007D384Ch], edx
: error A2001: immediate operand not allowed
the code is right!! but why wont it take it???
db A1h,00h
it saz when compliling error A1h not defined,
any one know why it wont recognize it???
EDIT:
also i am gettting problems with this
mov DWORD PTR [007D384Ch], edx
: error A2001: immediate operand not allowed
the code is right!! but why wont it take it???
You have to always start hex number with a 0.
Add a prefix 0 if the hex value starts with a letter.
0Ah = 10
16h = 22
0Dh = 13
0DEADh = 57005
0BEEFh = 48879
As for mov DWORD PTR [007D384Ch] ...
Sounds like putting a value directly from a known memory location ... as far as I know MASM doesn't allow this.
:)
0Ah = 10
16h = 22
0Dh = 13
0DEADh = 57005
0BEEFh = 48879
As for mov DWORD PTR [007D384Ch] ...
Sounds like putting a value directly from a known memory location ... as far as I know MASM doesn't allow this.
:)
if you want hex numbers without prefix 0, use "radix 16" - be careful though :).
For immediate memory addreses, stupid and non-standard masm wasnt's
a DS override (even though it wont be in your opcode). Ie, use
"Mov dword ptr , 401000h"
For immediate memory addreses, stupid and non-standard masm wasnt's
a DS override (even though it wont be in your opcode). Ie, use
"Mov dword ptr , 401000h"
hmmmm,
How interesting, below every assembler are opcodes, I wonder what opcode you had in mind with this statement ?
Qages original question was why he got an error with the following code.
You can certainly do it this way.
I wonder what opcodes you had in mind ?
Regards,
hutch@movsd.com
How interesting, below every assembler are opcodes, I wonder what opcode you had in mind with this statement ?
Qages original question was why he got an error with the following code.
mov DWORD PTR [007D384Ch], edx
You can certainly do it this way.
mov ecx, 12345678h
mov eax, 00401000h
mov [eax],ecx
I wonder what opcodes you had in mind ?
Regards,
hutch@movsd.com
hmmm... i certainly remember having to move stuff to known locations when working with .com files with DEBUG (never practiced safe HEX, though)
If you use FASM (IMHO the best+ assembler out there) you can also use $ as HEX prefix, and other than being more immediately readable/identifyable as HEX, you will also not have to put a leading '0' if the first digit is a letter.
Take a look at FASM, you won't regret it, for many other reasons.
http://fasm.metro-nt.pl
Take a look at FASM, you won't regret it, for many other reasons.
http://fasm.metro-nt.pl
"mov DWORD PTR [007D384Ch], edx" gives "error A2001: immediate operand not allowed".
Why use the long form and lots of register stuff when you can do it directly?
If you add the DS: prefix (which doesn't actually end up in the output binary),
it works. Ie, "mov DWORD PTR [DS:007D384Ch], edx" generates the opcode
89154C387D00. Stupid that masm requires the prefix.
Why use the long form and lots of register stuff when you can do it directly?
If you add the DS: prefix (which doesn't actually end up in the output binary),
it works. Ie, "mov DWORD PTR [DS:007D384Ch], edx" generates the opcode
89154C387D00. Stupid that masm requires the prefix.
OK,
Opcode 89h.
Your form was,
Remove the TASM/NASM imitations from it and note that the register size of EDX sets the memory operand size and you end up with the efficient MASM form of the notation,
You can also specify the code section if you need to with,
Its very gracious of you f0dder to demonstrate the sheer elegance and power of the worlds leading assembler, MASM, the one that sets the standard. :)
Regards,
hutch@movsd.com
Opcode 89h.
Your form was,
mov DWORD PTR [DS:007D384Ch], edx
Remove the TASM/NASM imitations from it and note that the register size of EDX sets the memory operand size and you end up with the efficient MASM form of the notation,
mov DS:007D384Ch, edx
You can also specify the code section if you need to with,
mov CS:007D384Ch, edx
Its very gracious of you f0dder to demonstrate the sheer elegance and power of the worlds leading assembler, MASM, the one that sets the standard. :)
Regards,
hutch@movsd.com
Thing is, the DS: prefix shouldn't be necessary as it's implicit...
but oh well.
but oh well.