[fpc-devel] Re: systemh.inc InterLockedIncrement64 (var Target: int64)

Thomas Schatzl tom_at_work at gmx.at
Thu Oct 28 16:32:42 CEST 2010


Some small addition:

On Thu, 28 Oct 2010 16:25:59 +0200, Thomas Schatzl <tom_at_work at gmx.at>
wrote:
> Hi,
> 
> On Thu, 28 Oct 2010 08:28:16 -0500, Andrew Brunner
> <andrew.t.brunner at gmail.com> wrote:
>> I tried to use the assembly code from the x64 unit on a i386 build of
>> FPC but FPC throws error on compile.  Why are the specific x64
>> instructions being blocked?  The cpu running the code has the ability
> 
> In general, the 32 and 64 bit instructions partially use the same opcode
> for different actual instructions depending on the processor mode. The
code
> segment selector contains information about the type of instruction set
> used.
> It might be worth a try to hack a REX prefix in 32 bit assembly and see
> what happens, but I'd assume that either you get an invalid opcode
> exception or the prefix is just ignored.

Actually, the REX prefix uses the 32 bit inc/dec opcode space (0x40-0x4f)
- so you *will* get an invalid opcode in the best case, and if you are
lucky, some unwanted program behavior.

Hth,
  Thomas




More information about the fpc-devel mailing list