flat assembler
Message board for the users of flat assembler.
Index
> Compiler Internals > suggestion /*Comments*/ (final rev.8 - over for me) Goto page Previous 1, 2, 3, 4, 5, 6, 7, 8 Next |
Author |
|
baldr 12 Mar 2010, 22:11
ouadji,
Looks like you're as crazy as I am. That should be marvelous at least. BTW, "release" means something complete, maybe "revision"? "Version" will fit the bill too. |
|||
12 Mar 2010, 22:11 |
|
ouadji 12 Mar 2010, 22:52
Quote:
Code: /*init!!!()! db 0,\ !(comment)!/*init!!/**//*comment*/ 1,/*init!!{==}{=com ment=}2,/*idle!!3,4/*idle!!/*init!!§--§§-com ment-§,5 flat assembler version 1.69.12 (multiline comment) 5 passes, 0.2 seconds i like it ! |
|||
12 Mar 2010, 22:52 |
|
revolution 13 Mar 2010, 01:12
ouadji wrote:
|
|||
13 Mar 2010, 01:12 |
|
Coddy41 13 Mar 2010, 01:47
revolution wrote: And this is supposed to be more readable? Only to those whom want to believe it is more readable... I am not one of them. _________________ Want hosting for free for your asm project? You can PM me. (*.fasm4u.net) |
|||
13 Mar 2010, 01:47 |
|
ouadji 13 Mar 2010, 03:24
Quote: And this is supposed to be more readable? it's just for the fun revolution. ,nothing else. like we say in french :"who can do more, can do less" but you can do this too : Code: db 0,\ (! comment only for revolution !) 1 just a sample to show the power of engine, like macros. |
|||
13 Mar 2010, 03:24 |
|
baldr 13 Mar 2010, 06:25
ouadji wrote:
Code: db 0,\ (! 1,\ 2,\ !) 3 db 0,\ (! 1,\ 2,\ !) 3 |
|||
13 Mar 2010, 06:25 |
|
ouadji 13 Mar 2010, 08:29
hi baldr, I think I don't understand fully the meaning of your message. 1) this below, does compile without problem; Code: /*init!!(!!) A -- db 0,\ (! 1,\ 2,\ !) 3 ; the result is : db 0,\ 3 ;------------------------------------------- B -- db 0,\ (! 1,\ 2,\ !) 3 ; same result too. db 0,\ 3 in both cases (above), and in any cases, line numbers are preserved. Quote:
a) stream comment should be like "can be placed anywhere space is allowed and behave as single space (line numbers are preserved)". no, but : Can be placed anywhere (and nothing else), and behave as "nothing" ... like "ghost comment". And obviously, the line numbering is preserved in all cases. Quote:
hummm, here, i don't quite understand. like this ? Code: db 0,\ (! 1,\ 2,\ !) "666,\" ;no problem with this, compilation ok ;or this (?) : dd 0,\ (! 1,\ 2,\ !) 666,\ 667 ;compilation ok too baldr, Give me an example about what you think (about "666") thank you. PS : but why exactly "666" ? ... about 2012 ? is there a hidden message in this number ? |
|||
13 Mar 2010, 08:29 |
|
baldr 13 Mar 2010, 11:18
ouadji wrote: Can be placed anywhere (and nothing else), and behave as "nothing" ... like "ghost comment". As to that 666 thingy (nothing special, I just punched random key on numpad thrice ): Code: ; For the following to compile db 0,\ (! !) 1 ; it should be equivalent to db 0,\ \ \ 1 ; Am I right? If so, consider db 0,\ (! !) 666,\ 1 ; How it should be interpreted? |
|||
13 Mar 2010, 11:18 |
|
ouadji 13 Mar 2010, 11:46
a) a/**/b,c == ab,c (ghost comment) mov/*comment*/eax,ebx == moveax,ebx mov/*comment*/ eax,ebx == mov eax,ebx b) Code: db 0,\ (! !) 1 ; it should be equivalent to db 0,\ \ \ 1 but, it's just a virtual view look below : Code: db 0,\ \ \ 1 nop <--- line n°x OR, db 0,\ ;ghost line with ghost "\" ;ghost line with ghost "\" 1 nop <------- line n°x too it's the same thing. in fact, I just explained exactly the same as you by other way. Code: db 0,\ (! !) 666,\ 1 == dw 0,\ \ 666,\ 1 ;dw or dd, not db. comment == a) ghost comment b) + if need, ghost line (ghost "\") to preserve line numbering. c) backslash effect, jumps over comment. |
|||
13 Mar 2010, 11:46 |
|
baldr 13 Mar 2010, 12:30
ouadji,
Ability to splice two adjacent non-symbol sequences together still looks suspicious. How often do you need to place comment inside symbolic name/mnemonic/numeric constant? d/*efine*/b/*yte*/? I'm eager to get your next revision in my hands. |
|||
13 Mar 2010, 12:30 |
|
ouadji 13 Mar 2010, 14:59
Quote:
if they are contiguous, they remain contiguous after too. But if they are not, they are not after either ! Code: abcd ab/*v*/cd == abcd ;no changes ab cd ab/*v*/ cd or ab /*v*/cd == ab cd ;no changes ;comment make no changes. Code: d/*efine*/b/*yte*/ 0 ;does compile. (== db 0) d/*efine*/b/*yte*/0 ;does NOT compile (== db0) Yes, I know ... it makes no sense to allow that. This is the result of "ghost_engine" ... too permissive. I think I'm going to prohibit this possibility. But it is easier to allow it, than to remove it. Delete this possibility, in fact, it's create a "engine exception". I'll think about it ! Quote: I'm eager to get your next revision in my hands |
|||
13 Mar 2010, 14:59 |
|
ouadji 13 Mar 2010, 17:25
That said, I don't see the interest, nor the sense to remove this possibility. "We must know what we want". If we want a flexible engine which allows to place comments wherever we want ... it's clear, in this case, this will allow the engine to go too far. To avoid cases that have no meaning or usefulness, It should then analyze the meaning of the text, the semantics around the comment. This would need an artificial intelligence engine. The possibility of placing a comment in a symbolic name, obviously, makes no sense. But it's the user not to use it. Like, lea eax, [eax] .. allowed by the compiler, but it has no real meaning. Also with macro language .. there are a lot of ways to write a lot of things allowed, but that have meaningless. Dialectic and Semantic are two very different things. (sorry for English, I tried to do my best) Last edited by ouadji on 13 Mar 2010, 23:41; edited 1 time in total |
|||
13 Mar 2010, 17:25 |
|
ouadji 13 Mar 2010, 18:11
Code: /*init!!;\\; db 0,\;\ ;== db 0,3 1,2,\; 3 1 passes, 2 bytes /*idle!! db 0,\;\ ;== db 0,1,2,3 1,2,\; 3 1 passes, 4 bytes just the last for fun, absolutely useless, but I find it very funny. |
|||
13 Mar 2010, 18:11 |
|
ouadji 14 Mar 2010, 16:56
Code: ;Ouadji - Multiline Comments for FASM - revision 6 ;------------------------------------------------------------ ;words control : /*idle!! - /*init!!abcd ;------------------------------------------------------------ ;3 Call from PREPROCE.INC (see attached files) ;------------------------------------------------------------ Multiline_Core: cmp al,"\" je .main cmp al,byte [@S_] je .presumed cmp al,"/" je .presumed ret .presumed: dec esi push ebx mov bx,[@S_] cmp word [esi],bx pop ebx je .main cmp word [esi],"/*" je .main inc esi ret ;---------------------------------------------------------- .main: pushad mov dl,al xor edi,edi xor ebp,ebp Engine: call Search_to_the_right jc .wayout call Search_absolute_end_comment jz \ Engine ;---------------------------------------------------------- .wayout: add [esp+24h],edi ;<---line numbering mov [esp+04h],esi ;<---hide comments or ebp,ebp jnz .backgate popad .final: cmp al,"\" je .done mov [esp],eax mov eax,[back_] xchg eax,[esp] ret .done: mov byte[esi-1],al ret .backgate: cmp ebp,1 popad je .final dec esi cmp al,byte[@S_] je .final dec esi ret ;==================================================== Search_to_the_right: cmp ebp,2 je .failed xor ebp,ebp mov ecx,100h mov ebx,-1 .loop_scan: lods byte [esi] call Prohibited jnc .abortChar cmp al,20h je .nextScan cmp al,09h je .nextScan push eax mov ax,[@S_] cmp word [esi-1],ax pop eax je .found cmp word [esi-1],"/*" je .found call CRLF_ jc .firstTwo cmp al,";" jne .abortChar .fasm: lods byte [esi] call Prohibited jnc .abortChar call CRLF_ jnc .fasm .firstTwo: inc ebx .nextScan: loopz .loop_scan jz out_error ;---------------------------------------------------------- .two_crlf: sub edi,2 ;"edx" always >=2! sub esi,4 mov word [esi],0A0Dh stc ret .abortChar: dec esi or edi,edi je .failed dec edi sub esi,2 mov word [esi],0A0Dh .failed: stc ret .found: inc esi ;cy=0 from "je" ret ;==================================================== Search_absolute_end_comment: call AccessRight jc .done mov ecx,1 mov ebx,20000h .loopScan: lods byte [esi] call Prohibited jnc out_error call CRLF_ jc .gonext call Nestings jecxz .done ;end_comment found! .gonext: sub ebx,1 jnc .loopScan jmp out_error .done: cmp dl,"\" ret ;==================================================== Nestings: push edx movzx eax,word[esi-1] mov edx,+1 cmp ax,[@S_] je .core neg edx cmp ax,[@E_] je .core pop edx ret .core: add esi,2 shl eax,8 or eax,22000022h cmp dword[esi-4],eax je .quoted xor eax,("'..'" xor '".."') ;(")<=>(') cmp dword[esi-4],eax je .quoted add ecx,edx dec esi .quoted: pop edx ret ;==================================================== CRLF_: cmp al,0Dh je .next cmp al,0Ah je .next clc ret .next: xor al,(0Ah xor 0Dh) cmp al,byte [esi] jne .done inc esi .done: inc edi stc ret ;==================================================== AccessRight: cmp byte [esi],"i" je .confirm .noCode: cmp [Gate],0 jne .back .open: mov ax,[@S_] cmp word [esi-2],ax jne .back xor ebp,ebp ret ;nocy! (xor=clc) .back: mov ebp,2 stc ret .confirm: push esi mov ecx,6+4 .validate: lods byte [esi] call Prohibited jnc @F loop .validate @@: pop esi jnc .noCode ;ok=cy,Bad=nocy call IDLE_Code jc .done call INIT_Code jc .done ;(call .mynextcode) jnc .noCode .done: ret ;==================================================== IDLE_Code: cmp dword [esi-2],'/*id' jne .done cmp dword [esi+2],'le!!' jne .done .idleCore: add esi,6 not [Gate] ;open<=>close gate mov ebp,1 stc ret .done: clc ;ok=cy(+ebp),Bad=nocy ret ;==================================================== INIT_Code: cmp dword [esi-2],'/*in' jne .done cmp dword [esi+2],'it!!' jne .done .initCore: add esi,10 mov eax, [esi-4] ;new start/stop mov [@SE_],eax mov ebp,1 stc ret .done: clc ;ok=cy(+ebp),Bad=nocy ret ;==================================================== Prohibited: cmp al,1Ah je .done or al,al jz .done stc .done: ret ;cy=0 from .done (je,jz) ;==================================================== out_error: popad mov dword [esp],Error_message_1 jmp assembler_error Error_message_1 db 'error multiline comments',0 ;==================================================== Last edited by ouadji on 21 Sep 2010, 20:30; edited 3 times in total |
|||
14 Mar 2010, 16:56 |
|
revolution 14 Mar 2010, 17:03
What will happen here:
Code: /*init!! mov eax,ebx nop or here: Code: /*init!!mo mov eax,ebx nop |
|||
14 Mar 2010, 17:03 |
|
ouadji 14 Mar 2010, 17:20
These are control words.
These words belong to a "syntax". This syntax must be respected. Being able to follow a syntax, is also the beginning of the learning of programming What will happen here ? Code: a) format MS COFFmo b) format MS c) mov eax, mo d) mov eax, |
|||
14 Mar 2010, 17:20 |
|
revolution 14 Mar 2010, 17:21
So does your code detect an error or does it carry on through and make a mess of things?
|
|||
14 Mar 2010, 17:21 |
|
ouadji 14 Mar 2010, 17:29
correct ! good idea for improvement, thank you. this will be done in Version 7 |
|||
14 Mar 2010, 17:29 |
|
ouadji 15 Mar 2010, 01:10
revision 7 in progress in normal use, the sequence "§--§" is allowed. Here, it's only to check syntax engine. if the sequence contains special characters (CR, LF ... or other) in this case, the error message replaces these characters not viewable by question marks. Code: //init!!§ <--- CRLF --§ / * i n i t ! ! : invalid sequence : §??- ;§(CR)(LF)--§ also this, Now the syntax requires that the start sequence and the end sequence are identical, but reversed. If you have any suggestions and ideas about this, tell me. thank you. |
|||
15 Mar 2010, 01:10 |
|
Goto page Previous 1, 2, 3, 4, 5, 6, 7, 8 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.