flat assembler
Message board for the users of flat assembler.

Index > IDE Development > flat editor 3.11

Goto page Previous  1, 2
Author
Thread Post new topic Reply to topic
r88



Joined: 26 Feb 2016
Posts: 2
r88 04 May 2016, 03:28
Update for fasmw source, VERSION 0.95.11 (fasm 1.71.06). Add toolbar and tooltips. I 'm using other IDE and this code is for learning.

last changes
; mov [tbab.hInst], NULL
; mov [tbab.nID], 0 ;hTbBmp
; invoke ImageList_GetImageCount, [hImageList] ; here =0 or ...
; mov ecx, eax
; invoke SendMessage,[hToolBar],TB_ADDBITMAP,ecx, tbab

section '.rsrc' resource data readable

directory RT_MENU,menus,\
;...
RT_MANIFEST, _manifest

;...
resource _manifest,1,LANG_NEUTRAL,manifest
resdata manifest
file 'RESOURCE\manifest.txt'
;db '<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <dependency> <dependentAssembly> <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="X86" publicKeyToken="6595b64144ccf1df" language="*"/> </dependentAssembly> </dependency> </assembly>'
endres

he he Smile


Description: Update for fasmw source, VERSION 0.95.11
Download
Filename: upd_FASMW.rar
Filesize: 27.06 KB
Downloaded: 1094 Time(s)

Post 04 May 2016, 03:28
View user's profile Send private message Reply with quote
poby1



Joined: 16 Aug 2016
Posts: 2
poby1 26 Aug 2016, 06:41
I have tried a bunch of editors and they all pretty much suck. I used fresh for a while but the lack of a redo was just doing my head in. I absolutely need redo functionality! Also fresh has no simple ctrl-A to select all. But it does have a lot of features I don't need

Flat editor is damn near perfect. It just need syntax coloring and maybe a recent file list to open from and I would be in heaven. It isn't burdened with useless junk. It's a simple straightforward interface I love.

Now about that syntax coloring, any idea when this might be added? Is this project still active?
Post 26 Aug 2016, 06:41
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8358
Location: Kraków, Poland
Tomasz Grysztar 04 Sep 2016, 16:41
poby1 wrote:
Now about that syntax coloring, any idea when this might be added? Is this project still active?
Both fasmw and fasmd, which use flat editor as their editor engine, already have syntax highlighting and you can refer to their source to see how it is done (the implementation is going to be dependent on the UI code, because flat editor core does not implement any UI itself).
Post 04 Sep 2016, 16:41
View user's profile Send private message Visit poster's website Reply with quote
poby1



Joined: 16 Aug 2016
Posts: 2
poby1 06 Sep 2016, 20:54
Tomasz Grysztar wrote:
poby1 wrote:
Now about that syntax coloring, any idea when this might be added? Is this project still active?
Both fasmw and fasmd, which use flat editor as their editor engine, already have syntax highlighting and you can refer to their source to see how it is done (the implementation is going to be dependent on the UI code, because flat editor core does not implement any UI itself).



I'm using flat assembler 1.71.54, flat editor 3.12, interface 0.98.03

I'm not seeing much syntax highlighting.

