gcc error

Linux specific forum
User avatar
Brujah
Enthusiast
Enthusiast
Posts: 237
Joined: Mon Nov 03, 2003 7:45 pm
Location: Germany
Contact:

gcc error

Post by Brujah »

I tried the examples and they are working well.
But my game does not compile anymore...

I get the following:
------------------------------------------------
18380 lines processed.
Creating the executable.
gcc: purebasic.o: Datei oder Verzeichnis nicht gefunden

- Feel the ..PuRe.. Power -

sh: line 1: ./purebasic.exe: Datei oder Verzeichnis nicht gefunden
markus@localhost:~/laby>
---------------------------------------------

The number of lines seems a bit too high.
I get no other error messages.
Fred
Administrator
Administrator
Posts: 18349
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

It's the generated code which is faulty. You can compile your source with the '-c' argument like this:

pbcompiler -c yoursource.pb

Then you will have the commented assembly code in your current directory. just type this:

fasm purebasic.asm dummy.o

And it should output an error. Could you tell me which one ?

Thank you,

Fred.
User avatar
Brujah
Enthusiast
Enthusiast
Posts: 237
Joined: Mon Nov 03, 2003 7:45 pm
Location: Germany
Contact:

Post by Brujah »

Okay, I did this and I get the following:
----------------------------------------------------------------------
markus@localhost:~/laby> fasm purebasic.asm dummy.o
flat assembler version 1.45 beta 2
purebasic.asm [80214]:
MOVSX dword [PB_StringBase],word [ebp+4]
error: invalid operand.
markus@localhost:~/laby>
------------------------------------------------------------------------

I have no idea what it means.
Fred
Administrator
Administrator
Posts: 18349
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

Could you look at the line 80214 and see which Basic line (which should be in comment just above) produce the faulty code ?
Pupil
Enthusiast
Enthusiast
Posts: 715
Joined: Fri Apr 25, 2003 3:56 pm

Post by Pupil »

I tell you, there's something serioulsly wrong with the PB3.91 compiler. The code below is tested on the WIN version, but the compiler should output almost identical ASM for both Linux and WIN for the expressions in the code.

Code: Select all

Dim a.b(255)
Dim b.b(255)
y = a(255 - b(x & $ff) & $ff) ; This line makes the compiler choke
For this code i get this Assembly error:
flat assembler version 1.47
PureBasic.asm [104]:
MOVSX dword [PB_StringBase],byte [ebp+edi]
error: invalid operand.
Funny, i don't even use the string base (i.e. no string or function that returns a string in the expression) why would the compiler output ASM like this?
User avatar
Brujah
Enthusiast
Enthusiast
Posts: 237
Joined: Mon Nov 03, 2003 7:45 pm
Location: Germany
Contact:

Post by Brujah »

Okay here is the part something is wrong with:
(Maybe the statement is too complex. I will test that)

; If monster(labyrinth(spieler(akt_spieler) \character_x + spell_x, spieler(akt_spieler) \character_y + spell_y) \objekt) \art = 1
PUSH ebp
MOVSX ebx,byte [v_akt_spieler]
MOV ebp,dword [a_spieler]
IMUL ebx,98
ADD ebp,ebx
MOVSX edi,word [ebp+94]
MOVSX eax,word [v_spell_x]
ADD edi,eax
MOV edx,[a_labyrinth+4]
IMUL edx,edi
POP ebp
MOV ebp,edx
PUSH ebp
MOVSX esi,byte [v_akt_spieler]
MOV ebp,dword [a_spieler]
IMUL esi,98
ADD ebp,esi
MOVSX edi,word [ebp+96]
MOVSX eax,word [v_spell_y]
ADD edi,eax
MOV eax,edi
POP ebp
ADD ebp,eax
IMUL ebp,6
ADD ebp,dword [a_labyrinth]
MOVSX dword [PB_StringBase],word [ebp+4] <-------
MOV ebp,dword [a_monster]
IMUL dword [PB_StringBase],27
ADD ebp,dword [PB_StringBase]
MOVSX dword [PB_StringBase],byte [ebp+10]
CMP dword [PB_StringBase],1
JNE _EndIf2792
[/b]
User avatar
Brujah
Enthusiast
Enthusiast
Posts: 237
Joined: Mon Nov 03, 2003 7:45 pm
Location: Germany
Contact:

Post by Brujah »

That was the problem. Its running perfectely now!

And it runs faster than ever...

No idea if its because of Kernel 2.6 or the new 3.91 compiler. But I am very happy now!

Thanx for the hint with the .asm file. I can find most bugs myself now!
Post Reply