flat assembler
Message board for the users of flat assembler.
Index
> Main > Pascal translation (pointer to struct) |
Author |
|
revolution 14 Feb 2010, 12:49
Try this:
Code: MapData DD ? ;this is a pointer ... mov [eax+MyStruct.B],123 |
|||
14 Feb 2010, 12:49 |
|
TimK 14 Feb 2010, 13:28
Thank you! It works.
This assumes that next code (filling dword variable by pointer), Code: var A: PLongWord; begin A^ := 123; end; translates as: Code: A dd ? mov eax,[A] mov [eax+4],123 Right? |
|||
14 Feb 2010, 13:28 |
|
vid 14 Feb 2010, 13:55
No, like this:
Code: A dd ? mov eax,[A] mov [eax],123 |
|||
14 Feb 2010, 13:55 |
|
TimK 14 Feb 2010, 14:42
Thanks vid, but my code still does not work
Code: MapFile dd 0 MapData dd 0 invoke MapViewOfFile, [MapFile],FILE_MAP_ALL_ACCESS,0,0,0 mov [MapData],eax test eax,eax jz error mov eax,[MapData] mov eax,123 like it changes the address, but not the value... |
|||
14 Feb 2010, 14:42 |
|
Plue 14 Feb 2010, 15:16
You didn't do as he told you.
Code: mov [eax],123 |
|||
14 Feb 2010, 15:16 |
|
TimK 14 Feb 2010, 15:53
Oh, sorry, im idiot, missed brackets... All works as expected. Many thanks!
|
|||
14 Feb 2010, 15:53 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.