[fpc-pascal] Breaking code while deleting assembler file ?

Seweryn Walentynowicz seweryn at walor.torun.pl
Tue Jun 24 09:05:29 CEST 2008


 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
       S.Walentynowicz at walor.torun.pl



More information about the fpc-pascal mailing list