News:

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

Main Menu

MasmBasic

Started by jj2007, May 23, 2012, 10:16:07 PM

Previous topic - Next topic

zedd151

Quote from: jj2007 on June 21, 2023, 06:09:32 AM
That should work fine, but it's a debug edition.
Yerp, it appears to be working alright.


Building an example there prompts to install Uasm64? hrumph ... okay I see the examples in Masm64 folder. lol I don't have Masm64 on this OS, its 32 ...  :biggrin:

zedd151

Quote from: jj2007 on June 21, 2023, 06:29:39 AM
It expects to find \Masm32\bin\uasm64.exe
Well crap. Lemme through 64 bits into another partition.... will only take a few minutes ...

zedd151

Okee dokee Windows 10- 64 is being installed as I speak... takes a while longer than plonking a fresh copy of Windows 7 into the box.

jj2007

You install Win10? That's an overkill, my friend...

No need for a Masm64 folder, it works fine with what you have already. However, it expects \Masm32\bin\UAsm64.exe, and I just see that you have a 32-bit OS :rolleyes:

Solution: make a copy of your UAsm32.exe and call it UAsm64.exe :cool:

https://www.terraspace.co.uk/uasm.html#p2 is the download link, in case you don't have UAsm at all. You need the 32-bit version, and it must be renamed to UAsm64.exe to work. That's a bug or a missing feature with RichMasm, because I haven't seen a 32-bit Windows version for quite some time ;-)

zedd151

Yup, I install w10  (from disk image backup) only when needed. I cannot find atm the image for 7/64...  :biggrin:

zedd151

Had to go and walk the dog while reinstalling Win 10. But I got er done.  :biggrin:
Aw, c'mon now... polink???  :tongue:  Lemme fetch a copy  :rolleyes:

zedd151

Alright everything is working okay here now.  :biggrin:  If I can only remember now, what file I wanted to look at that was a MB (asc) source.  :tongue:
RichMasm seems a bit 'busy' for my taste - btw.

I am going to make a backup copy (of the partition) with the MasmBasic Dev environment set up in it. Just in case the need for it ever arises. I know that at times, you post some interesting sources... now I'll head back over to Windows 7   :cool:


Okay, now I am back on Windows 7  :biggrin: . How would I configure RichMasm to better suit my needs, as far as appearance, fonts, etc?

jj2007

- For fonts, check FaceSrc=... etc in \Masm32\MasmBasic\Res\RichMasm.ini (may be overwritten at next install, so save a copy)
- You can zoom the font with Ctrl + mousewheel. Save your setting with Alt Z
- Press Ctrl G, then type behind the Goto: prompt udc=n, where n=0...9

Quote from: zedd151 on June 21, 2023, 07:18:50 AMRichMasm seems a bit 'busy' for my taste

I don't understand - what do you mean?

zedd151

Quote from: jj2007 on June 21, 2023, 09:58:50 AM
- For fonts, check FaceSrc=... etc in \Masm32\MasmBasic\Res\RichMasm.ini (may be overwritten at next install, so save a copy)
Oh, there's an ini file. I missed that. I'll take a look at this later...

jj2007

Hi Z,

New version should fix all your issues:
- accepts \Masm32\bin\UAsm32.exe
- uses the old Instr() algo if the Cpu is below SSE 4.2

Plus, it has a new macro (heavily inspired by NoCForMe - thanks :thup:):

DrawMyRect proc hDC
Local hBrush, whatever
  CreateAndSelect(hDC) ; one arg: set the DC (right after the locals)
  mov hBrush, CreateAndSelect(brush, Blue) ; the hBrush is not really needed
  invoke Rectangle, hDC, 3, 3, 202, 78
  void CreateAndSelect(brush, LiteYellow)
  invoke Rectangle, hDC, 9, 9, 196, 72
  invoke SetBkMode, hDC, TRANSPARENT
  casThrowErrors=1 ; now try bitmap instead of font v v v
  void CreateAndSelect(font, addr MyFont)
  invoke TextOut, hDC, 20, 18, fTime$(), 9
  ReleaseObjects ; no leaks please ;-)
  ret
DrawMyRect endp


First argument of CreateAndSelect can be bitmap, brush, font or pen (case-insensitive).

Project attached.

zedd151

Quote from: jj2007 on June 24, 2023, 11:25:51 PM
Hi Z,

New version should fix all your issues:
Project attached.
You really didn't have to, but thanks. As said before I will look at MasmBasic later on, when I have enough time to delve in to the macros there and other 'masm basic' specifics. It's like learning a new language (probably like Mandarin  :greensml: ) either way it's mostly Greek to me at this point. Will take some time...  :cool:

zedd151

Quote from: jj2007 on June 24, 2023, 11:25:51 PM
Project attached.
57 kb example exe?  :dazzled:  How big is the runtime library contained within?  :tongue:
It works as advertised of course, and no leaks. Surely I have adequate memory for this behemoth example.  :biggrin:

jj2007

Quote from: zedd151 on June 24, 2023, 11:46:07 PMIt's like learning a new language

It adds macros and routines to Masm32. Practically all the sources in \Masm32\Examples build fine by simply hitting F6 in RichMasm. It's a bit like moving from "old" assembly to SIMD assembly - you add new features.

Quote from: zedd151 on June 24, 2023, 11:50:11 PM
Quote from: jj2007 on June 24, 2023, 11:25:51 PM
Project attached.
57 kb example exe?  :dazzled:  How big is the runtime library contained within?  :tongue:
It works as advertised of course, and no leaks. Surely I have adequate memory for this behemoth example.  :biggrin:

\masm32\MasmBasic\Res\MiniWin.asc builds a 34kB exe, which is about the minimum. That's a lot compared to the 1,024 bytes examples, but it also means features such as Recall.

For comparison, a standalone QT "hello World" is 8MB :cool:

zedd151

Quote from: jj2007 on June 25, 2023, 12:29:57 AM
For comparison, a standalone QT "hello World" is 8MB :cool:
:rofl:  okay, good point.  :biggrin:
Still, it will take me some time to digest all of the 'new' things there. In due time...
I've installed the latest version of MasmBasic (I thought I'd never say that again  :tongue: )  , Uasm and put polib back into the bin folder.
Succesfully assembled an example from Masm32 SDK examples. :thumbsup:

'Select proc or macro' does not select proc or macro.   :tongue:  I wanted to see that work, since you had mentioned that recently.

Quote from: jj2007 on June 22, 2023, 03:50:50 AM
Quote from: zedd151 on June 22, 2023, 12:48:48 AMto right click a selected procedure name anywhere in the source and click 'go to procedure' or 'select procedure'. 


I can confirm that this is a very useful feature

jj2007

Quote from: zedd151 on June 25, 2023, 12:35:18 AM'Select proc or macro' does not select proc or macro

You must select the word proc or the word macro, then you right-click.

Another minor "bugfix" (it's not a bug, actually) concerning Instr_(haystack, needle):
.if Instr_(esi, "test")
  ...


That always worked fine. However, the old "below SSE 4.2" algo returned, if nothing was found, a pointer in eax. So, if you were clever and used, for some odd reason...
void Instr_(esi, "test")
.if eax
  ...

... that gave the wrong answer, because the found/not found is being returned in edx, while eax points at the result if one is found. In the previous version, eax pointed at haystack-1 if nothing was found, so .if eax failed. I fixed it, now eax is zero for no match.