[fpc-pascal] NX library

2005-11-03 Thread Marcel Martin
Hello, For those who never heard of it, i.e., almost everybody :-) I am writing a big number library for FPC 2.x called NX. It is a freeware and its source is available. Currently, NX contains only big integers and big polynomials over GF(2) but, if all goes well, the units nxfloats and nxcomplex

[fpc-pascal] File dates on the FPC server

2005-09-08 Thread Marcel Martin
Hello, Maybe this has no importance but some file dates are not correct on the server : ftp://ftp.freepascal.org/pub/fpc/snapshot/v20/i386-win32 File: base.i386-win32.zip 8496 KB 31/08/2004 01:28:00 ^ ftp://ftp.freepascal.org/pub/fpc/snapshot/v21/

Re: [fpc-pascal] fast integer multiplication

2005-07-29 Thread Marcel Martin
Peter Vreman a écrit : Since you ask the question, I suppose you cannot simply suppress the "movl $0,%edx" line generation [*]. What about using a compiler directive, something like {$EXTENDEDMUL ON/OFF} for instance? I don't like this. This means we have to add directives for all kind of speci

Re: [fpc-pascal] fast integer multiplication

2005-07-29 Thread Marcel Martin
Peter Vreman a écrit : >Marcel Martin wrote : Since you ask the question, I suppose you cannot simply suppress the "movl $0,%edx" line generation [*]. What about using a compiler directive, something like {$EXTENDEDMUL ON/OFF} for instance? I don't like this. This me

Re: [fpc-pascal] fast integer multiplication

2005-07-28 Thread Marcel Martin
Florian Klaempfl a écrit : Vincent Snijders wrote: Hi, Suppose I have the following code: var a,b: dword; c: qword; begin a := 1000; b := 2000; c := a * b; writeln(c); end. Now, although c is large enough to contain the result only the lower dword is filled. I can force corre

Re: [fpc-pascal] fast integer multiplication

2005-07-23 Thread Marcel Martin
Florian Klaempfl a écrit : Vincent Snijders wrote: Hi, Suppose I have the following code: var a,b: dword; c: qword; begin a := 1000; b := 2000; c := a * b; writeln(c); end. Now, although c is large enough to contain the result only the lower dword is filled. I can force corre

Re: [fpc-pascal] Calling unassigned procedure gives no stack trace with -gl

2005-07-13 Thread Marcel Martin
Let it be. I just saw that, in fact, you told about the problem in the subject of the post :-) mm ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Calling unassigned procedure gives no stack trace with -gl

2005-07-13 Thread Marcel Martin
Tom Verhoeff a écrit : begin VMyClass := TMyClass.Create; //VMyClass.FP := VMyClass.P; { with this assignment, it works } VMyClass.FP; { this causes an Access Violation } Of course, at this point FP = nil since you didn't set it. mm ___ fpc-

Re: [fpc-pascal] Single or Double

2005-07-11 Thread Marcel Martin
Florian Klaempfl a écrit : Marcel Martin wrote: Hello, I need to know *at compile time* whether the type Real is Single or Double. Currently, I use this {$IFDEF FPC_HAS_TYPE_DOUBLE} ... {$ELSE} {$IFDEF FPC_HAS_TYPE_SINGLE} ... {$ELSE} {$FATAL Type Real should be defined as Single or as

[fpc-pascal] Single or Double

2005-07-10 Thread Marcel Martin
Hello, I need to know *at compile time* whether the type Real is Single or Double. Currently, I use this {$IFDEF FPC_HAS_TYPE_DOUBLE} ... {$ELSE} {$IFDEF FPC_HAS_TYPE_SINGLE} ... {$ELSE} {$FATAL Type Real should be defined as Single or as Double} {$ENDIF} // FPC_HAS_TYPE_SINGLE {$ENDIF} // F

[fpc-pascal] About the bug report #3931

2005-05-05 Thread Marcel Martin
About the bug report #3931 >The following does not compile: >jmp dword ptr [@@FwdJumpTable+ecx*4] <--- >nop {Align Jump Table} >@@FwdJumpTable: [...] Use "jmp dword ptr @@FwdJumpTable[ecx*4]" Don't use "nop" to align, use the "align" instruction (Yes, FPC is better than Delphi :-) mm __

[fpc-pascal] Basic routines

2005-04-09 Thread Marcel Martin
Hello, While writing the "pure Pascal" version of a big integer library (for FPC 2.0), I notice that the use of a very small assembler function lowers the average running time of the computations by about 30-35%. This is far from insignificant. Currently I use a macro to enable the x86 (32 bits) pr

Re: [fpc-pascal] Question about interfaces and patch

2005-03-24 Thread Marcel Martin
Michael Van Canneyt wrote: On Thu, 24 Mar 2005 [EMAIL PROTECTED] wrote: procedure MyXYZPart.DoReport(aRep: IReportable); begin if (aRep <> nil) then begin if (aRep is ILogged) then (aRep as ILogged).Log(aRep.Report) else aRep.Report end; I see what you want, but if you would do pr

Re: [fpc-pascal] ReAllocMem problem (?)

2005-03-20 Thread Marcel Martin
Micha Nelissen wrote: The problem with your approach is: how do you know whether the memory was extended, or left alone because there was no memory available to extend it ? In general, shortage of memory produces a runtime error, but this is configurable by a global var. No, that's easy. If

[fpc-pascal] Problem with a web page

2005-03-20 Thread Marcel Martin
Since tonight, I cannot access the 'last 7 days' bug page. Here is the error message Warning: mysql_connect(): User 'FPCUser' has exceeded the 'max_connections' resource (current value: 10) in /FPC/html/bugs/bugs.php on line 11 mm ___ fpc-pascal mailli

Re: [fpc-pascal] ReAllocMem problem (?)

2005-03-12 Thread Marcel Martin
mm wrote: compute !1, i.e., Factorial 1. Currently, all you have Of course, I should have written "1!" and not "!1". mm ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] ReAllocMem problem (?)

