flat assembler
Message board for the users of flat assembler.
Index
> High Level Languages > MSVC inline assembly |
Author |
|
bcdsys 26 Oct 2008, 04:04
here is asm code tested
Code: __asm { mov esi, section_header mov edi, section_name_ptr mov ecx, 2 cld rep movsd } c code version: Code: section_name[0] = ((DWORD*) §ion_header)[0]; section_name[4] = ((DWORD*) §ion_header)[1]; asm version not compile, c code compile but incorrect result, verified cause this line can anyone help? |
|||
26 Oct 2008, 04:04 |
|
Kain 26 Oct 2008, 06:12
Have you checked your indexing? Maybe it should be section_name[1]
For the asm part, it looks like you're moving the address of the pointer variable (section_name_ptr) into edi rather than the address of section_name which should be the contents of the section_name_ptr. You probably need to dereference the dword at edi. |
|||
26 Oct 2008, 06:12 |
|
bcdsys 26 Oct 2008, 12:35
problem fixed
used: Code: ((DWORD*) section_name)[0] = ((DWORD*) §ion_header)[0]; ((DWORD*) section_name)[1] = ((DWORD*) §ion_header)[1]; |
|||
26 Oct 2008, 12:35 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.