News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Writing to memory

Started by MattVonFat, March 27, 2006, 02:47:36 PM

Previous topic - Next topic

MattVonFat

Hi,

How would I write a byte to a space in memory? I tired

MOV 0xMemoryAddress, Value

(obviously not with the words MemoryAddress and Value actually written in there :P)

But that gave me an error. Am I using the right command?

P1

MattVonFat,

Welcome a Board !!!     :U

Forum 'Search' is your friend, along with Google.   :dance:

Please read the forum rules.

Are you using your own assembler compiler or someone elses?

Posting more code with more background will help.

Regards,  P1  :8)

Tedd

Examples:

mov DWORD PTR [403080h],1234h    ;dword at offset 403080h = 1234h (hex)
mov WORD PTR [672652h],12345     ;word at offset 672652h = 12345 (decimal)
mov BYTE PTR [10101],0ffh        ;byte at offset 10101 (decimal) = ffh (hex)


"0x...." is stolen from C notation, but some assemblers (not MASM) use it for compatability. Normal asm notation is "....h" possibly with starting with a 0 in the case the number starts with a letter.


(When asking about errors, it's useful to tell what the error message was :wink)
No snowflake in an avalanche feels responsible.