2005-01-18 Thread Marcel Martin
Marcel Martin a écrit : > > Hello, > > The following function SysReAllocMem comes from the file > /rtl/inc/heap.inc (FPC 1.9.7 / Win32) > > function SysReAllocMem(var p: pointer; size: ptrint):pointer; > [...] >{ Resize block } >if not SysTryRes

[fpc-pascal] ReAllocMem problem (?)

2005-01-17 Thread Marcel Martin
Hello, The following function SysReAllocMem comes from the file /rtl/inc/heap.inc (FPC 1.9.7 / Win32) function SysReAllocMem(var p: pointer; size: ptrint):pointer; [...] { Resize block } if not SysTryResizeMem(p,size) then begin minsize := MemoryManager.MemSize(p); if size < mi

[fpc-pascal] Problems with snapshots

2004-10-14 Thread Marcel Martin
Hello, Yesterday, I downloaded 1.9.5 (executable for Windows). I wanted to check whether the bug #3335 (which makes the IDE unusable under Windows) had been fixed. 1) install.exe doesn't work. A windows is opened but it is immediately followed by a dialog box notifying that the program is abou

Re: [fpc-pascal] Known issue with 1.9.4 [2004/05/30] for i386 on Linux?

2004-09-29 Thread Marcel Martin
Alan Mead a écrit : > > I don't know if this is really a bug or whether it's known... I have > this line of code: > > while ( (i<=Length(fmt)) and (NOT fmt[i] IN ['0'..'9']) ) do > inc(i); > > It compiles fine but I get a RTE: > > An unhandled exception occurred at 0x0807B180 : > EVariantErro

Re: [fpc-pascal] Known issue with 1.9.4 [2004/05/30] for i386 on Linux?

2004-09-29 Thread Marcel Martin
Alan Mead a écrit : > > I don't know if this is really a bug or whether it's known... I have > this line of code: > > while ( (i<=Length(fmt)) and (NOT fmt[i] IN ['0'..'9']) ) do > inc(i); > > It compiles fine but I get a RTE: > > An unhandled exception occurred at 0x0807B180 : > EVariantErro

Re: [fpc-pascal]Apple Mac pointer problem

2004-09-23 Thread Marcel Martin
Stephen Downs a écrit : > > I am porting a Mac CodeWarrior project to FreePascal and have hit a > compile problem with a pointer. In my original code I have a structure > defined along the lines of > > testData = record >testIndex : array [0..12] of integer; > end; > > testDataPointer = ^te

Re: [fpc-pascal]heaptrc

2004-09-21 Thread Marcel Martin
Vincent Snijders a écrit : > > Marcel Martin wrote: > > Hello, > > > > I am using fpc 1.9.5 (2004/09/15). > > > > There is a problem with the unit heaptrc and the routine > > Reallocmem. For instance > > > > var p : PLongword; > > &g

[fpc-pascal]heaptrc

2004-09-20 Thread Marcel Martin
Hello, I am using fpc 1.9.5 (2004/09/15). There is a problem with the unit heaptrc and the routine Reallocmem. For instance var p : PLongword; Reallocmem(p,1000*4); ... Reallocmem(p,200*4); <- this instruction upset heaptrc Does the problem come from Reallocmem or from the heaptrc unit

[fpc-pascal]fpc_mod_qword

2004-07-10 Thread Marcel Martin
Hello, I saw in the file fpc/rtl/i386/int64p.inc that the function fpc_mod_qword was disabled with the comment "This does not work correctly". The problem is a bad instruction (presumably a typo): .Lqwordmodr_big_divisior: | | shrdl %cl,%edx,%eax shrl %cl,%edx rorl $1,%ed

Re: [fpc-pascal]Yet another problem concerning Qualifiers

2004-07-09 Thread Marcel Martin
Anton Tichawa a écrit : > > Hello List! > > Compiling the unit > > === > > unit test; > > interface > > procedure test.do_test; > > implementation > > procedure test.do_test; > begin > end; > > end. > > === > > results in compiler errors: > > test.pas(5,15) Error: overloaded identifier

