flat assembler
Message board for the users of flat assembler.
Index
> Programming Language Design > Separating entities fasm assembler & fasm assambly language |
Author |
|
DimonSoft 17 Oct 2018, 08:46
ProMiNick wrote: At what stage comments removed and lines combined? at begining of preprocessor stage? FASM.pdf wrote: 2.3 Preprocessor directives I doubt lines are ever combined. ProMiNick wrote: Still stages goes in order preprocessor,parser,assembler,formatter - is it mean preprocessor operate on completely untokenized raw text? or some tokenization will happen (preprocessor syntax)? The syntax of preprocessor and the way parameters are passed implies that tokenization is done before performing any preprocessing. After all, the preprocessor has to recognize macro, struc, <…, …, …> sequences, etc. ProMiNick wrote: Nul symbol because it marks end of text file (and sources are just text files)? There’s no mark for end of file in any modern widely used file system (FAT, NTFS). And text files are not special and have no real differences from other files. |
|||
17 Oct 2018, 08:46 |
|
ProMiNick 17 Oct 2018, 09:02
If tokenization is done at start of preprocessing. What for parser stage? different level of validation or what?
|
|||
17 Oct 2018, 09:02 |
|
DimonSoft 17 Oct 2018, 21:33
ProMiNick wrote: If tokenization is done at start of preprocessing. What for parser stage? different level of validation or what? FASM itself has quite complex syntax. You might have seen a “program” I’ve posted recently without a single assembly instruction. I’ve never dived deep into the source but it seems that’s what that file is for. Well, generally tokenization is considered to be the task for lexical analysis which is the first stage of a translator. Parsing is syntax analysis which is the second stage, so nothing wrong here. |
|||
17 Oct 2018, 21:33 |
|
Tomasz Grysztar 18 Oct 2018, 14:45
ProMiNick wrote: fasm assembly language deserve its own page not mixed with fasm assembler. I would say that in case of fasm 1 separation of these concepts is not perfect. As fasm 1 evolved, some features have been influenced by the limitations of the implementation. Also, fasm 1 actually contains two distinct languages, one for the preprocessor and one for the assembler. They are very different, though they also affected each other's implementation. In case of fasmg the distinction is much more clear, because the language of fasmg was designed before any implementation was even attempted, so it is a fully separate entity. Therefore it might be possible to implement the same language in different ways (I had been considering some other approaches that could in theory be more efficient while implementing the same language in a fully compatible way) and it makes sense to discuss the language of fasmg separately from implementation. On the other hand, nowadays any new features in fasm 1 tend to be back-ported from fasmg, so the implementation details of fasm 1 architecture also no longer affect them. ProMiNick wrote: At what stage comments removed and lines combined? at begining of preprocessor stage? ProMiNick wrote: Still stages goes in order preprocessor,parser,assembler,formatter - is it mean preprocessor operate on completely untokenized raw text? or some tokenization will happen (preprocessor syntax)? ProMiNick wrote: What validates done in parser stage? order, existance of meaning? |
|||
18 Oct 2018, 14:45 |
|
ProMiNick 22 Oct 2018, 15:07
there so many exceptions from main rules in fasm (just like in russian language).
before today I thought that only label: instruction(or label: macro) can be mixed to one line. But today I found smthng that completely breaks paradigm 1 line - 1 instruction Code: macro u[0] { db 1} macro ... [_""] { dd 5} struc o val { .field dd val } name equ 5 u[0] u ...[_""] n o name is it could be fixed? what I want: rule that disallows preprocessor definitions after symbol "}" - so only using of smthing already defined or assembler instruction would be allowed. Last edited by ProMiNick on 23 Oct 2018, 09:29; edited 3 times in total |
|||
22 Oct 2018, 15:07 |
|
Tomasz Grysztar 22 Oct 2018, 15:25
This is the feature of preprocessor's language that was introduced deliberately, it has some uses when combined with FIX definitions.
Note that "label: instruction" is the syntax of the assembly language - that is the language of assembler module. As noted above, preprocessor is a different language on top of that. In addition to that, ignoring the preprocessor, note that fasm's variant of assembly language (as implemented by fasmg also) actually allows "label1: label2: ... labelN: instruction" syntax. |
|||
22 Oct 2018, 15:25 |
|
ProMiNick 23 Oct 2018, 13:32
Let suppose one could make multiline comment in source text. How? He is just add symbol with code 0 to src text and make comment after it. In compilation process everithing in file after symbol 0 is stripped out, like stripped out everything between symbol ; and CR symbol.
could fasmw IDE be teached to display in editor content after 0 symbol (determine it as CRLF) and highlight it in comment color? Is src remain text file? if we resave it with any text editor - it became text with stripped unsufficient comment. So it is stayed text except only one binary byte placed in it. It could be nice ability - and it was requested some time ago (place something in code to mark code end - symbol with ASCII code 0 is best for it), it is impoossible to place it from keyboard so additional button will needed in IDE. Second question related not to IDE but to fasm internals. if symbol 0 disallowed, could it be used insted of $1a to mark a symbol that not a symbol character and not a quoted string. As tokenized line end could be used pair of 00 00. Or for determining token as quoted string internaly used only one of quotes, second remain untouched, so it could be used insted of $1a. And for marking tokenized line end just one 0 left. If to do so all 256 symbols will be allowed for use in fasm src texts. |
|||
23 Oct 2018, 13:32 |
|
DimonSoft 23 Oct 2018, 16:48
ProMiNick wrote: It could be nice ability - and it was requested some time ago (place something in code to mark code end - symbol with ASCII code 0 is best for it), it is impoossible to place it from keyboard so additional button will needed in IDE. So, it’s a feature that is difficult to use and that takes C-style null-terminated strings to a new level of crazyness. How many people would use it? Do you expect all software to deal with such files without removing the last part? What are the valid use cases for that? Do they make this feature score enough points if it, as any other feature, starts with –100 points? Is it worth future support? Most non-printable characters are supported badly or not supported at all by most software, except for a few ones like horizontal TAB (#9), New line (#10) and Carriage return (#13). FASM doesn’t exist in its own universe, it has to interoperate with other software. Tricks with #$1A seem to be funny until they’re implemented and people start complaining about other editors being unable to preserve large pieces of code. |
|||
23 Oct 2018, 16:48 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.