I have already written in pure x86 ASM . I wonder what keeps esi.
mov dword ptr [esi],eax
mov eax,dword ptr [esi]
These two instructions tell me nothing what do.
Wait... You've written this yourself in pure x86 ASM and you don't know what is held in esi?
I can't tell you either. You need to look further back to see where esi is filled with something. These are registers. Registers are only temporary for "doing things". They need to be filled before you can use them.
If you DIDN'T write this ASM yourself but it's part of a compiled pascal program then this code could be part of two statements. One in which the result is stored in a memory location (dword ptr [esi]) and the other where that result again is needed for following statements.
DS:ESI EDI SI : Source index register
Used for string and memory array copying
But without seeing more you can't say anything about these statements.
B.T.W.
If you want to snoop around in the assembler-window of the debugger in Lazarus, and you're more familiar with the Intel-syntax, you might want to change the settings. It's
explained here.
Default setting: AT&T syntax
unit1.pas:36 s:= 'a';
00425780 bba8915500 mov $0x5591a8,%ebx
00425785 8d45f4 lea -0xc(%ebp),%eax
00425788 e803e4fdff call 0x403b90 <fpc_ansistr_decr_ref>
0042578D 895df4 mov %ebx,-0xc(%ebp)
00425790 e80b62feff call 0x40b9a0 <fpc_popaddrstack>
x86/x64 Intel syntax:
unit1.pas:36 s:= 'a';
00425780 bba8915500 mov ebx,0x5591a8
00425785 8d45f4 lea eax,[ebp-0xc]
00425788 e803e4fdff call 0x403b90 <fpc_ansistr_decr_ref>
0042578D 895df4 mov DWORD PTR [ebp-0xc],ebx
00425790 e80b62feff call 0x40b9a0 <fpc_popaddrstack>
(I prefer the Intel syntax)