flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
Tomasz Grysztar
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"?)
|
|||
![]() |
|
madmatt
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 |
|||
![]() |
|
Tomasz Grysztar
Works for me, perhaps you've got another conflict?
PS. Changed that macro to "versioninfo" - more descriptive, less conflicting. |
|||
![]() |
|
madmatt
ok thanks, I have another look at my code and see.
|
|||
![]() |
|
madmatt
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')
![]() |
|||
![]() |
|
Tomasz Grysztar
Post some minimum source that shows the problem.
|
|||
![]() |
|
madmatt
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 |
|||
![]() |
|
Tomasz Grysztar
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 |
|||
![]() |
|
madmatt
Yeh, that's right, DOOOOOH!
![]() Thanks for all your help Tomasz! MadMatt |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.