Re: [fpc-pascal]Linked List/ pointers/ casting/ OOP Question

2004-07-09 Thread Marcel Martin
Ron Weidner a écrit : > > I thought I was getting closer to understanding > pointers but it appears that I'm still not getting it. > I wrote the following code fragment but it doesn't > compile. the errors I get are... > > Widget_container_class.pas(80,27) Error: Illegal > qualifier > Widget_co

Re: [fpc-pascal]Default calling convention

2004-07-04 Thread Marcel Martin
Florian Klaempfl a écrit : > > Marcel Martin wrote: > > > Florian Klaempfl a écrit : > > > >>Thomas Schatzl wrote: > >> > >>>In this case > >>> > >>> procedure nx_fill(P: PLongword; Count: Longint; Value: Longword); &

Re: [fpc-pascal]Default calling convention

2004-07-03 Thread Marcel Martin
Florian Klaempfl a écrit : > > Thomas Schatzl wrote: > > > > In this case > > > > procedure nx_fill(P: PLongword; Count: Longint; Value: Longword); > > assembler; > > asm > > pushl %edi > > movlP,%edi // edi <- P > > movlValue,%eax // eax <- Value >

Re: [fpc-pascal]Default calling convention

2004-07-02 Thread Marcel Martin
Thomas Schatzl a écrit : > > Hello, > > I noticed that, with FPC 1.9.4, the (default) calling convention > "register" depends on the fact that a routine is or is not embedded > in an other routine. > > With "proc(A,B,C: Longint);", if "proc" is not embedded then > eax = A

Re: [fpc-pascal]Default calling convention

2004-07-02 Thread Marcel Martin
Peter Vreman a écrit : > > Check what Delphi does for nested procedures. If it is different from FPC > then FPC will be adapted. > Overall, no :-) Delphi (at least the version 5.01) is bugged. For instance, with function Add: Longword; var x : Longword; function DoAdd(a: Longword): Lo

[fpc-pascal]Default calling convention

2004-07-01 Thread Marcel Martin
Marco van de Voort wrote: > Marcel Martin wrote: > > > > I noticed that, with FPC 1.9.4, the (default) calling convention > > "register" depends on the fact that a routine is or is not embedded > > in an other routine. > > > > With "proc(A,B

[fpc-pascal]Default calling convention

2004-06-27 Thread Marcel Martin
Hello, I noticed that, with FPC 1.9.4, the (default) calling convention "register" depends on the fact that a routine is or is not embedded in an other routine. With "proc(A,B,C: Longint);", if "proc" is not embedded then eax = A, edx = B and ecx = C but if "proc" is embedded then edx = A, ecx =

Re: [fpc-pascal]Align instruction

2004-06-23 Thread Marcel Martin
Peter Vreman a écrit : > Added support for the ALIGN directive also to asmmode intel. Thanks. BTW, nobody answered about the problem with "Level 2 Optimizations" I reported here a few days ago. Is it a bug of the compiler? I ask the question because at the moment I am sure of nothing (sometimes

Re: [fpc-pascal]Align instruction

2004-06-22 Thread Marcel Martin
Peter Vreman a écrit : > > > Hello, > > > > With v1.9.4, is there a way to align a label in an assembler > > procedure? > > .align, .balign or .p2align I forgot to tell "with {$ASMMODE INTEL}". But if I understand you well, in order to use aligned labels, I have to (re-)write the code with the

[fpc-pascal]Align instruction

2004-06-21 Thread Marcel Martin
Hello, With v1.9.4, is there a way to align a label in an assembler procedure? Thanks -- mm http://www.ellipsa.net/ ___ fpc-pascal maillist - [EMAIL PROTECTED] http://lists.freepascal.org/mailman/listinfo/fpc-pascal

[fpc-pascal]Bug with "Level 2 Optimizations"

2004-06-16 Thread Marcel Martin
Hello, Here is a bug (?) of the compiler (FP 1.9.4) when setting Level 2 Optimizations. I post it here since I don't believe it is possible to use the bug report form. (I work with Win98, AMD 2600+) Types used in the code. type TBigInt = record Digits: PDigits;// pointer to a digit

Re: [fpc-pascal]1st post

2004-06-16 Thread Marcel Martin
Hello, Thanks for the quick answers. Peter Vreman a écrit : > > 2) " end [ {$IFNDEF REGCALL} 'eax','ecx', {$ENDIF} 'edi']; " > > Is the previous line meaningful? (See the routine below) > > No, FPC 1.9.x follows standard calling conventions. The changed registers > are fixed. This information is

[fpc-pascal]1st post

2004-06-15 Thread Marcel Martin
Hello, At first, thanks and congratulations for Free Pascal. I am trying to convert all my libraries (big integers, big floats, etc) from Delphi 5 to Free Pascal 1.9.4. As a total newbie with Free Pascal, I have some questions. 1) In an assembler routine, is the direction flag managed like in