News:

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

Main Menu

RichMasm new features suggestions

Started by LordAdef, February 26, 2018, 08:42:20 AM

Previous topic - Next topic

LordAdef

Hi Jochen,

Made this thread so I could leave suggestions for future implementation.

To start the series, here it goes one:

Split screen like emacs:
https://www.google.com.br/search?q=emacs&client=firefox-b&dcr=0&source=lnms&tbm=isch&sa=X&ved=0ahUKEwifo-ncg8LZAhUI7lMKHbEuBngQ_AUICigB&biw=1408&bih=703#imgrc=Ukd8zJQbknsp6M:

Pressing a shortcut, the screen is split so you can have the code in two columns (you can code in both). Very useful !

Since asm is a vertical language, this is a nice feature for a asm IDE.

jj2007

Quote from: LordAdef on February 26, 2018, 08:42:20 AMSplit screen like emacs
...
Since asm is a vertical language, this is a nice feature for a asm IDE.

Select a block of code and press Ctrl F12.

Re vertical language, yes, that's why the menu is integrated into the caption - one line of code more to see. But with proper comments, it becomes pretty horizontal ;)

LordAdef

Yep, but ctrl f12 gives me only a picture of the selected code. In emacs, you can code in both windows, scroll it etc


I believe f12 is a different horse right?

jj2007

Yes, it's a different horse - only a small zone that permits you to see e.g. the elements of a structure definition.
If you want to code in different places, use the bookmarks, the search listbox, or use the Alt arrow left / arrow right coding history. For me, Alt arrow right is perhaps the feature that I use most frequently.

jj2007

Attached a RichMasm beta - use at your own risk. Main new feature:

I was chasing a bug, and it was one of the rare occasions where only the LST file could point me to a solution. And it was about 33 MB, a pain in the neck: Open, wait, search, wait, ...

So I decided to integrate this into the RichMasm IDE. What happens now is as follows:

- RichMasm tries to build the source, for example \Masm32\examples\exampl04\jacts\jacts.asm
- it finds an Error A2006: undefined symbol : rMins in line 958

@@: invoke dwtoa, rhours.dwLowDateTime, addr dhours
    invoke dwtoa, rMins, addr dmins ; OPT_DebugA /Fl   ; this is line 958


The OPT_DebugA /Fl tells RichMasm to generate a lst file. Now the new feature:

- RichMasm opens the lst file, finds Error A2006 and appends an 8-lines excerpt to the output window:
0000141B  E8 00000116    *     call   dwtoa
    invoke dwtoa, rMins, addr dmins ; OPT_DebugA /Fl
tmp_file.asm(958) : error A2006: undefined symbol : rMins
tmp_file.asm(958) : error A2114: INVOKE argument type mismatch : argument : 1
00001420  8D 45 CF    *     lea    eax, byte  ptr ss:[ebp]+0CFh
00001423  50    *     push   eax
00001424  E8 0000010D    *     call   dwtoa
    invoke dwtoa, rsecs, addr dsecs


Now this example is trivial, you would understand already from the 'simple' error message where the problem sits. But in more complex settings, there is no other way than to consult that 30MB LST monster.

LiaoMi

Quote from: jj2007 on September 30, 2018, 02:39:24 AM
Attached a RichMasm beta - use at your own risk. Main new feature:

I was chasing a bug, and it was one of the rare occasions where only the LST file could point me to a solution. And it was about 33 MB, a pain in the neck: Open, wait, search, wait, ...

So I decided to integrate this into the RichMasm IDE. What happens now is as follows:

- RichMasm tries to build the source, for example \Masm32\examples\exampl04\jacts\jacts.asm
- it finds an Error A2006: undefined symbol : rMins in line 958

@@: invoke dwtoa, rhours.dwLowDateTime, addr dhours
    invoke dwtoa, rMins, addr dmins ; OPT_DebugA /Fl   ; this is line 958


The OPT_DebugA /Fl tells RichMasm to generate a lst file. Now the new feature:

- RichMasm opens the lst file, finds Error A2006 and appends an 8-lines excerpt to the output window:
0000141B  E8 00000116    *     call   dwtoa
    invoke dwtoa, rMins, addr dmins ; OPT_DebugA /Fl
tmp_file.asm(958) : error A2006: undefined symbol : rMins
tmp_file.asm(958) : error A2114: INVOKE argument type mismatch : argument : 1
00001420  8D 45 CF    *     lea    eax, byte  ptr ss:[ebp]+0CFh
00001423  50    *     push   eax
00001424  E8 0000010D    *     call   dwtoa
    invoke dwtoa, rsecs, addr dsecs


Now this example is trivial, you would understand already from the 'simple' error message where the problem sits. But in more complex settings, there is no other way than to consult that 30MB LST monster.