Instructions, labels, registers etc are all the same color. How can this be fixed so it looks more like other editors that colorise to differentiate between different things?
Post 06 Sep 2016, 20:54
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8358
Location: Kraków, Poland
Tomasz Grysztar 07 Sep 2016, 13:06
The fasm's tables and core functions are all at hand there, so you could perhaps quickly patch-up a variant of "fasm_syntax" function in fasmw that would color instructions and other symbols from these tables:
Code:
proc fasm_syntax lpLine,uChars,lpColors
        push    ebx esi edi
        mov     esi,[lpLine]
        mov     edi,[lpColors]
        mov     ebx,characters
        mov     ecx,[uChars]
        xor     edx,edx
  .scan_syntax:
        lodsb
  .check_character:
        cmp     al,20h
        je      .syntax_space
        cmp     al,3Bh
        je      .syntax_comment
        mov     ah,al
        xlatb
        or      al,al
        jz      .syntax_symbol
        or      edx,edx
        jnz     .syntax_neutral
        cmp     ah,27h
        je      .syntax_string
        cmp     ah,22h
        je      .syntax_string
        cmp     ah,24h
        je      .syntax_pascal_hex
        cmp     ah,39h
        ja      .syntax_neutral
        cmp     ah,30h
        jae     .syntax_number
  .syntax_neutral:
        inc     edx
        inc     edi
        loop    .scan_syntax
        jmp     .done
  .syntax_space:
        call    .recognize_name
        inc     edi
        loop    .scan_syntax
        jmp     .done
  .syntax_symbol:
        call    .recognize_name
        mov     al,1
        stosb
        loop    .scan_syntax
        jmp     .done
  .recognize_name:
        or      edx,edx
        jz      .unrecognized_name
        pusha
        dec     esi
        sub     esi,edx
        mov     ecx,edx
        call    get_instruction
        jnc     .recognized_instruction
        call    get_data_directive
        jnc     .recognized_instruction
        mov     edi,preprocessor_directives
        call    get_directive
        jnc     .recognized_instruction
        call    get_symbol
        jnc     .recognized_symbol
        popa
        xor     edx,edx
  .unrecognized_name:
        retn
  .recognized_instruction:
        popa
        xchg    ecx,edx
        sub     edi,ecx
        mov     al,1
        rep     stosb
        xchg    ecx,edx
        retn
  .recognized_symbol:
        popa
        xchg    ecx,edx
        sub     edi,ecx
        mov     al,2
        rep     stosb
        xchg    ecx,edx
        retn
  .syntax_pascal_hex:
        cmp     ecx,1
        je      .syntax_neutral
        mov     al,[esi]
        mov     ah,al
        xlatb
        or      al,al
        jz      .syntax_neutral
        cmp     ah,24h
        jne     .syntax_number
        cmp     ecx,2
        je      .syntax_neutral
        mov     al,[esi+1]
        xlatb
        or      al,al
        jz      .syntax_neutral
  .syntax_number:
        mov     al,2
        stosb
        loop    .number_character
        jmp     .done
  .number_character:
        lodsb
        mov     ah,al
        xlatb
        xchg    al,ah
        or      ah,ah
        jz      .check_character
        cmp     al,20h
        je      .check_character
        cmp     al,3Bh
        je      .check_character
        mov     al,2
        stosb
        loop    .number_character
        jmp     .done
  .syntax_string:
        mov     al,3
        stosb
        dec     ecx
        jz      .done
        lodsb
        cmp     al,ah
        jne     .syntax_string
        mov     al,3
        stosb
        dec     ecx
        jz      .done
        lodsb
        cmp     al,ah
        je      .syntax_string
        xor     edx,edx
        jmp     .check_character
  .process_comment:
        lodsb
        cmp     al,20h
        jne     .syntax_comment
        inc     edi
        loop    .process_comment
        jmp     .done
  .syntax_comment:
        mov     al,4
        stosb
        loop    .process_comment
  .done:
        pop     edi esi ebx
        ret
endp    
Just update this function in fasmw.asm and re-assemble it. This variant re-uses some of the color indexes, you'd also need to extend the table of colors to accommodate more indexes if you wanted to differentiate them more.

But in fasm many features are defined in form of additional macros, various symbols may get re-defined, etc. For this reason I never tried to include such feature in the basic IDE, leaving it to implement by more complex ones, like Fresh (it used to be based on the same editor core as fasmw, but then it moved to use its own one).
Post 07 Sep 2016, 13:06
View user's profile Send private message Visit poster's website Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 07 Sep 2016, 15:51
Tomasz Grysztar wrote:
(it used to be based on the same editor core as fasmw, but then it moved to use its own one).


No, it is still based on FASMW editor, but the old version. Smile
I am slowly working on a new editor, but it is not based on Win API and can not be used in the current version 2.x of Fresh. It is prepared for the next 3.x series.

_________________
Tox ID: 48C0321ADDB2FE5F644BB5E3D58B0D58C35E5BCBC81D7CD333633FEDF1047914A534256478D9
Post 07 Sep 2016, 15:51
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:  
Goto page Previous  1, 2

< 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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.