Help addin for RadAsm 3.x

Started by donkey, April 17, 2011, 09:04:36 PM

Previous topic - Next topic

donkey

I was playing with the idea of translating Qweerdy's RadHelp addin for RadAsm 3 but it was simply too much work for code that first off was in MASM and second that I did not completely understand. So since I was using SQLite for another project anyway I decided to write an SQL implementation of the help system. It is written in GoAsm and is actually quite a large file since it contains the sqlite dll.

To install it follow the directions in the read me file.

RadSqlHelp (337 KB)

You will need to install the Windows 7 SDK and download my Help2 Viewer which is expected to be in the Addins folder for the default command line. Or change the defaults to whatever you choose. Note that the H2 collection name is the one on my system you might have to change that to whatever collection you install.

The default CHM for the x86 instruction set is Instruct32.CHM, it is available here

Any suggestions or bug reports are welcome.

Usage:

On first opening the addin will create a database file called RadSqlHelp.ldb, it will use any KWL files it finds in the AddIns folder to populate the database.

To set a help file use "Option|RadSqlHelp options". Select a help file and type a command line for the file. See the defaults for examples and syntax for command lines. I will write a comprehensive "How-To" when I get a chance.

The addin overrides the default behavior of the F1 key. Pressing F1 will execute the search for the keyword at the cursor and open the appropriate help file.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

donkey

Here's a quick primer on using the collection editor:

RadSqlHelp usage

KWL file format

Line1: Assembler name as it appears in RadAsm.ini or a short collection name
Line2:Description of this KWL file
Followed by a list of keywords and their aliases in the format

Keyword=Alias

If the keyword does not have or need an alias then do not include one or the = operator

Help file path:

Folder\Helpfile.Ext

Folder can be substituted with the following tokens

$A = Assembler subfolder path
$D = Radasm addins folder
$H = Radasm help folder
$R = Radasm root path
$S = Windows system folder
$W = Windows folder


For the commandline, in addition to the tokens above there are also:

$E = Executable (the expanded Help file path entry)
$K = Keyword

So for example if you wanted to use MyProgram.exe and pass it a keyword on the command line, you would do the following

In the help file text box enter the path to the execuatable or use the browse button to locate it

$D\MyProgram.exe

In the Command text box enter the following:

$E $K

This will generate the following command line

C:\RadAsm30\Addins\MyProgram.exe Keyword

For HTML Help 2 help files, you would enter the location of Help2 Viewer.exe and the following command

/$K /HTMLHELP2COL

Where HTMLHELP2COL is the name of the collection to query for the keyword. For example the Microsoft SDK collection on my machine is:

MS.LHSMSSDK.1033

So it would be:

/$K /MS.LHSMSSDK.1033

For mk: type help files you can disable the content blocks using the following advise from sinsi

Tools>Internet Options>Advanced>Settings, under Security, tick "Allow active content to run in files"

For .hlp (old WinHelp) files you have to download WinHlp32.exe from Microsoft.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

donkey

I neglected to mention that I also have a CHM and KWL file for sqlite3. It is the one that comes with LCC and is incomplete in that it does not contain any of the v2 functions but it is a decent reference all the same. Copy the CHM to the RadAsm30\Help folder and the KWL file to the RadAsm\Addins folder. Delete the RadSqlHelp.ldb file and start RadAsm to rebuild the data base.

sqlite3

To set up RadSqlHelp for its use, select the assembler you want to use from the combo box and choose sqlite from the collections window. Use the browse button to locate the chm file then press the "generate" button to auto generate the command line. Press save and you're ready to go.

For most people this is not a really useful help file however if you use sqlite in any of your projects it is nice to have the reference at the touch of the F1 key.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

donkey

#3
Hutch wrote a MASM32 help file in CHM format available here. The attached is the KWL file for it. It replaces the masm.kwl file in the Addins folder. To enable it replace the existing masm.kwl file with the one here, delete the radsqlhelp.ldb file and open RadAsm. Select MASM from the assembler combo box and MASM from the collection list. Use the browse button to find the CHM file and click the Generate button beside the Command text box. Press Save and you're done.

BTW I am working on an option that will allow you to import a single KWL without losing your settings, hopefully I'll get it done next weekend.

Note: I have updated the RadSqlHelp distribution  to include this version of MASM32 help and set it as the default for MASM and JWASM.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

donkey

Quote from: donkey on April 18, 2011, 03:35:21 PM
BTW I am working on an option that will allow you to import a single KWL without losing your settings, hopefully I'll get it done next weekend.

One of the major advantages to using SQL is that adding functionality is fast and easy. I have added the KWL import button, it takes the place of the Rebuild All button on the collection viewer dialog, The Rebuild All button never really worked all that well anyway (it would occasionally crash sqlite3.dll) so its no loss. You can now import a KWL file without losing any settings or affecting any existing collections. You can also replace an existing collection with a new KWL. The program will delete the existing keywords in the collection (after a prompt) and replace it with the new ones generated from the KWL file, the collection index remains the same.

There is a new upload, just use the link in the first post to get the latest version.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

donkey

Simple guideline when making KWL files for CHM help.

If you are creating a KWL file to be used with a CHM help file it is best to make it so it uses the auto-generated command line. To do this you can open the CHM normally and select "Properties" from the context menu on a page (use right-click). In the dialog that appears you'll see something like this:

mk:@MSITStore:C:\Programming\RadASM3\Help\Instruct32.chm::/vc18a.htm

When making your KWL file you should include in the alias everything after .chm::/ that way it will allow the user to simply have the command line auto-generated (the Generate button will output mk:@MSITStore:$E::/$K when a CHM file is selected). So an entry in the KWL will look like this:

bound=vc18a.htm

In some CHM files you will see a reference to an HTML document after the .chm::/, this should be included in the alias if it exists. For example:

mk:@MSITStore:C:\Programming\RadASM3\Help\GoAsm.chm::/GoAsm.htm#size

The entry for this would look like:

align=GoAsm.htm#size

Note that you should never use any upper case letters on the left side of the = operator, the keyword will not be found if you do. Also, the use of the "dot" (.) will cause the search to fail as RadAsm does not pass the dot with the keyword to the addin.

A note about line 1 of the KWL files: Line 1 is used to identify the assembler associated with the collection if there is one. For example to separate invoke for GoAsm and Masm the assembler name is included on line 1 and when Masm is being used it will find the Masm version and vice-versa. If there is no assembler to associate directly with the collection then you can put anything in Line 1 (except an assembler name) since it is ignored. The collection name is derived from the KWL file name.

NEVER use quotes in a KWL file, it will cause the addin to fail.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

WillASM

Thanks Edgar  :cheekygreen:

Working great here without any problems!

donkey

Quote from: WillASM on April 18, 2011, 07:38:47 PM
Thanks Edgar  :cheekygreen:

Working great here without any problems!

Thanks WillAsm,

I have decided that the current version is a release version since there have been no bug reports to date. I have cleaned up the code a bit as well as the interface. I also corrected some grammatical and spelling errors in the messages. There is a new upload at the link in the first post, if all goes well it will be the last one for a while. The addin should work from Windows 98 (IE4) though I have no way of testing it below XP, the API's were chosen for compatibility so I'm hoping there are no issues.

The file size has been reduced to 337 KB, not terrible for an addin with source. I have left out the help files that were accompanying it and provided a list of links in a text file for the recommended files to use with the addin. Sqlite3.dll is still included with the source. Thanks to all who have downloaded and tested it, especially WillAsm who seems to be the only one who bothered to respond.

Edgar
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable