News:

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

Main Menu

How to use the 'echo' command in MASM

Started by megavlad, May 04, 2025, 09:11:00 AM

Previous topic - Next topic

megavlad

Quote from: NoCforMe on May 05, 2025, 04:14:54 AMSo were you able to solve your MSVC problem?

No, I haven't. The test code outputs the message from the command line. When testing within the IDE, there is no message to the output pane.

Quin

Quote from: megavlad on May 05, 2025, 04:17:49 AM
Quote from: NoCforMe on May 05, 2025, 04:14:54 AMSo were you able to solve your MSVC problem?

No, I haven't. The test code outputs the message from the command line. When testing within the IDE, there is no message to the output pane.
I wonder if the IDE's output pane is grabbing stdout and just dropping it on the floor? From what I can tell, echo prints to stdout.
I haven't used visual studio in years, but what if you try echoing text like this?
Quoteecho test.asm(1) : Hello from MASM!
adjust it to be formatted how your visual studio actually outputs warnings/errors/etc.

megavlad

Quote from: Quin on May 05, 2025, 05:33:08 AM... what if you try echoing text like this?

echo test.asm(1) : Hello from MASM!

I'm not following. Do you mean to insert that literally in the code? I tried it on the command line and it just outputs that literal string. From the IDE, still doesn't work.

sinsi

The only way I could get the assembler to echo anything was from a terminal window (right-click project).
Output and Immediate windows show nothing.

zedd

#19
Quote from: sinsi on May 05, 2025, 07:22:58 AMThe only way I could get the assembler to echo anything was from a terminal window (right-click project).
Output and Immediate windows show nothing.
Maybe there is a setting, option, or flag to enable using it?
How about with 32 bit code, does it work then? Perhaps ChatGPT was correct in certain contexts/usage of 'echo'.

I thought it (Visual xxx IDE) was using the output of StdOut.
:biggrin:  :skrewy:

Quin

Quote from: megavlad on May 05, 2025, 06:00:15 AM
Quote from: Quin on May 05, 2025, 05:33:08 AM... what if you try echoing text like this?

echo test.asm(1) : Hello from MASM!

I'm not following. Do you mean to insert that literally in the code? I tried it on the command line and it just outputs that literal string. From the IDE, still doesn't work.
Don't worry about it, it was a very naive possible workaround, I thought if you formatted text sent to stdout like an error message/other message from the assembler it might not get dropped by VS when echoing, but I guess not. Was worth a shot I suppose.

zedd

How about ensuring 'echo' is actually on first?


echo on
echo This is Echoed

Another try at a naive workaround.  :biggrin:

I might have to download it myself to try to find a solution...

megavlad, you say you are using MSVC. (IDE I assume.)

What is the actual name of the IDE itself?  I had never heard of MSVC other than Microsoft Visual C.  Probably can get that from the about box.
:biggrin:  :skrewy:

megavlad

Quote from: zedd on May 05, 2025, 08:01:42 AMWhat is the actual name of the IDE itself?  I had never heard of MSVC other than Microsoft Visual C.  Probably can get that from the about box.

MSVC is the common abbreviation of "Microsoft Visual C++". I use the latest community version: 2022

sinsi

@zedd, in this context ECHO is a MASM directive and has nothing to do with a batch file.

There is one way of getting it to show in the Output window but it's a bit crap :biggrin:
QuoteTools->Options->Projects and Solutions->Build and Run
From the "MSBuild project build output verbosity" dropdown box, choose the "Detailed" option
Unfortunately you have to scroll through pages of output (over 1000 lines) to see it, although you can control-f and find it, so you might want to use a keyword to search for.

zedd

Quote from: sinsi on May 05, 2025, 08:58:04 AM@zedd, in this context ECHO is a MASM directive and has nothing to do with a batch file.
Yes, I realize that. I always use a batch file to assemble my projects though. Easiest way too, to see the output.  :biggrin:

I just wanted to test whether 'echo' worked while using ml64. Mission accomplished.

As far as the setting being buried, that doesn't surprise me.
:biggrin:  :skrewy:

zedd

Quote from: megavlad on May 05, 2025, 08:57:45 AMMSVC is the common abbreviation of "Microsoft Visual C++". I use the latest community version: 2022
Okay. You use Visual C++, and its IDE. As opposed to Visual Studio, or Visual Code... or whatever other names they use now.

Anyway, I don't think I'll be downloading any of them any time soon.  :biggrin:
:biggrin:  :skrewy:

megavlad

Quote from: sinsi on May 05, 2025, 08:58:04 AMThere is one way of getting it to show in the Output window but it's a bit crap :biggrin:
QuoteTools->Options->Projects and Solutions->Build and Run
From the "MSBuild project build output verbosity" dropdown box, choose the "Detailed" option
Unfortunately you have to scroll through pages of output (over 1000 lines) to see it, although you can control-f and find it, so you might want to use a keyword to search for.



Earlier, when I was searching for a fix, I came a across a similar suggestion from this site:
https://www.codeproject.com/articles/1080585/something-you-may-not-know-about-the-macro-in-masm

That author is using MASM32. But, I did try it myself but it didn't work for 64bit.

In your case, were you able to actually get it to show up on the output, or are you speculating?

sinsi


megavlad

I tried the same code as you, with various output levels, but nothing. Weird.

Thanks for confirming.