The MASM Forum

Projects => MasmBasic & the RichMasm IDE => Topic started by: LordAdef on March 08, 2017, 11:00:45 AM

Title: Why I use RichMasm
Post by: LordAdef on March 08, 2017, 11:00:45 AM
I joined Masm32 very recently. One of the first things one needs to find out is where to write your asm code. There are many choices available and unless you opt for an IDE the logical choice is qEditor. We all know that. qEditor is solid and stable as a mountain and is light as air. It´s great and straight to the point.

RichMasm looks like a qEditor on Steroids. It´s faaast to build too, but JJ implemented really great features that I can no longer live without.

I think many people don´t give RichMasm a chance because of the love JJ gives to MasmBasic. People may find hard to separate the two things (BTW, MasmBasic is a powerful beast on its on, a plus when using Richmasm, "if" you wish so).

RichMasm is a beast of its own!

I´m still learning the dozens of features Johen has put in there, so I´ll list the very little I know at this point which I find really great.

1. First of all, Richmasm is in current development and JJ is passionate about it. I´m sure he would consider user´s suggestions for new implementations

2. Colour formatting: No asm sintax Highlight as in an IDE. "However", being able to use colour schemes makes life a lot easier and code very easy to read.

    ¹BTW, I don´t use Johen´s default blue BK colour scheme. I rather prefer the darker qEditor/VS style.
    ²RM allows you to change that. However, it´s not very intuitive to do so (although it´s easy). Johen could make this easier (I´ve a suggestion I´m submitting to him on this)
    ³In fact, I believe RM should default to this more "commercial" default scheme. New programmers would feel more at home, before going wild.

3. Error messages: You screw things up and it generates an error message. RichMasm highlights the line in the code where the error occurs (most of the time). It also gives a line number. You just press Ctrl g, type the line number and there you go.

4. the search tab: It´s on the right hand side all the time. Type something in there and RM lists a clickable list of all occurrences of the given item. It´s reaaaaally bloody helpful

5.  F6: as a beginner I need to build my code more often than usual... Instead of dozens of clicks (save it, build it, run it...) just hit F6. A time saver and an ergonomic joy.

6. Multi-line comment, F4: Select a group of lines and boom, f4. Everything is commented

7. Bookmarks: You can bookmark anything you want in RM, and they are available for you on the right side tab. Just click it and RM takes you to where you need to be

8. Ctrl F12: This is a nice feature! Select a session of code and hit Ctrl F12. It creates a windows showing the selected code. Now you just go "downstairs" but you can assess what you selected anytime from that window. Great if you constantly need to check different parts of the code.

9. Resource: It´s a joke...  RM actually does it for you, you just need to click somewhere after "end start" and click the resource option at the "auto code" menu.

10. Debugger: insert int 3 anywhere in your code and build it. It automatically opens and runs OllyDbg

11. MasmBasic: Although I think people should think RichMasm isolated to MB, MasmBasic is there for you to use it "if" you want! It´s a powerful pack full of insane features.

I guess these are enough reasons to make me use RichMasm. There are many more features to mention, and surely more to come since Johen is a mad man (it´s a joke JJ) and wont stop here I hope.

ps1: I´m not affiliated to Johen. I created this thread because I believe more people should be using RichMasm, and because I also to congratulate Johen for his editor.

ps2: The usual foreigner disclaimer: English isn´t my mother language  :dazzled:

Cheers all
Alex
Title: Re: Why I use RichMasm
Post by: jj2007 on March 08, 2017, 01:04:38 PM
Quote from: LordAdef on March 08, 2017, 11:00:45 AMreally great features that I can no longer live without.

Me too, I can confirm that :greensml:

