Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
mov eax, st(0) - :)
#1
greets,

tried to do a simple little prog, fb goes crazy and outputs this

D:\projects\pointinpoly>fbc -r pipcoll.bas
pipcoll.asm: Assembler messages:
pipcoll.asm:56: Error: suffix or operands invalid for `mov'
pipcoll.asm:69: Error: suffix or operands invalid for `mov'

seems like reg allocation is farked up cause the thing tries mov eax, st(0). i used the 0.13 cvs version so i guess this has already been fixed right?

EDIT: just tried it with official 0.12 beta same result. problem is in matrixIdentity.

here's the source

Code:
option explicit

type Vertex2D
    x as single
    y as single
end type

type Matrix
    m( 0 to 2, 0 to 2 ) as single
end type

sub matrixIdentity ( mat as Matrix )

dim row as integer
dim col as integer

    for row = 0 to 2
        for col = 0 to 2
            if( row = col ) then
                mat.m( row, col ) = 1.0
            else
                mat.m( row, col ) = 0.0
            end if
        next col
    next row
    
end sub

sub matrixTranslation ( mat as Matrix, x as single, y as single )
  
   matrixIdentity ( mat )
   mat.m( 0, 2 ) = x
   mat.m( 1, 2 ) = y
  
end sub

sub matrixMultiVert2d ( mat as Matrix, vec as Vertex2D, outvec as Vertex2D )

    outvec.x = vec.x * mat.m( 0, 0 ) + vec.y * mat.m( 0, 1 ) + mat.m( 0, 2 )
    outvec.y = vec.x * mat.m( 1, 0 ) + vec.y * mat.m( 1, 1 ) + mat.m( 1, 2 )

end sub



screen 13


dim mat as Matrix
dim vec as Vertex2D
dim outvec as Vertex2D

matrixTranslation ( mat, 160, 100 )
vec.x = 0: vec.y = 0

matrixMultiVert2d( mat, vec, outvec )

pset( outvec.x, outvec.y ) , 4

have fun
quote="NecrosIhsan"]
[Image: yagl1.png]
[/quote]
Reply
#2
It's within these two commands:

Code:
if( row = col ) then
            mat.m( row, col ) = 1.0
         else
            mat.m( row, col ) = 0.0
         end if

if you comment out the mat.m()= lines then it will compile.

Maybe its not being passed to the sub properly?
ature has its way of warning a person away from danger: The distinct black and white coloration on a skunk, the chilling buzz of a rattlesanke, a redneck handing you his beer and saying "Watch this!"
Reply
#3
Fixed, i hate byref args, no wonder no other language got those (okay, PASCAL has them too, screw it).

Problem was at parser3 (1 single line), it will take a while to SF update the CVS tho.. problem would only happen with field arrays of different classes than integer, on UDT args passed by reference.
Reply
#4
eeks strange that never happened before...
quote="NecrosIhsan"]
[Image: yagl1.png]
[/quote]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)