[fpc-pascal] Re: Help needed with interfacing to C-object-files.

2005-03-09 Thread Jeff Pohlmeyer
> Let me explain more : the header file is used in at least
> five source-files, so compiling gives (at least) five .o 
> files, but none with the name of the header-file.


>From the command line :

  ar -r libDallas.a  file1.o file2.o ...


and then, in your program:

  {$LINKLIB Dallas}


 - Jeff




-- 


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpc198 and old bugs

2005-03-09 Thread Bartek

- Original Message - 
From: "Peter Vreman" <[EMAIL PROTECTED]>
To: "FPC-Pascal users discussions" 
Sent: Tuesday, March 08, 2005 10:12 PM
Subject: Re: [fpc-pascal] fpc198 and old bugs


>
>//-
-
> >program bug;
> >uses heaptrc,sysutils;
> >begin
> >markheap;
> >end.
>
> Use the bug repository to report bugs otherwise they will be forgotten.

done so.

thanks for your answer.
bartek


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] intel asm and fpc-1.9.8

2005-03-09 Thread Jan Je/lowicki
Hello,

I have dozens of blas-like assembler procedures. They have been 
written about 10 years ago and I still use them in both virtualpascal 
and free pascal programs.

Today I tried new fpc 1.9.8. Output generated from fpc 1.9.8 code 
seems errorenous. The isolated example given below tries to fill an 
array of float with contstant value. Gdb (5.3) gives no reasonable 
support, although for 1.0.10 code it does.

program atest;
type  dvector = array[1..10] of double;
const  dflsize = sizeof(double);
var   x: dvector;   i: integer;   a: double;
  {$ifdef VirtualPascal} 
  {$SAVES EBX,ESI,EDI} {$USES EAX,ECX,EDX}  {$endif}
  procedure vecfill(const dim0,dim1: integer; 
var r: dVector; c: extended); assembler;
  asm
MOV EAX,dim1;
SUB EAX,dim0;
MOV EDX,dflsize
MUL EDX

FLD TByte ptr [c]

pusheax
mov eax,dim0
dec eax
mov edx,dflsize
mul edx
MOV EDX, r
ADD EDX,EAX
pop eax
JMP @@2
  @@1:
FST QWord ptr [EDX + EAX]
SUB EAX,dflsize
  @@2:
CMP EAX,0
JGE @@1

FSTPST(0)
  end; {asmvecfill}
  
begin
  a := 123.45;  
  fillchar(x, sizeof(x),0);
  vecfill(2, 5, x, a);
  for i := 1 to 6 do
writeln(x[i]);
end.

Here is output by fpc 1.9.8:

 0.000E+000
 0.000E+000
 0.000E+000
 0.000E+000

(or access violation when arrays allocated dynamically).
Output by fpc 1.0.10 and vp 2.1 which is one I expect:

 1.2345000E+002
 1.2345000E+002
 1.2345000E+002
 1.2345000E+002

Any ideas?


   Jan Jelowicki
   [EMAIL PROTECTED]
 
---
Wroclaw University of AgricultureAkademia Rolnicza we Wroclawiu
Department of MathematicsKatedra Matematyki
---

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] intel asm and fpc-1.9.8

2005-03-09 Thread Jonas Maebe
On 9 mrt 2005, at 17:13, Jan Je/lowicki wrote:
Today I tried new fpc 1.9.8. Output generated from fpc 1.9.8 code
seems errorenous. The isolated example given below tries to fill an
array of float with contstant value. Gdb (5.3) gives no reasonable
support, although for 1.0.10 code it does.
The default calling convention changed to register parameters in 1.9.8. 
Add {$calling fpccall} at the top of your source to revert to the 
slower stack-based parameter passing.

Jonas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] TSR Programs

2005-03-09 Thread Pianoman
Hello, how can I create resident programs for WIN32 in FPC?
Any help or docs would be appreciated.
Pianoman
- Original Message -
From: <[EMAIL PROTECTED]>
To: 
Sent: Wednesday, March 09, 2005 12:00 PM
Subject: fpc-pascal Digest, Vol 7, Issue 11


