Assembler (Intel) inconsistencies in 2.0.x, Was: Re: [fpc-devel] Bug: compilation loop in 2.0.2 when using -So

2006-08-18 Thread Konstantin Münning
Jonas Maebe wrote: On 17 aug 2006, at 21:40, Konstantin Münning wrote: There are some other inconsistencies to previous versions of FPC and Borland Pascal like assembler syntax and pointer addition (inc(Pointer,LongInt) does not work anymore). Please (as always) post a test program,

Re: Assembler (Intel) inconsistencies in 2.0.x, Was: Re: [fpc-devel] Bug: compilation loop in 2.0.2 when using -So

2006-08-18 Thread Jonas Maebe
On 18 aug 2006, at 13:36, Konstantin Münning wrote: PROGRAM Original; {$ASMMODE Intel} PROCEDURE Test(p:Pointer;l:LongInt;w:Word;b:Byte);ASSEMBLER; ASM mov eax,[p] mov eax,[l] mov ax,[w] mov al,[b] END; BEGIN END. This program is like the code I'm using which works with fpc

Re: Assembler (Intel) inconsistencies in 2.0.x, Was: Re: [fpc-devel] Bug: compilation loop in 2.0.2 when using -So

2006-08-18 Thread Konstantin Münning
Jonas Maebe wrote: On 18 aug 2006, at 13:36, Konstantin Münning wrote: PROGRAM Original; {$ASMMODE Intel} PROCEDURE Test(p:Pointer;l:LongInt;w:Word;b:Byte);ASSEMBLER; ASM mov eax,[p] mov eax,[l] mov ax,[w] mov al,[b] END; BEGIN END. This program is like the code

Re: Assembler (Intel) inconsistencies in 2.0.x, Was: Re: [fpc-devel] Bug: compilation loop in 2.0.2 when using -So

2006-08-18 Thread Jonas Maebe
On 18 aug 2006, at 14:10, Konstantin Münning wrote: That's because the default calling convention is now register instead of oldfpccall. p is now passed in eax, l in edx and w in cx. So the the compiling is complaining because the above now means mov ax, [cx]. Does this mean above code is

Re: Assembler (Intel) inconsistencies in 2.0.x, Was: Re: [fpc-devel] Bug: compilation loop in 2.0.2 when using -So

2006-08-18 Thread Marco van de Voort
I presume that what we do is Delphi compatible. To, it seems more like the TP/Delphi (and probably masm/tasm) behaviour of treating [p] and p as the same thing was wrong. [] means a memory reference and [p] should actually mean something like [[ebp+8]] or so if p is stored at address

Re: Assembler (Intel) inconsistencies in 2.0.x, Was: Re: [fpc-devel] Bug: compilation loop in 2.0.2 when using -So

2006-08-18 Thread Jonas Maebe
On 18 aug 2006, at 14:32, Marco van de Voort wrote: presume that what we do is Delphi compatible. To, it seems more like the TP/Delphi (and probably masm/tasm) behaviour of treating [p] and p as the same thing was wrong. [] means a memory reference and [p] should actually mean something like

Re: Assembler (Intel) inconsistencies in 2.0.x, Was: Re: [fpc-devel] Bug: compilation loop in 2.0.2 when using -So

2006-08-18 Thread Jonas Maebe
On 18 aug 2006, at 14:56, Konstantin Münning wrote: So a programmer should not need exactly to know if/when a variable is cached in a register or saved on the stack (=memory) and when referencing it the same way the same result should be expected. A programmer actually must always be aware

Re: Assembler (Intel) inconsistencies in 2.0.x, Was: Re: [fpc-devel]Bug: compilation loop in 2.0.2 when using -So

2006-08-18 Thread Tomas Hajny
Konstantin Münning wrote: Jonas Maebe wrote: On 18 aug 2006, at 14:56, Konstantin Münning wrote: . . PROCEDURE Test(l:LongInt);ASSEMBLER; ASM mov eax,[l] END; PROCEDURE Test;ASSEMBLER; VAR l:LongInt; ASM mov eax,[l] END; BTW, putting the lines above into a file, adding the

Re: Assembler (Intel) inconsistencies in 2.0.x, Was: Re: [fpc-devel]Bug: compilation loop in 2.0.2 when using -So

2006-08-18 Thread Daniël Mantione
Op Fri, 18 Aug 2006, schreef Tomas Hajny: and trying to compile (with -Mtp parameter to ensure asmmode intel) results in: --- Free Pascal Compiler version 2.0.4-rc3 [2006/08/13] for i386 Copyright (c) 1993-2006 by Florian Klaempfl x.pas(7,12) Error: overloaded functions have the same