[fpc-devel] OO rewrite - technical questions

Michael Schnell mschnell at lumino.de
Mon Jul 26 10:28:22 CEST 2010

  On 07/24/2010 03:16 PM, Florian Klämpfl wrote:
> Delphi does not use a segment register for threadvar handling but OS calls.
sorry but this is not true

Turbo Delphi:


var test integer;
threadvar threadtest: integer;

   test := 1;
   threadtest := 2;

compiles to

  mov [$...], $1

  call @GetTls
  mov [eax+$34], $2


@GetTLS resulting in (this is not exactly the original code, which in 
fact reads a zero form some location to EAX and uses it)

  mov edx, fs:[4]
  mov eax, [edx]


More information about the fpc-devel mailing list