flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
LocoDelAssembly
I'm not sure why the error is detected so late that it ends catched up by something unrelated, it seems that there has to be at least one valid data instruction for it to work properly. The problem is that you used "DD" instead of "dd" inside struct. If you change only one of those DDs to dd, you'll see an error message coming from "ends".
Probably this needs fixing, so I'm moving it to Compilers Internals (it is not an error with fasm itself though, only the struct macro is wrong). |
|||
![]() |
|
bitshifter
I think you would have to extend macro to accept uppercase also...
INCLUDE\MACRO\STRUCT.INC Code: ... struc dd [val] \{ \common define field@struct .,dd,<val> fields@struct equ fields@struct,field@struct \} struc DD [val] \{ \common define field@struct .,dd,<val> fields@struct equ fields@struct,field@struct \} ... I am not sure if this is the correct way to fix it though? |
|||
![]() |
|
LocoDelAssembly
bitshifter,
I think it is a good idea to have all possible combinations (dd, dD, Dd and DD), but that wouldn't fix the problem, the following code is not triggering the error at ends: Code: include 'win32ax.inc' struct TST xor eax, eax ends Code: include 'win32ax.inc' struct TST field db ? ; Only difference with previous code. xor eax, eax ends |
|||
![]() |
|
bitshifter
But that is trying to break it...
I think instructions should not be allowed in struct. But for OOP you should be able to define function pointers... Code: include 'win32ax.inc' struct TST field db ? pfn dd do_stuff ends section '.code' code readable executable do_stuff: xor eax,eax section '.data' data readable writeable tstInstance TST |
|||
![]() |
|
LocoDelAssembly
Quote:
I completely agree with that, and that is the reason for what I want the error to be ALWAYS detected, not only when at least one field definition was valid. My second code fails with an error message generated by "ends" macro saying "Error: definition of TST contains illegal instructions.", I want that error to appear in my first code too, but currently it doesn't. |
|||
![]() |
|
Tomasz Grysztar
LocoDelAssembly wrote: [My second code fails with an error message generated by "ends" macro saying "Error: definition of TST contains illegal instructions.", I want that error to appear in my first code too, but currently it doesn't. |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.