News:

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

Main Menu

A guide to the RichMasm editor

Started by jj2007, April 28, 2016, 10:09:34 PM

Previous topic - Next topic

LordAdef

here is the idea, let me know what you think about it:

Create a TreeView with a couple of parents:

Structures
Procedures
Macros
...search the code and populate the childs with.


Possible?

jj2007

Yes, that's possible. EM_FINDTEXT is your friend...

I just checked if you can create controls, too - yes, it works, see attachment.

jj2007

#62
The flat GdiPlus API has been added to RichMasm's bubble help feature - example below. See the RichMasm beta with bubble help for WinAPI post for details.

HSE

Work this RichMasm.ini part ?:ColFg=0AAAAAAh ; default text colour
Fg8=0B0B0B0h ; light gray
Fg16=0A0h ; dark red
Fg24=0A00000h ; dark blue
Fg32=0aaaah ; dark yellow
Fg40=0ffffffh ; white
Fg48=0FFFFFh ; green


Thanks
Equations in Assembly: SmplMath

jj2007

Yes it works. Open \Masm32\MasmBasic\Res\RichMasm.ini and edit as follows:

ColBg=0FFFFE0h ; default, turquois **** DO NOT CHANGE THE ORDER OF THESE ENTRIES! ****
...
ColFg=0 ; default text colour


New version:
ColBg=0 ; pitch black **** DO NOT CHANGE THE ORDER OF THESE ENTRIES! ****
...
ColFg=ffffh ; default text colour YELLOW in BGR notation!


Restart RichMasm to see the effect.

jj2007

Sometimes I feel the need to embed an image into a source. Here, for example, an image showing the format of a REAL10 number is useful in the context of the Fcmp macro:



How is it done? In RichMasm,
- put the text cursor to the end of a comment
- click menu "Open" and select an image
- say "yes" to the "Insert image?" box
- say "OK" to the "Click and move now" box
- click into the image and move it
- when it's at the right position, click again 8)

jj2007

Attached a slightly updated version of the AllOpcodes.rtf document. You can open it in WordPad or MS Word or any other editor that understands Rich Text Format.

Of course, I use RichMasm. If the rtf hangs around at \Masm32\RichMasm\Help\AllOpcodes.rtf, it will appear in RichMasm's Help menu: Select an instruction, e.g. add, then hover over the Help menu until it opens and click All Opcodes. The listbox will fill as follows:
ADD Add
ADDPD Packed Double-Precision Floating-Point Add
ADDPS Packed Single-Precision Floating-Point Add
ADDSD Scalar Double-Precision Floating-Point Add
ADDSS Scalar Single-Precision Floating-Point Add
ADDSUBPD Packed Double-FP Add/Subtract
ADDSUBPS Packed Single-FP Add/Subtract
FADD/FADDP/FIADD Add
FADD/FADDP/FIADD Add
FADD/FADDP/FIADD Add
HADDPD Packed Double-FP Horizontal Add
HADDPS Packed Single-FP Horizontal Add
PADDB/PADDW/PADDD Packed Add
PADDB/PADDW/PADDD Packed Add
PADDB/PADDW/PADDD Packed Add
PADDQ Packed Quadword Add
PADDSB/PADDSW Packed Add with Saturation
PADDSB/PADDSW Packed Add with Saturation
PADDUSB/PADDUSW Packed Add Unsigned with Saturation
PADDUSB/PADDUSW Packed Add Unsigned with Saturation
PMADDWD Packed Multiply and Add


Another technique that I often use for my libraries is to make a comment, e.g. ; opcodes, then select opcodes and press Ctrl K to insert a hyperlink. In this case, as shown in the screenshot below, it could be \masm32\RichMasm\help\AllOpcodes.rtf#fptan--, where the red part instructs RichMasm to open the rtf, then search immediately for the string fptan--. With one click on the link, you go straight to the entry where the fptan instruction is explained.

TioPepperoni

