News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

MasmBasic without the RichMasm editor

Started by jj2007, July 29, 2020, 06:39:43 PM

Previous topic - Next topic

jj2007

Sometimes people wonder if MasmBasic can be used from Notepad or \Masm32\qEditor.exe. The short answer is yes, of course :cool:
Here is a little snippet (attached as *.asc = assembler source code and *.asm):



The same snippet as *.asm plain text in Notepad:



If you can convince Notepad to build this source with a batch file, no problem, it will generate exactly the same executable as the RichMasm source. Note also that attachments here in this forum that contain only the *.asc source can be opened in Wordpad, and saved as *.asm from there.

However, you should consider using RichMasm. It looks a bit different than most other IDEs, but it has many unique features that you might miss elsewhere:

- it remembers the last 8 positions where you have been in your source code; no problem for the 30-lines snippet above, but if your source is 5,000 lines with 100 procs, you may appreciate that feature
- it has bookmarks: select a text, press Ctrl D, and from then on you can jump there clicking into the bookmark; again, no big deal for small files, but my sources have lots of bookmarks
- the search list is incredibly useful; try searching \Masm32\MasmBasic\Res\MbSnippets.asc, a small 1,500 lines source
- RichMasm's recent files list has 25 entries (I need them all)
- the menu offers a bunch of features that are relevant only for Assembly
- among many other goodies, the keyboard shortcuts: type ism<space> to see invoke SendMessage,



I use most often deb4<space>. The complete list of more than 100 shortcuts is in \Masm32\MasmBasic\Res\Keywords.ini :cool:

jj2007

include \masm32\MasmBasic\MasmBasic.inc ; instead of masm32rt.inc
.code
start:
  print "hello world", 13, 10
  mov esi, InputFile("\Masm32\include\Windows.inc")
  deb 4, "returned: ", $esi:40
  inkey "looks like pure Masm32, but you can actually use the deb macro"
  exit
end start


Output:
hello world
returned:       $esi:40         ;;;; head____comment * -=-=-=-=-=-=-=-=- ..
looks like pure Masm32, but you can actually use the deb macro


Most of the time you can transform a Masm32 source into a MasmBasic source by simply modifying the include \masm32\include\masm32rt.inc line - for example to get access to the deb macro when debugging a project.

If that is the only feature you want to use, you can make it absolutely reversible:
if 1   ; 1=use Masm32 SDK, 0=use MasmBasic
include \masm32\include\masm32rt.inc
deb MACRO args:VARARG
endm
else
include \masm32\MasmBasic\MasmBasic.inc
endif
.code
start:
  print "hello world", 13, 10
  mov esi, InputFile("\Masm32\include\Windows.inc")
  deb 4, "returned: ", $esi:40
  inkey "looks like pure Masm32, but you can actually use the deb macro"
  exit
end start