flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > Can't see error in struct definition. |
Author |
|
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"?)
|
|||
11 Aug 2005, 15:13 |
|
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 |
|||
11 Aug 2005, 15:57 |
|
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. |
|||
11 Aug 2005, 16:02 |
|
madmatt 11 Aug 2005, 17:27
ok thanks, I have another look at my code and see.
|
|||
11 Aug 2005, 17:27 |
|
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')
|
|||
11 Aug 2005, 17:31 |
|
Tomasz Grysztar 11 Aug 2005, 17:44
Post some minimum source that shows the problem.
|
|||
11 Aug 2005, 17:44 |
|
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 |
|||
11 Aug 2005, 19:24 |
|
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 |
|||
11 Aug 2005, 19:35 |
|
madmatt 11 Aug 2005, 20:57
Yeh, that's right, DOOOOOH! , thanks for pointing that out, now it compiles right.
Thanks for all your help Tomasz! MadMatt |
|||
11 Aug 2005, 20:57 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.