Hey guys, I'm running into issues with RichMasm in general, I have been trying to get this to work but, sadly, it's misbehaving for me, first of all, I have installed MASM32, and it installed just fine, I got everything successfully compiled and up to the ending success message... So following that, I got the latest MasmBasic from this post over here: http://masm32.com/board/index.php?topic=94.msg264#msg264

After I followed all the instructions line by line, I got to install it under `\Masm32\` where Masm32 is located and where it was recommended.

I open RichMasm and was excited enough to finally give it a try when, it started to misbehave... for starters, clicking links, won't follow the actual link, it will just open `\Res\` directory, for anything that I click on the green area... (Main Guide), so I said, what the heck, let me try now with another thing, I followed some steps on how to create a new simple Masm app, by going to `File -> New File/Masm Source` and tried that, with no avail, it simply won't work.. I'm frustrated, because I really wanted to give this a try... any ideas what I did wrong or what could possibly went wrong, or why does it simply works for me?

System Specs:
- OS: Windows 10 Pro (x64)
- Version: 1903
- Build: 18362.720

jj2007

Hi Tio,

Sorry for that. It seems that your Windows version does something odd concerning links (note I don't blame your Windows installation, but it works on mine, including Windows 10, so I'd like to understand what's wrong...). Three short questions:

- when you hit F6 in the main help file, does it build and show the box "Wow, it works"?

- When you click the menu File/New Masm source, does it open a greenish box to the right that starts with Click to open a template, then hit F6 to run it:?

- is the editor at ?:\Masm32\MasmBasic\RichMasm.exe?

Thanks for your feedback :thup:

TioPepperoni

HI JJ!!! IT WORKS NOW!!! (uppercaps intended because I'm overly excited! hahaha)



All I had to do was to install FileFormatConverter downloaded from: https://download.cnet.com/Microsoft-Office-Compatibility-Pack-for-Word-Excel-and-PowerPoint-File-Formats/3000-18483_4-10648733.html

and everything works like a charm now!! WOOOW! I always skipped that little messagebox at the beginning of loading the actual `MbGuide.rtf` so I would never thought that was the only thing that would make it work!

I think this would be a good remark to bring up in a troubleshoot thread or something!

Thanks again!  :thumbsup:

Viva MasmBasic!

jj2007

Great job, Tio - and thanks again for the feedback :thup:

I will have to investigate why the file converter is needed. All it does for RichMasm is actually provide a more advanced RichEd20.dll :cool:

Another candidate for the RichEd20.DLL bugs thread :tongue:

TioPepperoni

Quote from: jj2007 on April 03, 2020, 11:36:43 AM
Great job, Tio - and thanks again for the feedback :thup:

My pleasure! - I fell in love this project at first sight!

Quote from: jj2007 on April 03, 2020, 11:36:43 AM
I will have to investigate why the file converter is needed. All it does for RichMasm is actually provide a more advanced RichEd20.dll :cool:

Another candidate for the RichEd20.DLL bugs thread :tongue:

:greensml:

jj2007

Let's say you have a typical resource file:
#include "resource.h"
IDI_APPLICATION ICON "\\Masm32\\MasmBasic\\icons\\Smiley.ico"
01 RT_MANIFEST "\\Masm32\\MasmBasic\\Res\\XpManifest.xml"
#define IDC_MENU 100
#define IDM_SAYHELLO 101
#define IDM_GETTEXT 102
#define IDM_CLEAR 103
#define IDM_EXIT 104
IDC_MENU  MENU
BEGIN
    POPUP "The menu"
    BEGIN
        MENUITEM "Say Hello", IDM_SAYHELLO
        MENUITEM "Get Text", IDM_GETTEXT
        MENUITEM "Clear Edit Box", IDM_CLEAR
        MENUITEM "", , MFT_SEPARATOR
        MENUITEM "E&xit", IDM_EXIT
    END
END

To work with it in the main code, you need this:
IDC_MENU= 100
IDM_SAYHELLO= 101
IDM_GETTEXT= 102
IDM_CLEAR= 103
IDM_EXIT= 104

Wow, that's a lot of stupid typing, right? There is a less known function in RichMasm: select some text and press Ctrl N (N like "Number"). For example, 12345678h yields this:
Dec: 305419896
Hex: 12345678h
00010010001101000101011001111000b
10987654321098765432109876543210

Now, if you select the #define block of text above, Ctrl N will rightly recognise that you want more than one number, and invite you to put the IDC_MENU=100 etc version on the clipboard.

The new RichMasm version comes with MasmBasic 19.9.23. Enjoy :thup:

jj2007

Fighting with the incredibly opaque documentation for ADODB. Everyone writes different stories, and compilers do strange things :cool:

pSchema = pCon->OpenSchema(adSchemaTables);... translates to ...
push OFFSET ?vtMissing@@3V_variant_t@@A ; vtMissing = pointers to linefeeds (!)
push OFFSET ?vtMissing@@3V_variant_t@@A ; vtMissing
push 20 ; 00000014H, adSchemaTables
// _pCon$ = -48/-30h ; size = 4
// _pSchema$ = -44/-2Ch ; size = 4
// _sheetName$ = -40/28h ; size = 24
// ??? = -30 = -64 _this$ = -64
lea edx, DWORD PTR $T10[ebp] ; $T10 = -236
push edx
lea ecx, DWORD PTR _pCon$[ebp]
; 00000515- ... = IID_Connection15
call ??C?$_com_ptr_t@V?$_com_IIID@U_Connection@@$1?_GUID_00001550_0000_0010_8000_00aa006d2ea4@@3U__s_GUID@@B@@@@QBEPAU_Connection@@XZ ; _com_ptr_t<_com_IIID<_Connection,&_GUID_00001550_0000_0010_8000_00aa006d2ea4> >::operator->
mov ecx, eax
stack0
call ?OpenSchema@Connection15@@QAE?AV?$_com_ptr_t@V?$_com_IIID@U_Recordset@@$1?_GUID_00001556_0000_0010_8000_00aa006d2ea4@@3U__s_GUID@@B@@@@W4SchemaEnum@@ABV_variant_t@@1@Z ; Connection15::OpenSchema
stack+30h
mov DWORD PTR tv289[ebp], eax ; tv289=-64=-40h
mov eax, DWORD PTR tv289[ebp] ; ???
push eax
lea ecx, DWORD PTR _pSchema$[ebp] ; -44=-2Ch (empty, gets filled by call but it's not a string)
call ??4?$_com_ptr_t@V?$_com_IIID@U_Recordset@@$1?_GUID_00001556_0000_0010_8000_00aa006d2ea4@@3U__s_GUID@@B@@@@QAEAAV0@$$QAV0@@Z ; _com_ptr_t<_com_IIID<_Recordset,&_GUID_00001556_0000_0010_8000_00aa006d2ea4> >::operator=
lea ecx, DWORD PTR $T10[ebp] ; -68=-44h=$T10
call ??1?$_com_ptr_t@V?$_com_IIID@U_Recordset@@$1?_GUID_00001556_0000_0010_8000_00aa006d2ea4@@3U__s_GUID@@B@@@@QAE@XZ ; _com_ptr_t<_com_IIID<_Recordset,&_GUID_00001556_0000_0010_8000_00aa006d2ea4> >::~_com_ptr_t<_com_IIID<_Recordset,&_GUID_00001556_0000_0010_8000_00aa006d2ea4> >

TimoVJL

#74
Quote from: jj2007 on January 07, 2024, 01:32:30 AMFighting with the incredibly opaque documentation for ADODB. Everyone writes different stories, and compilers do strange things :cool:

pSchema = pCon->OpenSchema(adSchemaTables);
C it this way
pSchema = pCon->lpVtbl->OpenSchema(pCon, adSchemaTables, v1, v2, &pRst);
EDIT: needs three four parameters
May the source be with you