My RichMasm file is deleted by antivirus  :( Is there a proper manifest file in the project?

jj2007

#6
There is, but it is UPXed, so Windows doesn't see the manifest. I think the UPX guys should allow to add a manifest to the UPXed executable, so that clever virus writers can demonstrate to Windows and the AV brigade that they are honest coders 8)

Try the attached "full" version (updated). In any case, as an assembler coder you should be stronger than your AV :P

LiaoMi

Quote from: jj2007 on September 30, 2018, 05:15:50 AM
There is, but it is UPXed, so Windows doesn't see the manifest. I think the UPX guys should allow to add a manifest to the UPXed executable, so that clever virus writers can demonstrate to Windows and the AV brigade that they are honest coders 8)

Try the attached "full" version. In any case, as an assembler coder you should be stronger than your AV :P

It is clear that the detection is false, another question is why it happens, and it's just a little annoying that every time you need to add new files to the exceptions. UPX fails, probably many other packers also cause inadequate response, there's nothing you can do about it, except, follow the simple rules for creating applications like a manifest for example. I will be stronger and I want to add the whole folder to the exceptions  :t Antivirus is crap, but the first defense against scripts on the Internet  :(

---------------------------
Fatal error:
---------------------------
Could not open
C:\masm32\MasmBasic\Res\MenusRM.ini
for FileRead$ etc.


---------------------------
OK   
---------------------------


jj2007

Oops, old menus :(
I've updated the attachment above (now RmBeta.zip); in any case, building requires the full MasmBasic installation. Don't worry, it just adds the MasmBasic folder to \Masm32\, no writing to the registry etc. Make sure you unzip the ReTest.exe in RmBeta.zip to the \Masm32\MasmBasic folder.

LiaoMi

Quote from: jj2007 on September 30, 2018, 09:10:31 AM
Oops, old menus :(
I've updated the attachment above (now RmBeta.zip); in any case, building requires the full MasmBasic installation. Don't worry, it just adds the MasmBasic folder to \Masm32\, no writing to the registry etc. Make sure you unzip the ReTest.exe in RmBeta.zip to the \Masm32\MasmBasic folder.

I follow the development and usually I have the latest version. For the test, I downloaded the latest version again and installed again, I get the same message without changes. In that folder there is a file menus.ini, I renamed it and everything started as it should. I think you have an old installer in the topic =) Otherwise I can not explain where this file is  :biggrin:

Quote°BIUser-defined defaults
You may copy the following files from \masm32\MasmBasic\Res to \masm32\MasmBasic\Res\UserDef:
menus.ini   contains settings for [System Apps], [&Help] and [AutoCode]
Keywords.ini   contains the translation of keystrokes to full commands, e.g. ism -> invoke SendMessage,
RichMasm.ini   see above, editor options
bldallRM.bav   default OPT_ settings
bldallRM.bax   the batch file template

In addition, the problem with anti-virus detection's exists in many examples, after the assembly process. Most likely some small part of the code is detected. There is clearly nothing to change, because you need to write to antivirus offices to report a fake detection.

Quote---------------------------
Can't open:
---------------------------
Res\RichMasmGuide.asc

---------------------------
OK   
---------------------------

Very strange, I checked the file and it is in place!  :icon_eek: It happened after I accidentally inserted a messagebox auto code, and then closed the file without saving.

Quote** Start C:\masm32\MasmBasic\Res\bldallRM.bat **
**** 32-bit assembly ****

*** Assemble, link and run MiniWin ***

*** Assemble using \masm32\bin\UAsm64 /c /coff  tmp_file.asm ***
UASM v2.46, Dec  8 2017, Masm-compatible assembler.
Portions Copyright (c) 1992-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.

*** MasmBasic version 25.12.2017 ***
## ToolTips: no hInstance found
using  wc.hInstance  instead ##
Tmp_File.asm: 122 lines, 3 passes, 97 ms, 0 warnings, 0 errors

*** Link  MiniWin.obj rsrc.res  using polink, sub WINDOWS ***

***  build all took 2786 ms  ***
« OK »

I decided to repeat the experiment, I did everything the same way, the MiniWindow is no longer detected by the antivirus. After much experimentation, I realized what the problem of unstable work is, I always installed new versions on the old, without a new full reinstall. I deleted everything, installed it on a new one, and the problems disappeared  :eusa_boohoo:  :biggrin:

Here I have uploaded my old version with the new one installed on top, as proof of unstable work under such conditions - https://mega.co.nz/#!Y1QCASCR!AAAAAAAAAADtcf2CXS-IpwAAAAAAAAAA7XH9gl0viKc

I tried to compile two projects, the second one compiled well, to cause an error I changed the command "Jb - J". The problem is that the window with an error from the previous project is not closed. The first project is a file - MessageBox.asc, it's probably just a template, however, this results in the window not closing. The second project is jacts.asm, everything works well there. 



Tmp_File.asm(957) : Error A2102: Symbol not defined : rrmins
Tmp_File.asm(957) : Error A2147: Too few arguments to INVOKE: dwtoa
Tmp_File.asm: 1132 lines, 2 passes, 68 ms, 0 warnings, 2 errors
*** Assembly Error ***


The trick with the lst file has not yet repeated, I need to activate the OPT_DebugA /Fl option  ::)

jj2007

Thanks a lot for the feedback! I will need time to digest all that, and today I am busy with real life. Btw if the right corner of the listbox is near the Find: string in the upper right corner, and relatively small (10...15 matches), the output window will be put below the listbox, and you can see it a bit better. The result of the LST file examination appears under *** Assembly error, if /Fl is active.

LiaoMi

Quote from: jj2007 on September 30, 2018, 07:30:36 PM
Thanks a lot for the feedback! I will need time to digest all that, and today I am busy with real life. Btw if the right corner of the listbox is near the Find: string in the upper right corner, and relatively small (10...15 matches), the output window will be put below the listbox, and you can see it a bit better. The result of the LST file examination appears under *** Assembly error, if /Fl is active.

Where is it better to specify this option? If I use it at the beginning of the source code, then the main response message is overwritten with characters..
*« OK »
I have read the detailed description:
QuoteSet options directly in your source code - note you may not need any of these!
The default settings are usually ok, so try first to assemble & run without any options.
If you believe you do need one, copy the whole line below and paste it at the end
of your source code, below end start. If you want the options higher up, comment
them out with the F4 key - RichMasm will still find them anywhere in your code.

In response, I received a message:
** Start C:\masm32\MasmBasic\Res\bldallRM.bat **
**** 32-bit assembly ****

*** jacts.rc not found, will try rsrc.rc ***

*** Assemble, link and run jacts ***

*** Assemble using \masm32\bin\UAsm64 /c /coff  tmp_file.asm ***
UASM v2.46, Dec  8 2017, Masm-compatible assembler.
Portions Copyright (c) 1992-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.


***********
ASCII build
***********

Tmp_File.asm(957) : Error A2102: Symbol not defined : rminsa
Tmp_File.asm(957) : Error A2147: Too few arguments to INVOKE: dwtoa
Tmp_File.asm: 1132 lines, 2 passes, 61 ms, 0 warnings, 2 errors
*** Assembly Error ***


I realized that I need to use ml, I added such lines to the end of the source - OxPT_Assembler ml, now we have these lines

OxPT_Assembler ml
OPT_DebugA <- This line was commented first. 


During assembly nothing has changed, uasm64 is used. I added lines to the beginning of the source code and decided to comment them out. I chose the second option first - OPT_DebugA, next second comment (but first in the editor) " OxPT_Assembler ml" did not want to look like a comment  :biggrin: I pressed F4 key twice, because of these actions, I activated a new mode of operation, source code disappeared from view:


After pressing twice F4 again, I returned the last view, text line "OxPT_Assembler ml" disappeared, I pressed enter, and decided to enter OxPT_Assembler ml line again, from the second line, the comment worked. An error in the program is noticeable in the fact that the first line in the editor does not allow pressing the F4 button, putting the editor into god mode  :eusa_dance: :biggrin: Finally, I failed to switch to macro assembler  :redface:

Thanks Jochen! Have a great weekend!

jj2007

When the output window shows only *« OK » it means that the batch file had a problem. I've had that a couple of times, sometimes related to spaces in filenames.

The x in OxPT_Assembler ml simply prevents the parser from recognising it as an OPTion. Use OPT_Assembler ml to activate it. And yes, you noticed correctly that UAsm does not reproduce this kind of error in the LST file; ML does.

LiaoMi

Quote from: jj2007 on October 01, 2018, 01:11:46 AM
When the output window shows only *« OK » it means that the batch file had a problem. I've had that a couple of times, sometimes related to spaces in filenames.

The x in OxPT_Assembler ml simply prevents the parser from recognising it as an OPTion. Use OPT_Assembler ml to activate it. And yes, you noticed correctly that UAsm does not reproduce this kind of error in the LST file; ML does.

:t everything is working! Thanks Jochen!

** Start C:\masm32\MasmBasic\Res\bldallRM.bat **
**** 32-bit assembly ****

*** jacts.rc not found, will try rsrc.rc ***

*** Assemble, link and run jacts ***

*** Assemble using \masm32\bin\ml /c /coff /Fl tmp_file.asm ***
Microsoft (R) Macro Assembler Version 6.14.8444
Copyright (C) Microsoft Corp 1981-1997.  All rights reserved.

Assembling: tmp_file.asm

***********
ASCII build
***********

tmp_file.asm(960) : error A2006: undefined symbol : rminsa
tmp_file.asm(960) : error A2114: INVOKE argument type mismatch : argument : 1
*** Assembly Error ***


00001414 @@: invoke dwtoa, rhours.dwLowDateTime, addr dhours
    invoke dwtoa, rminsa, addr dmins ; OPT_DebugA /Fl
tmp_file.asm(960) : error A2006: undefined symbol : rminsa
tmp_file.asm(960) : error A2114: INVOKE argument type mismatch : argument : 1
    invoke dwtoa, rsecs, addr dsecs
    .if (def_acorr != 'P')
0000143E  C7 45 EC         mov rmsecs, 0
     00000000

jj2007

Great ;)

I wonder, though, why AsmC and UAsm do not flag certain errors in the LST file ::)