Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2012-08

Language mode, assembler style

5 messages · 4 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Rainer Stratmann

Why is -Mfpc the default language style?

I assume -Mobjfpc or -M2 is the most used style.

Why does -Mobjfpc overwrite the assember style?

Reply by email

Jonas Maebe
to Rainer Stratmann
Rainer Stratmann wrote
Why is -Mfpc the default language style?

For backward compatibility.

Why does -Mobjfpc overwrite the assember style?

Language modes set all language-related switches to the default for that mode, so that it is possible to e.g. add {$mode objfpc} at the top of a unit and be sure that it will compile for anyone regardless of how their fpc.cfg looks like or what switches they specified on the command line.

Jonas

Reply by email

Sven Barth
to Rainer Stratmann: Why is -Mfpc the default language style? I assume -Mobjfpc or -M2 is the most used style.…
Rainer Stratmann wrote
Why is -Mfpc the default language style? I assume -Mobjfpc or -M2 is the most used style.

"fpc" was the first mode that FPC supported, so that's kept because of backwards compatibility.

Why does -Mobjfpc overwrite the assember style?

Because only for modes TP and Delphi the default style is Intel instead of AT&T which was chosen as the default for FPC (not the mode, but the compiler) on x86 systems.

And before you ask: I don't know why AT&T was chosen as default, maybe by personal preference. I personally indeed prefer the AT&T syntax over the Intel one...

Regards,
Sven

Reply by email

Marco van de Voort
to Sven Barth

In our previous episode, Sven Barth said:

Show quoted text 7 lines
Because only for modes TP and Delphi the default style is Intel instead of AT&T which was chosen as the default for FPC (not the mode, but the compiler) on x86 systems. And before you ask: I don't know why AT&T was chosen as default, maybe by personal preference. I personally indeed prefer the AT&T syntax over the Intel one...

Originally FPC only supported mode direct, passing assembler mostly verbatim (as text) to the backend assembler (G)AS. And AS was AT&T only at the time.

The first assembler readers date from the 0.99.8 period IIRC, or maybe one later. This also allowed for using parameter symbols etc. (+/- 1998?)

Intel followed rather quickly, but I think that Intel style was only made the default of mode Delphi in 1.9.8 or so. (so say late 2004 or early 2005), when assembler really became somewhat compatible with the change to from oldfpccall to the "register" calling convention

Reply by email

Sven Barth
to Marco van de Voort
Marco van de Voort wrote 19 lines
In our previous episode, Sven Barth said: > Because only for modes TP and Delphi the default style is Intel instead > of AT&T which was chosen as the default for FPC (not the mode, but the > compiler) on x86 systems. > > And before you ask: I don't know why AT&T was chosen as default, maybe > by personal preference. I personally indeed prefer the AT&T syntax over > the Intel one... Originally FPC only supported mode direct, passing assembler mostly verbatim (as text) to the backend assembler (G)AS. And AS was AT&T only at the time. The first assembler readers date from the 0.99.8 period IIRC, or maybe one later. This also allowed for using parameter symbols etc. (+/- 1998?) Intel followed rather quickly, but I think that Intel style was only made the default of mode Delphi in 1.9.8 or so. (so say late 2004 or early 2005), when assembler really became somewhat compatible with the change to from oldfpccall to the "register" calling convention

Thank you for the explanation :)

Regards,
Sven

Reply by email