Sign in Join

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

Mailing lists / fpc-pascal / 2001-06

Another Intel ASM problem

7 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

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

Kanzelsberger Pavel

Hi,

I need help with little ASM problem (Intel syntax)

In AT&T syntax you can do following to align code:

asm
.balign 8
[somecode]
end;

Is something similar supported in FPC compiler inside Intel ASM? I have really big GUI library written in 100% Intel assembler and need to align all procedures to speed-up the code but I don't want to rewrite it to AT&T syntax...

thanks, Pavel Kanzelsberger

Earlier message 22 lines
-----Original Message----- From: Sent: Tuesday, June 26, 2001 11:27 AM To: Subject: Re: [fpc-pascal]Gothic Font > > On maandag, juni 25, 2001, at 06:19 , Marco van de Voort wrote: > > >> Please post a small example which shows the problem, it should work > >> fine > >> normally. It's at least displayed properly in a ported version of the > >> graphdemo that comes with TP. > > > > is the .CHR support based on my old code, or did you recode it? > > Afaik it's based on Carl's code (I don't know where he got it from). Probably the same way as I did. (based on a stroked font file description in SWAG)

Reply by email

Peter Vreman
to Kanzelsberger Pavel
Show quoted text 14 lines
I need help with little ASM problem (Intel syntax) In AT&T syntax you can do following to align code: asm .balign 8 [somecode] end; Is something similar supported in FPC compiler inside Intel ASM? I have really big GUI library written in 100% Intel assembler and need to align all procedures to speed-up the code but I don't want to rewrite it to AT&T syntax...

There is no support for an align directive.

It can maybe added, but there is no specific intel syntax that defines how it should be added.

Peter

Reply by email

Kanzelsberger Pavel

Hmm and can you add something FPC native? Maybe {$BALIGN 8}...

I think you can support .balign as in AT&T as Intel doesn't define such directive :)

regards, Pavel Kanzelsberger

Earlier message 32 lines
-----Original Message----- From: Peter Vreman Sent: Tuesday, June 26, 2001 8:15 PM To: Subject: Re: [fpc-pascal]Another Intel ASM problem > >I need help with little ASM problem (Intel syntax) > >In AT&T syntax you can do following to align code: > >asm >.balign 8 >[somecode] >end; > >Is something similar supported in FPC compiler inside Intel ASM? I have >really big GUI library written in 100% Intel assembler and need to align >all procedures to speed-up the code but I don't want to rewrite it to AT&T >syntax... There is no support for an align directive. It can maybe added, but there is no specific intel syntax that defines how it should be added. Peter

Reply by email

Peter Vreman
Hmm and can you add something FPC native? Maybe {$BALIGN 8}...

What do you want to do with that? Directives are only used to change 'configuration' values not to insert code/data

I think you can support .balign as in AT&T as Intel doesn't define such directive :)

How does align work under tasm/masm/delphi?

Reply by email

Kanzelsberger Pavel

Yes I know that directives are used to change configuration, for example by setting {$BALIGN 8} compiler should add ".balign 8" in before every procedure code...

I never used this in TASM or in Delphi, I just found it in FPC sources inside AT&T assembler and found that 8 byte aligned code really speeds-up the execution so I want to use it in my libraries...

Another idea is to add new optimization switch which adds this to every procedure and main code...

But hey, it's you who will decide to put it and which way :-))) This is just my idea about this, because it's much easier to use it as FPC feature instead of rewriting 80000 lines of code to AT&T assembler :)

best regards, Pavel Kanzelsberger

Earlier message 23 lines
-----Original Message----- From: Peter Vreman Sent: Wednesday, June 27, 2001 12:14 PM To: Subject: RE: [fpc-pascal]Another Intel ASM problem > Hmm and can you add something FPC native? Maybe {$BALIGN 8}... What do you want to do with that? Directives are only used to change 'configuration' values not to insert code/data > I think you can support .balign as in AT&T as Intel doesn't define such > directive :) How does align work under tasm/masm/delphi?

Reply by email

Peter Vreman
Yes I know that directives are used to change configuration, for example by setting {$BALIGN 8} compiler should add ".balign 8" in before every procedure code...

But what about alignment of jumps and loops? A more generic

{$ALIGNCODE PROCEDURE=8}
{$ALIGNCODE LOOP=4}
{$ALIGNCODE JUMP=4}

is more generic and extendable

Show quoted text 10 lines
I never used this in TASM or in Delphi, I just found it in FPC sources inside AT&T assembler and found that 8 byte aligned code really speeds-up the execution so I want to use it in my libraries... Another idea is to add new optimization switch which adds this to every procedure and main code... But hey, it's you who will decide to put it and which way :-))) This is just my idea about this, because it's much easier to use it as FPC feature instead of rewriting 80000 lines of code to AT&T assembler :)

I think that the simple word ALIGN should be enough:

mov eax,1
ALIGN 4
@1:
inc eax
loop @1

This is readable and i think it won't clash with other things.

Anybody other opinions?

Btw. this will be added only in the 1.1 development version

Reply by email

Kanzelsberger Pavel

Great! Simply great... can't wait for that :-))

regards, Pavel Kanzelsberger

Earlier message 50 lines
-----Original Message----- From: Peter Vreman Sent: Wednesday, June 27, 2001 3:12 PM To: Subject: RE: [fpc-pascal]Another Intel ASM problem > Yes I know that directives are used to change configuration, for example by > setting {$BALIGN 8} compiler should add ".balign 8" in before every > procedure code... But what about alignment of jumps and loops? A more generic {$ALIGNCODE PROCEDURE=8} {$ALIGNCODE LOOP=4} {$ALIGNCODE JUMP=4} is more generic and extendable > I never used this in TASM or in Delphi, I just found it in FPC sources > inside AT&T assembler and found that 8 byte aligned code really speeds-up > the execution so I want to use it in my libraries... > > Another idea is to add new optimization switch which adds this to every > procedure and main code... > > But hey, it's you who will decide to put it and which way :-))) This is just > my idea about this, because it's much easier to use it as FPC feature > instead of rewriting 80000 lines of code to AT&T assembler :) I think that the simple word ALIGN should be enough: mov eax,1 ALIGN 4 @1: inc eax loop @1 This is readable and i think it won't clash with other things. Anybody other opinions? Btw. this will be added only in the 1.1 development version

Reply by email