Float problem with PB 522, Tailbite 1.4.11 and Win7(x64)

TailBite specific forum

Moderators: gnozal, ABBKlaus, lexvictory

mpz
Enthusiast
Enthusiast
Posts: 494
Joined: Sat Oct 11, 2008 9:07 pm
Location: Germany, Berlin > member German forum

Float problem with PB 522, Tailbite 1.4.11 and Win7(x64)

Post by mpz »

Hello,

i have a problem and whant to know is it a bug or make i something wrong ?!?

if i use the following code with pb511(x86 and x64) it works.
If i use the following code with pb522(x86) it works too, but if i use the code in pb522(x64) i got only "NaN" back

Greetings Michael

lib code

Code: Select all

ProcedureDLL.f test_LimitTo360(angle.f) ; Limitiert einen Winkel auf -359,999 zu 359,999 Grad 
  
  While angle > 360
		angle - 360
  Wend
  
	While angle < - 360
		angle + 360;
  Wend
  
  var.d = angle
  
  ProcedureReturn angle

EndProcedure
testfile

Code: Select all

For n = 200 To 1000
     Debug test_LimitTo360(n)
Next
Working on - MP3D Library - PB 5.73 version ready for download
mpz
Enthusiast
Enthusiast
Posts: 494
Joined: Sat Oct 11, 2008 9:07 pm
Location: Germany, Berlin > member German forum

Re: Float problem with PB 522, Tailbite 1.4.11 and Win7(x64)

Post by mpz »

Hi,

i have checked the differenz between

PB511x64 and beetween PB522x64

at the end of the Procedure are two commands and make the problem. If you delete the lines the command works

Greetings Michael

Code: Select all

; EndProcedure
FLDZ
_EndProcedure1:
ADD    rsp,48
;FSTP   dword [rsp-8] <- make the Problem
;MOVSS  xmm0,[rsp-8] <- make the Problem
POP    r15
RET 
For now i had mada a dirty trick. I use tailbit, then i use this program for delete the lines
in the asm file in the folder
"C:\Users\Myname\Documents\TailBite Library Sources\My_Library\Functions\"
"C:\Users\Myname\Documents\TailBite Library Sources\My_Library\Functions\Shared\"

The i start the "My_Librarybuild.bat" batch and the compiled lib works

Code: Select all

;
; ------------------------------------------------------------
;
;   PureBasic - FileSystem example file
;
;    (c) 2001 - Fantaisie Software
;
; ------------------------------------------------------------
;

If OpenWindow(0, 100, 200, 590, 200, "PureBasic - FileSystem Example")

  StringGadget  (0,  10, 10, 202, 24, GetHomeDirectory())
  ButtonGadget  (1, 220, 10, 60 , 24, "List")
  ListViewGadget(2,  10, 40, 570, 150)

  Repeat
    Event = WaitWindowEvent()

    If Event = #PB_Event_Gadget
      If EventGadget() = 1 ; Read

        ClearGadgetItems(2)  ; Clear all the items found in the ListView

        If ExamineDirectory(0, GetGadgetText(0), "*.asm")

          While NextDirectoryEntry(0)

            FileName$ = GetGadgetText(0)+DirectoryEntryName(0)
            If DirectoryEntryType(0) = #PB_DirectoryEntry_Directory
              FileName$ = "[DIR] "+FileName$
            Else  
              
              AddGadgetItem(2, -1, FileName$)
              
              
              If OpenFile(0,FileName$)    ; öffnet eine existierende Datei oder erstellt eine, wenn sie noch nicht existiert
                 While Eof(0) = 0           ; sich wiederholende Schleife bis das Ende der Datei ("end of file") erreicht ist
                    search$ = ReadString(0)      ; Zeile für Zeile im Debugger-Fenster anzeigen
                    If  FindString(search$,"FSTP   dword [rsp-8]")
                      FileSeek(0, Loc(0)-Len(search$)-2)
                      WriteString(0,";")
                    EndIf
                    If  FindString(search$,"MOVSS  xmm0,[rsp-8]")
                      FileSeek(0, Loc(0)-Len(search$)-2)
                      WriteString(0,";")
                    EndIf
                  Wend

              EndIf
              
            EndIf
            
          Wend
          
        Else
          MessageRequester("Error","Can't examine this directory: "+GetGadgetText(0),0)
        EndIf

      EndIf
    EndIf

  Until Event = #PB_Event_CloseWindow

EndIf

End 
Working on - MP3D Library - PB 5.73 version ready for download
Post Reply