Sign in Join

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

Mailing lists / fpc-pascal / 2008-06

Breaking code while deleting assembler file ?

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

Seweryn Walentynowicz

Simply program file with assembler code:

program Buggy;
{$asmmode intel}
procedure TestProc; Assembler;
asm
 jcxz @@odd
 @@odd:
end;
begin
 TestProc;
 writeln('OK');
end.

and now I compile it and run with -a option :

$ fpc -a BUGGY.PAS
Free Pascal Compiler version 2.0.4 [2006/09/16] for i386 Copyright (c) 1993-2006 by Florian Klaempfl
Note: Switching assembler to default source writing assembler Target OS: Linux for i386
Compiling BUGGY.PAS
Assembling buggy
Linking BUGGY
12 Lines compiled, 0.1 sec
$ ./BUGGY
OK

works fine. I decide to compile with deleting source assembler file. Same as above, only difference is missing -a option.

$ fpc BUGGY.PAS
Free Pascal Compiler version 2.0.4 [2006/09/16] for i386 Copyright (c) 1993-2006 by Florian Klaempfl
Target OS: Linux for i386
Compiling BUGGY.PAS
Linking BUGGY
12 Lines compiled, 0.3 sec
$ ./BUGGY
Runtime error 216 at $000080C3
$000080C3
$0804809F

Testing on linux and windows FPC version, works the same: crashes version compiled without -a option..
I don't understand this, cause -a switch is "the compiler doesn't delete the generated assembler file", and in any form shouldn't touch generated code.
Could anybody clarify me, what happen ?

regards

Seweryn Walentynowicz

Reply by email

Florian Klaempfl
to Seweryn Walentynowicz
Show quoted text 5 lines
Testing on linux and windows FPC version, works the same: crashes version compiled without -a option.. I don't understand this, cause -a switch is "the compiler doesn't delete the generated assembler file", and in any form shouldn't touch generated code.

It uses the external assembler which makes in theory no difference, in practice it makes sometimes.

Could anybody clarify me, what happen ?

Please retest with 2.2.0/2.2.2rc1 first.

Reply by email

Seweryn Walentynowicz
to Florian Klaempfl
Florian Klaempfl wrote 5 lines
Seweryn Walentynowicz schrieb: > Testing on linux and windows FPC version, works the same: crashes > version compiled without -a option.. It uses the external assembler which makes in theory no difference, in practice it makes sometimes.

Thanks, now I know what a difference is.

> Could anybody clarify me, what happen ? Please retest with 2.2.0/2.2.2rc1 first.

crashes on 2.0.4, and 2.0.2, but on 2.2.0 is ok. Time to upgrade ;o)

Thanks again

Seweryn Walentynowicz

Reply by email