News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

New Editor

Started by Biterider, March 04, 2025, 08:38:50 PM

Previous topic - Next topic

Biterider

Hi!
Over the last few weeks, I have been working hard to bring the Assembler Development Environment (ADE) to the beta stage. Since I started coding with it, I think I have almost reached that stage.

I mostly added the features that I needed, but there is still a lot to do.
At this point, I need some testers to try out the implemented functionality.

Project management is ready so far. Search and replace works, except for "Project files" and beyond.
Open, drag and drop, command line and file association all work to open a project file.
This file is just a JSON file with the .adep extension.

Exception handling is still disabled to identify issues in the code.

Regarding the visuals, the iconography needs some refinement, but it is acceptable for now.

The editor context menu now includes two internet search options: Google Search and DeepL Write.

The GitHub repository contains all the source files needed to recompile the project.
The attached zip file contains the latest binary, the configuration file (.ini), a sample project file and a sample .asm file.

Regards, Biterider

jj2007

Looks good and works fine, but where is the build button?  :smiley:



Overall an impressive work, especially given that you don't use the richedit control :thumbsup:

What you might consider is less colour (see above) and less functions in the toolbar. There are some that I would probably never use, e.g. "save all files" - dangerous if you don't remember exactly what you did, and where.

What I would miss most is the recent files list and the list of found matches, see below. I could live without the bookmarks at the right edge, maybe, but the list of matches is essential for my work.


When you double-click on a word, e.g. edi, all occurences of edi get highlighted. That is certainly a useful feature to see immediately where edi is being used (and I might steal the idea), but it might be a bit overwhelming. Maybe do that only when Ctrl is pressed?

I am just brainstorming here to give you feedback. Please don't take it as criticism :thup:

Biterider

Hi JJ
Quote from: jj2007 on June 09, 2025, 09:18:56 PMPlease don't take it as criticism
Not at all! I'm always happy to receive comments that could help improve ADE.

I did not explain the content and structure of the ADE configuration file (ade.ini) because it is constantly changing.
If you look into it in its current version, you will see that it has four main sections. The first section is for general settings, while the next three describe the basic file types that ADE can handle: assembler files, resource files, and simple text files.
Each of these three sections can be modified to change colour settings, highlight groups, visual settings and so on.

The autocomplete feature is what I miss the most. Regarding the Win32 API, I will use a by-product of the h2inc+ project. These are the parsed lists of all the structures, constants, functions and arguments of the complete Win32 API.
This is not yet implemented, but when it is, it will be a huge help.

As stated previously, the 'Find and Replace' feature is not yet complete, but an overall match list would be useful.

Bookmarks (jump targets) are on the wish list.

When working on individual files, an MRU list comes in handy. ADE works using the concept of projects, where all relevant files are listed. In case that the code needs to work differently, it may be useful to consider this option. This raises the question of where the MRU list should be stored. I have seen implementations that use the registry, but that is not portable. The project file is also not suitable if the coder doesn't work with projects. Any thoughts on this?

Biterider
P.S. Does anyone know how to identify the current default browser?

ognil

Quoteby Biterider : P.S. Does anyone know how to identify the current default browser?

.data
align 16
CLSID_ApplicationAssociationRegistration dd 591209c7h
dw 767bh,42b2h
db 09fh,0bah,44h,0eeh,046h,15h,0F2h, 0C7h
IID_IApplicationAssociationRegistration  dd 04e530b0ah
dw 0e611h, 04C77h
db 0a3h,0ach,90h,31h,0d0h, 22h, 28h, 1bh                 
;**********************************************************************************;     
pUnknown        dq 0
lpAppNameAddr   dq 0
fileExt         dw ".","H","T","M","L",0,0
szAppNameAddr   db 128 Dup(0) ; Result->External buffer with  C.h.r.o.m.e.H.T.M.L...
;**********************************************************************************;     

.code
; Identify the current default browser
;call   GetBrowserName
 
