Re: [fpc-pascal]Mouse Unit
On Thu, 6 Feb 2003, Mark Emerson wrote: The mouse unit appears to support resolution only at character granularity. What about pixels? That is not the purpose of this mouse unit. The mouse unit is intended for text-based screens only, so the character granularity is sufficient. Michael. ___ fpc-pascal maillist - [EMAIL PROTECTED] http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal]Linking to Windows
At 15:28 06-02-2003 +0100, you wrote: You may use the GetProcAddress (Win32 API function) to retrieve the procedure's START-ADDRESS, wehre the input parameter is EITHER an index, I think of limited size, OR a name, that must be SPELLED CORRECTLY. If you try both, and look for MATCHING ADDRESSES, you should be able to get all (?) you need. snip Hope this Helps. Anton Tichawa. I've tried this before with poor succes, may be the problem was the point with the correct spelling. Thank you very much for your help. Hans M. ___ fpc-pascal maillist - [EMAIL PROTECTED] http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal]Performance testing of FPC programs?
On Fri, Feb 07, 2003 at 04:56:10PM +0100, Preben Mikael Bohn wrote: Hi all, I have a relatively large FPC program that I suspect have a few bottlenecks (regarding processing speed). Are there any ways I can test how long time the program spends in the different procedures/functions? Use this bit of code in your functions/procedures or write it as a function and call it. Best regards Preben ___ fpc-pascal maillist - [EMAIL PROTECTED] http://lists.freepascal.org/mailman/listinfo/fpc-pascal Program Example5; { Program to demonstrate the GetTime function. } Uses linux, CRT, sysUtils; Var Hour, Minute, Second, msec, usec : Word; begin clrScr; repeat gotoXY(1, 1); getTime (Hour, Minute, Second, msec, usec); writeLn('Time: ' + intToStr(Hour) + ':' + intToStr(Minute) + ':' + intToStr(Second) + '.' + intToStr(msec) + '.' + intToStr(usec)); until keyPressed; end.
Re: [fpc-pascal]Performance testing of FPC programs?
Hello, On Fri, 7 Feb 2003, Preben Mikael Bohn wrote: Hi all, I have a relatively large FPC program that I suspect have a few bottlenecks (regarding processing speed). Are there any ways I can test how long time the program spends in the different procedures/functions? Use the -pg to compile your program and then use gprof to see profile information. Best regards, Adam Naumowicz == Department of Applied Logicfax. +48 (85) 745-7662 Institute of Computer Science tel. +48 (85) 745-7559 (office) University of Bialystoke-mail: [EMAIL PROTECTED] Sosnowa 64, 15-887 Bialystok, Poland http://math.uwb.edu.pl/~adamn/ == ___ fpc-pascal maillist - [EMAIL PROTECTED] http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal]Performance testing of FPC programs?
Hi all, I have a relatively large FPC program that I suspect have a few bottlenecks (regarding processing speed). Are there any ways I can test how long time the program spends in the different procedures/functions? If the platform is suitable: read in the manual about profiling support and use the -pg switch. ___ fpc-pascal maillist - [EMAIL PROTECTED] http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal]isprime()
Hi Anton :) Does the function return false for 0 and 1? Yes How easy isit to upgrade for 64 bit lengths? Indeed, isprime() is part of a routine working with the 'nat' big numbers of the unit bigint10. Its purpose is to perform a primality check by a strong test to the base 2 and a Lucas test. But up to 32 bits it is enough a Miller-Rabin test to bases 2, 7 and 61, which covers up to 4,759,123,141. To do this, isprime() must evaluate some powers and squares modulo a cardinal involving 64 bit operands. I write here the function, so it may be used and tested. If there are problems let me know. Franco Milani - CONST arlc_ispv: array [1..18] of cardinal = (61,59,53,47,43,41,37,31,29,23,19,17,13,11,7,5,3,2); VAR vloc_ispa,vloc_ispb,vloc_ispc,vloc_ispd,vloc_ispe,vloc_ispf: cardinal; FUNCTION isprime (n: cardinal): boolean; assembler; asm movl8(%ebp),%ebx lealarlc_ispv,%edi movl$17,%ecx cmpl$61,%ebx ja .L5 .L6:cmpl(%edi,%ecx,4),%ebx je .L7 decl%ecx jns .L6 jmp .L8 .L5:movl%ebx,%eax xorl%edx,%edx movl(%edi,%ecx,4),%esi divl%esi cmpl$0,%edx je .L8 decl%ecx jns .L5 decl%ebx movl%ebx,vloc_ispa xorl%ecx,%ecx testl $1,%ebx jnz .L9 .L10: shrl$1,%ebx incl%ecx testl $1,%ebx jz .L10 .L9:movl%ebx,vloc_ispb cmpl$0,%ecx je .L11 decl%ecx .L11: movl%ecx,vloc_ispc movl$2,vloc_ispd movl$2,%eax jmp .L12 .L13: movl$7,%eax jmp .L12 .L14: movl$61,%eax .L12: movlvloc_ispb,%ebx movl8(%ebp),%ecx cmpl$1,%ebx jne .L15 xorl%edx,%edx divl%ecx movl%edx,%eax jmp .L16 .L15: movl%eax,%edi bsrl%ebx,%edx movl%edx,vloc_ispe btl $0,%ebx jnc .L17 movl%eax,%esi jmp .L18 .L17: movl$1,%esi .L18: movl$1,vloc_ispf .L19: movl%edi,%eax mull%edi cmpl%ecx,%edx jb .L20 movl%eax,%ebx movl%edx,%eax xorl%edx,%edx divl%ecx movl%ebx,%eax .L20: divl%ecx movl%edx,%edi movlvloc_ispb,%eax movlvloc_ispf,%ebx btl %ebx,%eax jnc .L21 movl%esi,%eax mull%edi cmpl%ecx,%edx jb .L22 movl%eax,%ebx movl%edx,%eax xorl%edx,%edx divl%ecx movl%ebx,%eax .L22: divl%ecx movl%edx,%esi .L21: inclvloc_ispf declvloc_ispe jnz .L19 movl%esi,%eax .L16: cmpl$1,%eax je .L23 cmplvloc_ispa,%eax je .L23 cmpl$0,vloc_ispc je .L8 movlvloc_ispc,%esi .L24: mull%eax cmpl%ecx,%edx jb .L25 movl%eax,%ebx movl%edx,%eax xorl%edx,%edx divl%ecx movl%ebx,%eax .L25: divl%ecx movl%edx,%eax cmplvloc_ispa,%eax je .L23 cmpl$1,%eax je .L8 .L26: decl%esi jnz .L24 jmp .L8 .L23: declvloc_ispd jz .L14 jns .L13 .L7:movl$1,%eax jmp .L27 .L8:xorl%eax,%eax .L27: end; ___ fpc-pascal maillist - [EMAIL PROTECTED] http://lists.freepascal.org/mailman/listinfo/fpc-pascal