Seriously: Thanks a lot, Alex. I feel honoured. Most people who have tried RichMasm (http://masm32.com/board/index.php?topic=5314.0) gave up very soon because it does not behave like the standard VS-style IDE, but I am glad that you confirm iit's usable for others, too.

Of course, I use RichMasm all the time myself, and am constantly trying to make it easier to use. Any suggestions are welcome, although I cannot promise to implement it all.

Jochen
Title: Re: Why I use RichMasm
Post by: hutch-- on March 13, 2017, 07:17:04 AM
Alex,

All you need to do now is sit on his chest and tickle him until he agrees to a sub-forum specifically for RichMASM so it can be properly promoted and supported. It serves neither purpose to mix emulated BASIC with straight MASM as they are different mentalities. I have long been a fan of BASIC and over 20 years ago I worked in GFA basic as it was smaller and faster than the versions of VC that were around back then.
Title: Re: Why I use RichMasm
Post by: LordAdef on March 13, 2017, 01:52:41 PM
well, it's been centuries since I last programmed in BASIC...

I am all for a sub Forum dedicated to RichMasm, and actually wondered why there isn't one.

Johen, let's do this!
Title: Re: Why I use RichMasm
Post by: jj2007 on March 13, 2017, 08:13:02 PM
Quote from: hutch-- on March 13, 2017, 07:17:04 AMa sub-forum specifically for RichMASM

Thanks, Hutch & Alex, but neither RichMasm nor MasmBasic are important enough to open a sub-forum. They both have a dedicated thread now, that's more than enough. As you know, what I can't stand is people who clutter the forum with new threads for every little "my mom says it will rain tomorrow" hiccup.

QuoteI have long been a fan of BASIC and over 20 years ago I worked in GFA basic as it was smaller and faster than the versions of VC that were around back then.

That's why we understand each other so well, Steve - MasmBasic is GfaBasic on steroids, see Recall (http://www.webalice.it/jj2006/MasmBasicQuickReference.htm#Mb1172) :biggrin:

I appreciate your efforts to keep PowerBasic alive and kickin', by the way. Bob Zale is a hero for me, and I really hope his baby continues to show its teeth to Micros**t's crappy Basic parodies :greensml:
Title: Re: Why I use RichMasm
Post by: HSE on March 13, 2017, 10:33:39 PM
I agree with JJ!
I have a couple of crappy threats to post in MasmBasic-RichMasm forum. A funny one is: "Why the help it's not in help menu" :biggrin: :biggrin: :biggrin: (I know the answer but I still laught when I remember the question ).
Beside, is far better to find usefull examples of MasmBasic lost in other subjects. And later you can try to find again... a lot of fun!!!
Regards. HSE.
Title: Re: Why I use RichMasm
Post by: jj2007 on March 13, 2017, 11:36:23 PM
Quote from: HSE on March 13, 2017, 10:33:39 PMBeside, is far better to find usefull examples of MasmBasic lost in other subjects. And later you can try to find again... a lot of fun!!!

Indeed :t

The forum search (http://masm32.com/board/index.php?action=search;advanced;search=) is very efficient; just put MasmBasic Recall or whatever, and it lists lots of examples.

Sometimes I wonder if there is an option to force full-word search as in Google, it would help for short commands such as deb (http://www.webalice.it/jj2006/MasmBasicQuickReference.htm#Mb1019), rv, rvc, fn, fnc, cfm$, uni$ etc; even in RichMasm I use the FW option pretty often nowadays, in particular to find variables with similar names. For example, in one of my sources, finding quot yields 73 matches in unrestricted search but only 24 in FW mode. Other example: 500 matches for EXIT but only 39 for EXIT in full word mode (i.e. 461 are probably EXITM, which is a different animal).

What I hate most with the "a new thread for every hiccup" philosophy is that it damages the "table of contents" view, e.g. The Lab (http://masm32.com/board/index.php?board=6.0). It is much more useful if you can see at one glance a dozen really important threads there, in contrast to, as Hutch puts it, "Too many junk posts (http://masm32.com/board/index.php?topic=2367.0)" ;-)
Title: Re: Why I use RichMasm
Post by: LordAdef on March 20, 2017, 02:22:24 PM
So I will be using this thread to make my comments on RichMasm  :badgrin:

JJ, I´ve got a suggestion for implementation.

Playing with colours is fun! I don´t even care for syntax highlighting anymore.

So here it goes:

# It would be nice if the side tab bar could be switched from the actual bookmark/search into colour tab.
# You click this button in the lower part and the thing toggles into colours selection/editing. In there, one could choose from a bigger variety of fore/background colours, and project bk colour. A colour picker would also be a given  :t
# I attached my latest asc file for you to see. Check out how I´m colouring things at the end and main session labels. I am "cheating", pasting in Office, colouring, and pasting it back.
# Together with the buttons for bookmark and colours, I would put a third one to partially hide the tab bar. This would be most useful when one opens more than one asc file side by side.

Cheers Alex

edit: Adding a "search and paint text" field would interesting too. In fact, one could actually achieve the so desired (by many) "pseudo" syntax highlight. Like search&Paint: "eax, ebx, ecx, edx, esi, edi" + blue  :greenclp:
Title: Re: Why I use RichMasm
Post by: hutch-- on March 20, 2017, 06:26:02 PM
Alex,

There has to be a way to get him to support RichMASM properly in its own subforum. As it looks like he is stubborn and won't move unless you place a bomb under his behind, the trick would be to pump him full of a couple of good bottles of VINO and persuade him while intoxicated to be brave and have a go at supporting his project properly.

Its a unique idea of emulating the basic language within MASM and similar and with a dedicated editor/IDE and years of procedures, it only needs to be supported as a stand alone project so that it is not confused with conventional assembler code.
Title: Re: Why I use RichMasm
Post by: jj2007 on March 20, 2017, 08:59:37 PM
Quote from: LordAdef on March 20, 2017, 02:22:24 PM
Playing with colours is fun! I don´t even care for syntax highlighting anymore.

True, but in my longer sources I restrict it nowadays to really tricky code sequences. I've been accused sometimes that I exaggerate with colour, but it can be useful :bgrin:

include \masm32\MasmBasic\MasmBasic.inc      ; download (http://masm32.com/board/index.php?topic=94.0)

MyTest proc pTxt, pTitle, mbX
Local abc
  push esi
  push edi
  mov abc, 123
  MsgBox 0, pTxt, pTitle, mbX
  pop edi
  pop esi
  pop ecx
  ret
MyTest endp

  Init
  mov esi, 1111
  mov edi, 2222
  mov ecx, 3333
  deb 4, "before", esi, edi, ecx
  invoke MyTest, chr$("Just a test"), Chr$("Just a title"), MB_OK
  deb 1, "after", esi, edi, ecx, eax
EndOfCode

Hint: Select the whole snippet above, paste it into an empty RichMasm doc, select all, hit F4 twice.

Quote# It would be nice if the side tab bar could be switched from the actual bookmark/search into colour tab.
# You click this button in the lower part and the thing toggles into colours selection/editing. In there, one could choose from a bigger variety of fore/background colours, and project bk colour. A colour picker would also be a given  :t

Let's not overdo it. If I find time, I may add a little colour toolbar in the place where the Alt R replace box is. Btw if you press Ctrl G, there are some interesting tooltips for the Goto box - see col= ;)

Quotepasting in Office, colouring, and pasting it back.

I use that cheat every now and then, too.

Quotepartially hide the tab bar.

Ctrl G, tbw=0
Afterwards, you can press Alt W to get it back. tbw=30 would give you a narrow bookmark bar.

Quoteone could actually achieve the so desired (by many) "pseudo" syntax highlight. Like search&Paint: "eax, ebx, ecx, edx, esi, edi" + blue

a) You can select a block of text and press F4 twice. That colours push/pop, active int 3 breakpoints, comments and MasmBasic syntax (attention if you had lines commented out, they will be active afterwards)

b) to colour specific variables, you can
- copy MyVariable to the clipboard
- select MyVariable and press F3
- select in the listbox the range where you want it to be replaced (useful if it's a local variable)
- press Alt R to open the replace box
- insert <c> (as in <clipboard content> and hit Enter
- answer YES
Title: Re: Why I use RichMasm
Post by: LordAdef on April 29, 2017, 01:08:06 AM
Hutch, since there is a MasmBasic forum now, maybe you should move this one too.
Title: Re: Why I use RichMasm
Post by: hutch-- on April 29, 2017, 01:39:35 AM
Yes, good idea, will give JJ enough room to properly promote his RichMasm.
Title: Re: Why I use RichMasm
Post by: jj2007 on April 29, 2017, 01:47:51 AM
 ;)
Title: Re: Why I use RichMasm
Post by: LordAdef on April 29, 2017, 02:06:17 AM
I agree, and I ideally wished the forum to be called "RichMasm and MasmBasic".
They are different beast, although interconnected.

But this is your call, I'm simply a humble user  :eusa_dance:

[JJ] And I am your unhumble moderator :badgrin:
Just discovered that I can modify your posts, Alex. Not that I will use it often.

Yeah, "RichMasm and MasmBasic" would be better as a title. You can do plain Masm32 editing with RichMasm, and you could build MasmBasic sources with qEditor, no problem. So they are different beasts indeed.
Title: Re: Why I use RichMasm
Post by: LordAdef on April 29, 2017, 02:53:24 PM
 :greenclp:
Title: Re: Why I use RichMasm
Post by: LordAdef on May 05, 2017, 07:12:26 AM
Just for fun, since you enjoy these things:

I installed masm32 + MB in may laptop.
I forgot *.inc is set to open in VS. Double clicked a 11kb inc file and had to wait for THREE minutes.... Man, I´m long enough in the asm world and forgot about the slow stuff...
Title: Re: Why I use RichMasm
Post by: jj2007 on May 05, 2017, 07:32:38 AM
I know the feeling :icon_mrgreen:

Most of my plain text endings are set to RichMasm, of course. But VerySlow has that bad habit to reclaim them without asking for permission :eusa_naughty:
Title: Re: Why I use RichMasm
Post by: jj2007 on September 17, 2017, 08:38:41 AM
RichMasm beta for testing - use at your own risk!

This concerns mainly the menus under Win10. The attached version requires a MasmBasic installation:
RichMasm.exe must be extracted to the \Masm32\MasmBasic\ folder.
RichMasm.ini goes to \Masm32\MasmBasic\Res\

There may still be little glitches when moving the editor, but at least the menus should display OK once it is in a stable position. The file \Masm32\MasmBasic\Res\RichMasm.ini can be personalised as follows:
ColMenu=0 ; BGR: 0=default, 1=black
MenuFont=15 ; size 10...20
MenuStyle=5 ; 1/2/3/4... boldness
MenuBgL=0AA7700h ; menu background left
MenuBgR=0FF8800h ; right


Different L and R give a sliding background to the menu. Put zero to accept default values based on invoke GetSysColor, COLOR_ACTIVECAPTION/COLOR_GRADIENTACTIVECAPTION. Unfortunately, on Windows 10 they have little to do with the real caption colour, therefore the option to personalise them :(

Feedback welcome, of course :bgrin:

P.S.: To give you an idea how messy this is, here an attempt from the PowerBasic forum (https://forum.powerbasic.com/forum/user-to-user-discussions/sdk-programming/61204-getting-the-window-caption-color?p=711266#post711266) to investigate the caption colour:
QuoteRTL_GetOSVersionNum(vmaj, vmin, vpak)
    IF vmaj>5 THEN
        keyerr=RegOpenKeyEx(%HKEY_CURRENT_USER, "Software\Microsoft\Windows\DWM", 0, %KEY_QUERY_VALUE, hKey)
        RegQueryValueEx(hKey, "ColorizationOpaqueBlend", 0, %REG_DWORD, blur, SIZEOF(blur))
        IF (keyerr<>%ERROR_SUCCESS) OR (blur) THEN
            FUNCTION=GetSysColor(%COLOR_ACTIVECAPTION)
        ELSE
            RegQueryValueEx(hKey, "ColorizationColor",  0, %REG_DWORD, CLR, SIZEOF(clr))
            RegQueryValueEx(hKey, "ColorizationBlurBalance",  0, %REG_DWORD, blur, SIZEOF(blur))
            CLR=BGR(clr) 'Its a BGR color, also BGR function wipes out Alpha BYTE
            r=GetRvalue(Clr) : g=GetGvalue(Clr) : b=GetBvalue(Clr)
            maxv=MAX(r,g,b) : bfact=blur/90!
            r=r+(maxv-r)*bfact : b=b+(maxv-b)*bfact : g=g+(maxv-g)*bfact
            clr=RGB(r,g,b)
            FUNCTION=clr
        END IF
    ELSE
        FUNCTION=GetSysColor(%COLOR_ACTIVECAPTION)
    END IF
Title: RichMasm features WinAPI bubble help
Post by: jj2007 on January 17, 2018, 09:48:50 PM
Since April 2018 has a nice feature, provided that you download this archive (http://www.jj2007.eu/pics/ApiAll.zip) and extract the only file as \Masm32\MasmBasic\Res\ApiAll.jno.

Open a source in RichMasm.exe and check what you see when hovering over, for example, over CreateWindowEx. If it doesn't look as in the screenshot below, please let me know 8)

The ApiAll.jno database has over 10,000 entries. There is a certain risk that it contains strings that have another meaning in your code. Let me know if you see a mismatch. The search is done as follows:

  mov esi, ApiAll$              ; esi is the database, edi the API to be found
  .if !Instr_(esi, edi, 4)
        .if ecx>6                       ; find createwindow but not pop or addr
                .if !Instr_(esi, edi, 5)        ; if case-sensitive not found, try case-insensitive full word
                    void Instr_(esi, edi, 1)    ; if even that failed, try a simple case-insensitive search
                .endif
        .endif
  .endif
  .if eax
       ; deb 4, "Api match", $eax:20


Note that by right-clicking on a selected word, e.g. LoadCursor, there is an entry in the popup menu called "Insert tooltip text".

(http://www.jj2007.eu/pics/ApiAll.png)
Title: Re: Why I use RichMasm
Post by: LordAdef on January 20, 2018, 08:07:33 AM
Hi Johen,

I´m going to download it tonight and let you know how it goes. Looks nice!
Title: Re: Why I use RichMasm
Post by: LordAdef on January 20, 2018, 01:17:48 PM
JJ, this is actually reaaaaally cool! Working like a charm here.

edit to add: and BTW, this new feature has already been proved very useful for me! I was looking for the createfont  struct at msdn when  it came to me I didn´t have to, RichMasm has it!!!!


Great feature Johen, cheers.