> Send fpc-pascal mailing list submissions to
> fpc-pascal@lists.freepascal.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
> or, via email, send a message with subject or body 'help' to
> [EMAIL PROTECTED]
>
> You can reach the person managing the list at
> [EMAIL PROTECTED]
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of fpc-pascal digest..."
>
>
> Today's Topics:
>
>1.  fpc198 and old bugs (Bartek)
>2. Re:  Help needed with interfacing to C-object-files.
>   (Koenraad Lelong)
>3. Re:  Help needed with interfacing to C-object-files.
>   ([EMAIL PROTECTED])
>4. Re:  fpc198 and old bugs (Peter Vreman)
>5.  CLX for FPC + Bug i386 cdecl (Den Jean)
>6. Re:  CLX for FPC + Bug i386 cdecl (Simon Kissel)
>7. Re:  Help needed with interfacing to C-object-files.
>   (Marc Santhoff)
>
>
> --
>
> Message: 1
> Date: Tue, 8 Mar 2005 21:15:42 +0100
> From: "Bartek" <[EMAIL PROTECTED]>
> Subject: [fpc-pascal] fpc198 and old bugs
> To: 
> Message-ID: <[EMAIL PROTECTED]>
> Content-Type: text/plain; charset="iso-8859-1"
>
> hi,
>
> i've just downloaded fpc198 and tried the following out. (there was a bug
> with the stack in fpc)
>
file://-
-
> program bug2;
> uses sysutils;
> type
> tmmxint  =array[0..3] of smallint;
> const
> x0 :tmmxint=(0,0,0,0);
> var
> a,b,r :tmmxint;
>
> function paddw(a,b :tmmxint):tmmxint;assembler;inline;
> asm
> movq mm0, a
> paddw mm0, b
> movq @result, mm0
> end;
>
> begin
> a:=x0;b:=x0;r:=x0;
> a[0]:=1;b[0]:=1;
> r:=paddw(a,b);
> writeln(r[0]);
> end.
>
file://-
-
>
> compilations aborts with:
>
file://-
-
>  Assembling bug2
>  bug2.pas(8,13) Error: Error while assembling exitcode 1
>  bug2.pas(8,13) Fatal: There were 2 errors compiling module, stopping
>
>
file://-
-
>
> other programs also using assembler compiled well.
>
>
> i've also tried this one out:
>
file://-
-
> program bug;
> uses heaptrc,sysutils;
> begin
> markheap;
> end.
>
>
file://-
-
>
> output:
>
file://-
-
> ? Free Pascal IDE Version 1.0.2 [2005/02/21]
> ? Compiler Version 1.9.8
> ? GBD Version GDB 6.2.1
> ? Cygwin "E:\fpc198\bin\i386-win32\cygwin1.dll" version 1005.12.0.0
> Running "e:\fpc198\work\bug.exe /P"
> Marked memory at $00083514 invalid
> Wrong signature $ instead of 8736A0C5
>   $004072DB
>   $00404E74
>   $0040C6D6
>   $004096B4
>   $0040C473
>   $0040C1C9
>   $004082C6
>   $00408088
>   $004022C7
>
file://-
-
>
> thanks for help in advance
> bartek
>
>
>
>
> --
>
> Message: 2
> Date: Tue, 08 Mar 2005 21:51:40 +0100
> From: Koenraad Lelong <[EMAIL PROTECTED]>
> Subject: Re: [fpc-pascal] Help needed with interfacing to
> C-object-files.
> To: FPC-Pascal users discussions 
> Message-ID: <[EMAIL PROTECTED]>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Marc Santhoff wrote:
> > Am Mo, den 07.03.2005 schrieb Koenraad Lelong um 22:36:
> >
> >>Hi,
> >>I'm trying to make an interface to a kind of library, but I'm stuck. Any
> >>pointers are welcome.
> >>There is a C-header file, but this is common for a number of C-modules.
> >>If I translate (h2pas) this file, and use it, the linker tries to find
> >>an o-file, which does not exist. Any suggestions how to handle this ?
> >
> >
> > You've got to compile the C files to .o (gcc -c thesource.c) and then
> > link them into your pascal unit ({$L thesource.o}). This way it should
> > work, I'm using some C stuff like that.
> >
> > HTH,
> > Marc
> Let me explain more : the header file is used in at least five
> source-files, so compiling gives (at least) five .o files, but none with
> the name of the header-file.
> I was thinking that splitting that header-file in smaller files, each
> for its own source could do the trick, but I'll have to check this
> carefully. I had hoped for another suggestion.
> Anyway, thanks for the response.
> Koenraad.
>
>
>
>
> --
>
> Message: 3
> Date: Tue, 8 Mar 2005 22:08:41 +0100 (CET)
> From: [

Re: [fpc-pascal] TSR Programs

2005-03-09 Thread Thomas Schatzl
Hello,
Pianoman schrieb:
Hello, how can I create resident programs for WIN32 in FPC?
Any help or docs would be appreciated.
Pianoman
There are no special "resident" programs anymore, simply create a normal 
GUI app with an invisible window or a service. See below for more info:

E.g.
Use {$APPTYPE GUI} and WS_POPUP in CreateWindow (which works in any 
Windows version) or create a message-only window (see 
http://msdn.microsoft.com/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowfeatures.asp?frame=true#message_only 
on how to do this).

If you want it to run as service either use a tool to start the program 
as service (there should be freeware ones on the 'net, probably 
easiest), or try one of the following links for advice:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/services.asp
(if you want to do it yourself, it's basically a 
"tell-the-OS-that-you-really-want-to-do-this" type of task involving 
calling a few WinAPI functions with lots of parameters)

http://community.freepascal.org:1/bboard/q-and-a-fetch-msg.tcl?msg_id=0001RC&topic_id=14&topic=Developing%20for%20Windows
(example could need some formatting =)
http://sourceforge.net/projects/wwwserver/ (some www server written in 
Delphi)

or
http://tothpaul.free.fr/zip/NTSERVICE.ZIP (some generic service code for 
Delphi, should work in FPC from a coarse look)

Regards,
  Thomas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal