Hi, folks.
I'm not newbie to assembly. I've been working in assembly for years.
This is a question about the syntax of MASM. Recently I work with MSVC, so it is the assembler in hand.
I need to assembler this instruction
mov eax, [0x89abcdef]
I don't want the hard coded 0x89abcdef act as an immediate value but a pointer.
I don't know how to do it in MASM. MASM seems to lack of convenient syntax to hard code pointer value(I don't know how to assemble far jmp and far call as well), at least I don't know yet.
I know I can employee db(or _emit in C++) to hard code the whole instruction, but that make the code less readable.
Thank you.
include \masm32\include\masm32rt.inc
.data
MyVal dd 12345678h
.code
start:
mov eax, ds:[0402000h]
exit
end start
Now it's your turn to explain why you want to hardcode an address...
Thank you.
Frankly I'm going to patch something. To help analyze a protocol.
Wait... the problem hasn't been solved yet.
mov eax, ds:[0x12345678] is assembled to a "far" move with the segment register in mind.
Is there any method to assemble without segment register?
Warning: No "patching" and reversing / analyzing of "protocols" is allowed in here :green