flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > Can't see error in struct definition.

Author
Thread Post new topic Reply to topic
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt 11 Aug 2005, 15:07
I keep getting an "extra characters on line error" error with the structure below and cannot tell where the error is? Can anyone help?

all of the errors are in the struct macro, line numbers 60, 80, 88

Code:
struct FMODDSPDESCRIPTION
       name db 32 dup(0)
       version dd 0
       channels dd 0
       create dd 0
       release dd 0
       reset dd 0
       read dd 0
       setposition dd 0
       numparameters dd 0
       paramdesc dd 0
       setparameter dd 0
       getparameter dd 0
       config dd 0
       configwidth dd 0
       configheight dd 0
       userdata dd 0
ends
    
Post 11 Aug 2005, 15:07
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8356
Location: Kraków, Poland
Tomasz Grysztar 11 Aug 2005, 15:13
The "version" is a macroinstruction (one of the resource ones) and thus line "version dd 0" is interpreted as macro. (Hmmm, maybe I should rename this macro to "versioninfo"?)
Post 11 Aug 2005, 15:13
View user's profile Send private message Visit poster's website Reply with quote
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt 11 Aug 2005, 15:57
ok, I see now, thanks. But now have another problem, the .if macro doesn't except the "jl" instruction, example:

.if dword [eax + lnx.x], l, 1

gives me an illegal instruction error
Post 11 Aug 2005, 15:57
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8356
Location: Kraków, Poland
Tomasz Grysztar 11 Aug 2005, 16:02
Works for me, perhaps you've got another conflict?

PS. Changed that macro to "versioninfo" - more descriptive, less conflicting.
Post 11 Aug 2005, 16:02
View user's profile Send private message Visit poster's website Reply with quote
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt 11 Aug 2005, 17:27
ok thanks, I have another look at my code and see.
Post 11 Aug 2005, 17:27
View user's profile Send private message Reply with quote
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt 11 Aug 2005, 17:31
I've tried the code with different parameters for the .if macro: a, b, ae, be, g, ge, le, all work ok except l (the letter "L" 'l') Question
Post 11 Aug 2005, 17:31
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8356
Location: Kraków, Poland
Tomasz Grysztar 11 Aug 2005, 17:44
Post some minimum source that shows the problem.
Post 11 Aug 2005, 17:44
View user's profile Send private message Visit poster's website Reply with quote
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt 11 Aug 2005, 19:24
The struct:
Code:
struct IntersectPoints
       x dd 0
       y dd 0
       dx dd 0
       dy dd 0
ends
    


struct definition:
Code:
  lnx IntersectPoints
      times 60 * sizeof.IntersectPoints db 0
    


code block giving me the illegal instruction error
Code:
     .repeat
             mov     eax, sizeof.IntersectPoints
             mul     [l]
             mov     [addr], eax
             
             .if     dword [eax + lnx.x], l, 1 ;<------ ** HERE **>
                     invoke  RndInt32Range, 0, 3
                     add     eax, 2
                     mov     ecx, [addr]
                     mov     dword [ecx + lnx.dx], eax
             .endif

             mov     eax, [addr]
             .if     dword [eax + lnx.y], l, 1
                     invoke  RndInt32Range, 0, 3
                     add     eax, 2
                     mov     ecx, [addr]
                     mov     dword [ecx + lnx.dy], eax
             .endif

             mov     eax, [addr]
             .if     dword [eax +lnx.x], g, SCREENWIDTH-2
                     invoke RndInt32Range, 0, 3
                     add    eax, 2
                     neg    eax
                     mov    ecx, [addr]
                     mov    dword [ecx + lnx.dx], eax
             .endif

             mov     eax, [addr]
             .if     dword [eax + lnx.y], g, SCREENHEIGHT-2
                     invoke RndInt32Range, 0, 3
                     add    eax, 2
                     mov    ecx, [addr]
                     mov    dword [ecx + lnx.dy], eax
             .endif

             mov     ecx, [addr]
             mov     eax, [ecx + lnx.x]
             add     eax, [ecx + lnx.dx]
             mov     [ecx + lnx.x], eax

             mov     eax, [ecx + lnx.y]
             add     eax, [ecx + lnx.dy]
             mov     [ecx + lnx.y], eax
             inc     [l]
     .until  [l], a, 5
    
Post 11 Aug 2005, 19:24
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8356
Location: Kraków, Poland
Tomasz Grysztar 11 Aug 2005, 19:35
I guess you are using local variable of the name "l", thus "l" inside the procedure gets replaced with the address of that variable. Possible solution: use other case to avoid conflict:
Code:
.if     dword [eax], L, 1    
Post 11 Aug 2005, 19:35
View user's profile Send private message Visit poster's website Reply with quote
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt 11 Aug 2005, 20:57
Yeh, that's right, DOOOOOH! Embarassed , thanks for pointing that out, now it compiles right.
Thanks for all your help Tomasz!
MadMatt
Post 11 Aug 2005, 20:57
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.