The MASM Forum

Projects => MASM32 => Topic started by: Ravi Kiran on February 07, 2020, 11:43:36 AM

Title: Syntax Highlighting
Post by: Ravi Kiran on February 07, 2020, 11:43:36 AM
As a beginner of 32-bit and 64-bit Assembly language Programming
I'm compelled to ask this question and many thanks for Hutch-- sir for patiently answering to my questions and I don't want to send you PMs anymore. All I can do now is to setting up the environment for
32-bit and 64-bit Assembly language programming. Can anyone around here tell me how to enable MASM syntax Highlighting within
the qeditor shipped with masm32 v11r SDK.
Title: Re: Syntax Highlighting
Post by: jj2007 on February 07, 2020, 11:57:52 AM
Hi Ravi, welcome to the Forum :thup:

Syntax highlighting is a difficult topic, see this thread (http://masm32.com/board/index.php?topic=6461.0). Apparently it's not possible with qEditor. My own baby has a different approach, semi-automatic individual highlighting, but that is clearly a matter of taste. And I guess it is not what you want. Have you tried some other editor? Notepad++ seems to be popular, for example.

(http://www.jj2007.eu/pics/RmRsrc.jpg)
Title: Re: Syntax Highlighting
Post by: hutch-- on February 07, 2020, 12:02:24 PM
Ravi,

QE does not support syntax hilighting at all, it is a pure ASCII text editor for writing assembler code, not technicolor display. In the absence of such gimmicks, it supports its own scripting, user programmable menus and its own plugin format. It can open and edit large files with ease and it is as it name "quick".
Title: Re: Syntax Highlighting
Post by: Ravi Kiran on February 07, 2020, 12:28:18 PM
Ravi,

QE does not support syntax hilighting at all, it is a pure ASCII text editor for writing assembler code, not technicolor display. In the absence of such gimmicks, it supports its own scripting, user programmable menus and its own plugin format. It can open and edit large files with ease and it is as it name "quick".
Your Qeditor is the best assembly editor ever designed. It's fast and simple like you have said but it is very difficult to understand every option it contains. Time will make me learn slowly and I'll prefer other
editors like notepad++ for syntax highlighting. As of now I'm enough
With the qeditor's no-syntax highlighting options and the editor looks
nice and beautiful with its dark background.

Plz don't remove my account by accident or by anymeans . I'll never
Post bots and spam and other Unnecessary garbage to this forum.
This forum membership is very important for me for a very longtime
From now.
Title: Re: Syntax Highlighting
Post by: hutch-- on February 07, 2020, 01:43:22 PM
Ravi,

Don't worry, you have posts up so you will not get your account deleted. We have to have a few restrictions to beat spammers otherwise we would be flooded with garbage.
Title: Re: Syntax Highlighting
Post by: jj2007 on February 07, 2020, 06:56:38 PM
QE does not support syntax hilighting at all

it will not work in QE as it has its own colour control. If you wanted to try Iczelion's technique...

Hutch,

Can you briefly explain what "it has its own colour control" means? If you have access to the richedit control's handle, why would Iczelion's technique not work?

Just curious.
Title: Re: Syntax Highlighting
Post by: hutch-- on February 07, 2020, 07:58:55 PM
 :biggrin:

QE has both text and background colour control, its in the settings.

> why would Iczelion's technique not work?

It does work, I coded a version about 20 years ago, I just don't want it in QE at all.
Title: Re: Syntax Highlighting
Post by: jj2007 on February 07, 2020, 08:28:28 PM
I understand and respect your point of view, but if somebody was really eager to have it, would he be able to write a plugin doing that? HSE tried to do that, without success, why is it not possible?
Title: Re: Syntax Highlighting
Post by: HSE on February 18, 2020, 09:28:26 AM
Very funny  JJ !!  :biggrin: :biggrin: :biggrin:

... but if somebody was really eager to have it, would he be able to write a plugin doing that? HSE tried to do that, without success, why is it not possible?

Just yesterday I found you solved the problem a lot of years ago  :thumbsup:

Later: Code and plugin are in http://masm32.com/board/index.php?topic=8353.0
Title: Re: Syntax Highlighting
Post by: Ravi Kiran on February 18, 2020, 10:58:11 AM
Very funny  JJ !!  :biggrin: :biggrin: :biggrin:

... but if somebody was really eager to have it, would he be able to write a plugin doing that? HSE tried to do that, without success, why is it not possible?

Just yesterday I found you solved the problem a lot of years ago  :thumbsup:
Thank you sir.
Title: Re: Syntax Highlighting
Post by: Ravi Kiran on February 18, 2020, 11:20:31 AM
Very funny  JJ !!  :biggrin: :biggrin: :biggrin:

... but if somebody was really eager to have it, would he be able to write a plugin doing that? HSE tried to do that, without success, why is it not possible?

Just yesterday I found you solved the problem a lot of years ago  :thumbsup:
Thank you sir.
Anyhow how am I supposed to embed these downloaded files in
masm32 folder so that I can enable syntax highlighting in Qeditor for
all .asm files including .Inc files.
Title: Re: Syntax Highlighting
Post by: HSE on February 18, 2020, 11:35:22 AM
Hi Ravi!
You have to edit "menus.ini" in masm32 directory. The usual way is to put dll in plugins directory.
Anyway QE it's not designed to support advanced Syntax Highlighting.
Title: Re: Syntax Highlighting
Post by: jj2007 on February 18, 2020, 12:57:33 PM
Just yesterday I found you solved the problem a lot of years ago  :thumbsup:

Where did you find that one???
Title: Re: Syntax Highlighting
Post by: hutch-- on February 18, 2020, 01:57:46 PM
Long ago when I coded a technicolor version of a much earlier version of QE using Iczelion's technique, you had to have large word lookup tables to support the word selection and it killed exactly what I designed QE to do, be FAST. QE will load 100 megabytes reasonable quickly and while it is rare to need to do so, its there if its needed.

From the earliest versions, QE is a no frills, no eye candy programming editor for actually writing code and writing it fast. Become dependent on gimmicks like syntax colouring and auto completion and other related claptrap and you cannot adapt to an ever changing development environment.

There are enough technicolor IDEs floating around and if you need that, go down that path but QE is a pure ASCII editor for writing code, it will never be loaded with gimmicks.
Title: Re: Syntax Highlighting
Post by: Ravi Kiran on February 18, 2020, 03:49:08 PM
Long ago when I coded a technicolor version of a much earlier version of QE using Iczelion's technique, you had to have large word lookup tables to support the word selection and it killed exactly what I designed QE to do, be FAST. QE will load 100 megabytes reasonable quickly and while it is rare to need to do so, its there if its needed.

From the earliest versions, QE is a no frills, no eye candy programming editor for actually writing code and writing it fast. Become dependent on gimmicks like syntax colouring and auto completion and other related claptrap and you cannot adapt to an ever changing development environment.

There are enough technicolor IDEs floating around and if you need that, go down that path but QE is a pure ASCII editor for writing code, it will never be loaded with gimmicks.
I have asked for syntax highlighting in QE only as an option. But default status of QE is nice.
Title: Re: Syntax Highlighting
Post by: hutch-- on February 18, 2020, 04:24:40 PM
Coercion by wish list is never going to get anywhere, QE is a tool, not a toy. If you want technicolor, use something else.
Title: Re: Syntax Highlighting
Post by: Ravi Kiran on February 18, 2020, 04:39:23 PM
Coercion by wish list is never going to get anywhere, QE is a tool, not a toy. If you want technicolor, use something else.
I'll use np++ for enough syntax highlighting sir . Default status of QE
is enough for me and it is nice.
Title: Re: Syntax Highlighting
Post by: daydreamer on February 18, 2020, 08:33:00 PM
Ravi I suggest you open and read help files from QE,there is lot of help,about the basic opcodes/mnemonics,but also much macro help,so you easily can do much things without need to code bare metal style
invoke ,string macros,conversion macros,file read/write,memory alloc,.IF,.switch,.while,.repeat
QE also have prostart =like wizard that get you started with a skeleton program fast
 
Title: Re: Syntax Highlighting
Post by: jj2007 on February 18, 2020, 08:41:34 PM
Long ago when I coded a technicolor version of a much earlier version of QE using Iczelion's technique, you had to have large word lookup tables to support the word selection and it killed exactly what I designed QE to do, be FAST.

I have asked for syntax highlighting in QE only as an option. But default status of QE is nice.

Hutch is not a friend of technicolor, and that's ok - it's a matter of taste. But qEditor does have a plugin interface, so if you can convince somebody else to give you a helping hand (HSE made already an attempt some time ago), you could add that functionality to QE. Why not?

Personally, I have enjoyed syntax highlighting for my (many) years with GfaBasic, and I appreciated that. But for me, Assembly is different. You can do all kinds of weird things when touching the bare metal, and if you want to understand later what you did a year ago, you need 1. very detailed comments and 2. individual highlighting. And no Iczelion-style automatic highlighting can do that...

(http://www.jj2007.eu/pics/RmFloatCmp.png)
Title: Re: Syntax Highlighting
Post by: HSE on February 18, 2020, 09:04:41 PM
Where did you find that one???

QE_with_colours.  A 2012 code that still is in old forum. Of course you only show the idea, it took me hours to develop something from there (mostly because I don't knew nothing of RTF).
Title: Re: Syntax Highlighting
Post by: Ravi Kiran on February 18, 2020, 09:21:45 PM
Long ago when I coded a technicolor version of a much earlier version of QE using Iczelion's technique, you had to have large word lookup tables to support the word selection and it killed exactly what I designed QE to do, be FAST.

I have asked for syntax highlighting in QE only as an option. But default status of QE is nice.

Hutch is not a friend of technicolor, and that's ok - it's a matter of taste. But qEditor does have a plugin interface, so if you can convince somebody else to give you a helping hand (HSE made already an attempt some time ago), you could add that functionality to QE. Why not?

Personally, I have enjoyed syntax highlighting for my (many) years with GfaBasic, and I appreciated that. But for me, Assembly is different. You can do all kinds of weird things when touching the bare metal, and if you want to understand later what you did a year ago, you need 1. very detailed comments and 2. individual highlighting. And no Iczelion-style automatic highlighting can do that...

(http://www.jj2007.eu/pics/RmFloatCmp.png)
Notepad++ has excellent syntax highlighting support as far as I have seen. QE is fast and simple and that's the way it has to be. Sorry for
Disturbing others about syntax highlighting in QE. But I'm expecting a
64-bit version of masm32 SDK in future.
Title: Re: Syntax Highlighting
Post by: hutch-- on February 18, 2020, 10:35:55 PM
Ravi,

There IS a 64 bit version of the masm32 sdk but it is not a turnkey project as it requires the Microsoft binaries which Microsoft OWN and make available through VS2019. I have already told you that coercion by wish list will never get off the ground but it IS of continued annoyance that you keep harping on. Give it a rest or we will give you a rest.
Title: Re: Syntax Highlighting
Post by: Ravi Kiran on February 18, 2020, 10:41:45 PM
Ravi,

There IS a 64 bit version of the masm32 sdk but it is not a turnkey project as it requires the Microsoft binaries which Microsoft OWN and make available through VS2019. I have already told you that coercion by wish list will never get off the ground but it IS of continued annoyance that you keep harping on. Give it a rest or we will give you a rest.
Ok sir whenever you want .
Title: Re: Syntax Highlighting
Post by: jj2007 on February 18, 2020, 11:38:36 PM
QE_with_colours.  A 2012 code that still is in old forum.

Yep, found it (http://www.masmforum.com/board/index.php?topic=17393.msg153746#msg153746) :bgrin:

However, that one used the character formatting of the RichEdit control. i.e. the same approach as RichMasm (http://masm32.com/board/index.php?topic=5314.0). That is fine for my taste, but OP wants something completely different: automatic syntax highlighting à la Iczelion (http://masm32.com/board/index.php?topic=6461.0).

In order to achieve that, you need the QE plugin interface (http://masm32.com/board/index.php?topic=4564.msg48903#msg48903), i.e. write a DLL that does the highlighting using the hRichEdit in-process. Quite a different story.
Title: Re: Syntax Highlighting
Post by: Ravi Kiran on February 18, 2020, 11:51:42 PM
Ravi,

There IS a 64 bit version of the masm32 sdk but it is not a turnkey project as it requires the Microsoft binaries which Microsoft OWN and make available through VS2019. I have already told you that coercion by wish list will never get off the ground but it IS of continued annoyance that you keep harping on. Give it a rest or we will give you a rest.
Nothing's wrong with QE sir. It's crystal clear.
NP++ is supporting syntax highlighting even for 64-bit instructions
and register set. I'll use it if wanted to. Sorry for disturbing you
Title: Re: Syntax Highlighting
Post by: hutch-- on February 20, 2020, 11:59:53 PM
This is what Iczelion's technique looks like. Unfortunately I broke the working example about 10 years ago and could not be bothered fixing it but the basics were it used a greater than 1 meg file for all of the words to highlight which made it a lot slower than the non technicolor version. The guts of the code is a nightmare to trace and while it originally worked OK, I just did not like the effect. This is a task for someone who really wants syntax colouring, I could not be bothered as I have many other coding things to do than try and make eye candy.


(http://www.masm32.com/files/syntax.jpg)
Title: Re: Syntax Highlighting
Post by: jj2007 on February 21, 2020, 02:44:55 AM
1 meg file for all of the words to highlight

Is that file still around? Would be very interesting...
Title: Re: Syntax Highlighting
Post by: hutch-- on February 21, 2020, 03:37:29 AM
I have scoured every archive on every machine and the only version I have is the broken one. It would not be much use to you as its written in PowerBASIC. The way I did it was with a very fast hash table for the words but the file load time really slowed up the editor's load time. Copied the client area text, fed it through the colour processing and used DrawText() to display the result.

If I ever took on a task like this again, I would use a DLL that contained a tree based finite state machine which would load faster than the text file and would read faster than the hash table. The virtue of Iczelion's technique was that it did not slow up or limit the file size and the load and save text was pure ascii.
Title: Re: Syntax Highlighting
Post by: jj2007 on February 21, 2020, 05:30:56 AM
C'mon Hutch, the times are changing, a 1MB file loads in less than a millisecond now. Just post it... ;-)
Title: Re: Syntax Highlighting
Post by: HSE on February 21, 2020, 06:28:26 AM
Hi Hutch!!

If I ever took on a task like this again, I would use a DLL that contained a tree based finite state machine which would load faster than the text file and would read faster than the hash table.

Sound impressive. What you are talking about?  :biggrin:
Title: Re: Syntax Highlighting
Post by: hutch-- on February 21, 2020, 07:29:18 AM
 :biggrin:

He he, you can blame Randy Hyde for the terminology. To cover the range of Intel Mnemonics, you need at least 600 words * 2 for upper and lower case then you have the count of MASM reserve words, a process for comments and a selection of words if they are in the table or not. Load all of the data from disk and its slow so you look for a fast technique that does not involve the binary conversion from text, put it all in a DLL with the data already accessible.

I used a hash table in the old one after the data was loaded from disk but you can do it a lot faster by having the data stored as binary code in a DLL.
Title: Re: Syntax Highlighting
Post by: HSE on February 21, 2020, 08:08:36 AM
I have the idea. Thanks  :thumbsup:
Title: Re: Syntax Highlighting
Post by: i Z ! on February 21, 2020, 09:23:05 AM
Why not try my one...?

I've just released a free version, you can also find screenshots in this topic:

https://masm32.com/board/index.php?topic=8357.0 (https://masm32.com/board/index.php?topic=8357.0)