flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > stop compile directive

Author
Thread Post new topic Reply to topic
decard



Joined: 11 Sep 2003
Posts: 1092
Location: Poland
decard 25 Sep 2004, 10:31
I think it was proposed sometime ago...
What about adding some directive that will stop compilation process? For sure it would be more elegant solution than using some invalid opcode that will generate an error.
Question
Post 25 Sep 2004, 10:31
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8351
Location: Kraków, Poland
Tomasz Grysztar 25 Sep 2004, 11:59
On the other hand, that would mean another reserved word.
Post 25 Sep 2004, 11:59
View user's profile Send private message Visit poster's website Reply with quote
decard



Joined: 11 Sep 2003
Posts: 1092
Location: Poland
decard 25 Sep 2004, 13:02
Proably it wouldn't be last reserved word added...
Post 25 Sep 2004, 13:02
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 27 Sep 2004, 19:28
yes, such thing would be really useful. Having some invalid instruction looks weird, and i have to use also "display" to describe error, and sometimes (bad choice of illegal instruction) error doesn't occur in assembly time etc. etc. Something like "break", no one gives such general name to a label.
Post 27 Sep 2004, 19:28
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
crc



Joined: 21 Jun 2003
Posts: 637
Location: Penndel, PA [USA]
crc 27 Sep 2004, 19:45
Quote:
no one gives such general name to a label.


I use general names (including break) as labels sometimes. Smile
Post 27 Sep 2004, 19:45
View user's profile Send private message Visit poster's website Reply with quote
S.T.A.S.



Joined: 09 Jan 2004
Posts: 173
Location: Ru#27
S.T.A.S. 28 Sep 2004, 08:06
Why illegal opcodes?

Code:
"break: compilation stopped for some reason."
    
Post 28 Sep 2004, 08:06
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 28 Sep 2004, 19:48
nice solution. will it be displayed in error message (linr that caused error)?
Post 28 Sep 2004, 19:48
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Matrix



Joined: 04 Sep 2004
Posts: 1166
Location: Overflow
Matrix 28 Sep 2004, 22:23
Hy kids Smile
oh come on, be creative,
you can do better than that

here's an example:

Code:
org 256
ACFDC647836325234DCEFAB:
in al,$60
dec al
jnz ACFDC647836325234DCEFAB
    


another example:

Code:
org 256
zdezDHeresLekCsiGaHellMicrosoftSuckGarbageFreakLABEL:
in al,$60
dec al
jnz zdezDHeresLekCsiGaHellMicrosoftSuckGarbageFreakLABEL
    



this is becoming real in windos programming:

Code:

invoke PutD3dShadedObjectRenderedIntoSecondZBufferThenFlippedTwiceXYZTHETA , objectoffset, objecttype, renderingattributes_array_offset, SecondZbuffer_offset, SecondZbufferDepth, X_position, Y_position, Theta1, Theta2, Theta3, Flip_attribute_context_buffer_offset

and lol
    


this way you might not get reserved collitions

MATRIX
Post 28 Sep 2004, 22:23
View user's profile Send private message Visit poster's website Reply with quote
S.T.A.S.



Joined: 09 Jan 2004
Posts: 173
Location: Ru#27
S.T.A.S. 29 Sep 2004, 06:28
vid wrote:
will it be displayed in error message (line that caused error)?
Yes, you'll see a line number with full description in quotes (provided by you, of course).
I someties use symbols like ! or ? before the string - in this case it's possible to prevent the compilation breaking with the help of macros like
Code:
macro ?[x]{}    



And most important thing IMHO: sometimes it's needed do stop compilation not in the first pass, but later. It coud be done with tricky 'if' clause, but I guess this won't work with 'stop compile' directive.
Post 29 Sep 2004, 06:28
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 29 Sep 2004, 07:29
S.T.A.S. wrote:
Yes, you'll see a line number with full description in quotes (provided by you, of course).


And you will see also the message: "Error: Illegal instruction" actually only the fact that FASM displays the text of the line where error occurs give you the option to use this trick.
IMHO, FASM needs directive for stoping compilation and defining user error messages. My suggestion is:
Code:
break "user error message", "second string", ...    
- syntax just like "display" directive.
Actually I never checked whether it is possible, but if it is, IMHO it is a must.

Regards.
Post 29 Sep 2004, 07:29
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
crc



Joined: 21 Jun 2003
Posts: 637
Location: Penndel, PA [USA]
crc 29 Sep 2004, 11:08
Quote:
oh come on, be creative,
you can do better than that


I try to keep names short and descriptive. Of course, being limited to letters and numbers prevents some good names, but I can live with that. I do have a tendency to use names like print, number and so on though Smile
Post 29 Sep 2004, 11:08
View user's profile Send private message Visit poster's website Reply with quote
S.T.A.S.



Joined: 09 Jan 2004
Posts: 173
Location: Ru#27
S.T.A.S. 29 Sep 2004, 13:07
JohnFound wrote:
And you will see also the message: "Error: Illegal instruction"
Yes, this is very important message for external IDEs: they parse FASM's output to search line number.
Of cource, this doesn't matter if IDE has FASM built-in Smile
Anyway, I suppose, there'll be something like 'Error: Fatal assembler directive' message Very Happy

Well, such (preprocessor stage) directive is common for C compilers and some other assemblers, but all of them have conditional preprocessing capabilities. In contrast to them FASM process conditional directives at assembly stage, and it is a multipass assembler.
I'm just afraid, this directive will be implimented, but probably unhandy in some cases.
Post 29 Sep 2004, 13:07
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 29 Sep 2004, 13:54
Quote:
Anyway, I suppose, there'll be something like 'Error: Fatal assembler directive' message Very Happy


IMHO, no. There should be: "Error:" + "whatever message you wrote in the quotes".
Post 29 Sep 2004, 13:54
View user's profile Send private message Visit poster's website ICQ Number 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.