GetBrowserName  proc
xor     ecx, ecx                       
mov     edx, 2 or 4         ; 4 = COINIT_DISABLE_OLE1DDE ;Disables DDE for OLE1 support.
call    CoInitializeEx      ; 2 = COINIT_APARTMENTTHREADED

; CoCreateInstance
lea     rcx, CLSID_ApplicationAssociationRegistration
xor     edx, edx                                               
mov     r8d, CLSCTX_INPROC_SERVER   ; CLSCTX_INPROC_SERVER=1
lea     r9,  IID_IApplicationAssociationRegistration
lea     rax, pUnknown               ; Result= Interface->IApplicationAssociationRegistration
mov     qword ptr [rsp+4*8], rax    ; rax= 5th argument
call    CoCreateInstance
test    eax, eax
jne     Error_Exit

lea     rax, lpAppNameAddr   ; rax= out_opt_string LPWSTR *ppszAssociation
mov     rcx, pUnknown      ; rcx=Interface->IApplicationAssociationRegistration
mov     [rsp+4*8], rax       ; Result-> addr lpAppNameAddr of ret string in internal memory
mov     rax, [rcx]           ; rax-> addr of Vtable of IApplicationAssociationRegistration Interface
lea     rdx, fileExt         ; in_string LPCWSTR pszQuery
xor     r8d, r8d             ; ASSOCIATIONTYPE atQueryType -> AT_FILEEXTENSION = 0
mov     r9d, 1               ; ASSOCIATIONLEVEL alQueryLevel-> AL_EFFECTIVE=1
call    qword ptr [rax+3*8]  ; in 3*8->offset of the addr of QueryCurrentDefault method In Vtable
test    eax, eax
jne     Error_Exit

; release pUnknown interface
mov     rcx, pUnknown
mov     rax, [rcx]
call    qword ptr [rax+2*8] ; in 2*8->offset of the addr of Release method In Vtable

; copy string from memory to external buffer
mov     rax, lpAppNameAddr  ; Return in rax->addr of External buffer with " C.h.r.o.m.e.H.T.M.L..."
lea     rdx, szAppNameAddr  ; Result->External buffer with  C.h.r.o.m.e.H.T.M.L...
@@:
mov     ecx, [rax]
add     rax, 2
mov     [rdx], ecx
add     rdx, 2
test    ecx, ecx
jnz     @b

;free internal memory
mov     rcx, lpAppNameAddr
call    CoTaskMemFree
lea     rax, szAppNameAddr  ; Return in rax->addr of External buffer with " C.h.r.o.m.e.H.T.M.L..."
ret
Error_Exit:
xor     eax, eax 
ret
GetBrowserName  endp
;**************************************************************************************************;
"Not keeping emotions under control is another type of mental distortion."

Biterider

Hi ognil
I've got it. 
I'll search the registry for the association of '.html' files.  :thumbsup:

Biterider

TimoVJL

Getting Default browser

AssocQueryString(0, ASSOCSTR_EXECUTABLE, ".html", path, sizeof(path));
May the source be with you

Biterider

Hi Timo
Thanks, "AssocQueryString" does the job for me  :thumbsup:

Biterider

jj2007

include \masm32\include\masm32rt.inc
uselib shlwapi

.data?
TheExe db MAX_PATH dup(?)

.code
start:
  push eax
  invoke AssocQueryString, 0, 2, chr$(".html"), 0, addr TheExe, esp ; ASSOCSTR_EXECUTABLE=2
  print offset TheExe
  pop edx ; #characters copied including null terminator
  exit

end start

Biterider

Hi
While reading the news this morning, I came across MCP. It's fascinating to see how AI (LLMs) is evolving.
In the case of MCP, the aim is to enable LLMs to interact more effectively with the outside world.
I could imagine the potential of using an LLM to control the ADE editor, i.e. refactoring my code directly in place. The concept looks very appealing.
The basic concept looks like can be seen in the attached jpg.

Side note: for back-end communication, it uses JSON-RPC!

For those to want to read more, here the link https://modelcontextprotocol.io/introduction

Biterider