The MASM Forum

Projects => MasmBasic & the RichMasm IDE => Topic started by: learn64bit on September 27, 2022, 01:25:54 AM

Title: How to get the command line?
Post by: learn64bit on September 27, 2022, 01:25:54 AM
Hello, guys. I'm a RichMasm newbie, and I have a question.

I downloaded a ".asc" file. opened in "RichMasm". and saved as ".asm".
How can I get the RichMan's F6 command lines? Because I want to turn the ".asm" to ".exe".

Even a breakpoint in RichMan's process memory will help!
Title: Re: How to get the command line?
Post by: zedd151 on September 27, 2022, 03:16:05 AM
 Using MasmBasic Help (http://masm32.com/board/index.php?topic=9875.0)
@learn64bit... I don't use RichMasm or MasmBasic myself but that link should help you.
Title: Re: How to get the command line?
Post by: learn64bit on September 27, 2022, 03:28:11 AM
Nope. Don't read it. It is something else.
Title: Re: How to get the command line?
Post by: zedd151 on September 27, 2022, 03:49:23 AM
Quote from: learn64bit on September 27, 2022, 03:28:11 AM
It is something else.
Okay then. I'm sure jj2007 can help you with whatever issue you are having.
Title: Re: How to get the command line?
Post by: jj2007 on September 27, 2022, 04:44:44 AM
Quote from: learn64bit on September 27, 2022, 01:25:54 AM
Hello, guys. I'm a RichMasm newbie, and I have a question.

I downloaded a ".asc" file. opened in "RichMasm". and saved as ".asm".
How can I get the RichMan's F6 command lines? Because I want to turn the ".asm" to ".exe".

Even a breakpoint in RichMan's process memory will help!

Not sure what you are after, but I'll try:
1. in case you want to pass a commandline to the newly built exe, put somewhere in your code
  ; OPT_Arg1 Hello World
  (no ; needed if it's a the bottom of the file, after EndOfCode or end start)
2. in case you want to use the commandline in your program, see CL$() (https://www.jj2007.eu/MasmBasicQuickReference.htm#Mb1011)
3. in case you want to bypass RichMasm's F6 build process, put ; OPT_Batch whatever.bat

This example combines 1+2:

include \masm32\MasmBasic\MasmBasic.inc
  Init
  Inkey "The commandline: [", CL$(), "]"
EndOfCode

OPT_Arg1 Hello World, how is the weather today?
Title: Re: How to get the command line?
Post by: learn64bit on September 27, 2022, 05:20:27 AM
I am playing with the "m" and "t" of unicode encoded character's font.
Title: Re: How to get the command line?
Post by: learn64bit on September 27, 2022, 05:21:47 AM
limited, so another post...

Looks like what am I doing is not important.

I just want to make a BATCH file for the ".asm".
Title: Re: How to get the command line?
Post by: jj2007 on September 27, 2022, 05:43:01 AM
Quote from: learn64bit on September 27, 2022, 05:21:47 AMI just want to make a BATCH file for the ".asm".

include \masm32\MasmBasic\MasmBasic.inc
  Init
  Inkey "The commandline: [", CL$(), "]"
EndOfCode

OPT_Batch test.bat tmp_file.asm


echo This is test.bat
echo arguments [%1] [%2] [%3]
type %1
echo bye
Title: Re: How to get the command line?
Post by: learn64bit on September 27, 2022, 05:47:40 AM
You want me to change the JJ's ORIGINAL ".asm" file?
Can we keep it ORIGINAL? Just make a ".bat" or ".cmd" for it.

Just imaging I downloaded thousands ".asc" files, and saved as ".asm", now I need to make ".cmd" for each of them.
Title: Re: How to get the command line?
Post by: jj2007 on September 27, 2022, 06:06:26 AM
I really don't know what your intentions are...:

When you open an *.asc file and hit F6,
- RichMasm generates a tmp_file.asm
- and hands it over to a temporary batch file, \Masm32\MasmBasic\Res\bldallRM.bat
- when the build process is ok, tmp_file.exe gets renamed to YourFile.exe
- YourFile.exe runs (with commandlines, if OPT_Arg1 ... was set)

I have yet to see a source that does not build properly when hitting F6. What exactly is your problem? Seriously, why do you want to do all these acrobatics? Does F6 not work for any of your sources? If so, I need to know.
Title: Re: How to get the command line?
Post by: learn64bit on September 27, 2022, 06:09:59 AM
I just want to make BATCH file, so I don't need to open RichMan then press F6.

Do you mean I just use "\Masm32\MasmBasic\Res\bldallRM.bat", then use it for all ".asm"?
Then tell people the Usage: "\Masm32\MasmBasic\Res\bldallRM.bat" ".asm".
New question: when to use "MbMasm64.bat" and "bldallC.bat".

Looks good.


Looks I did it (CL.cmd and use \Masm32\MasmBasic\Res\bldallRM.bat[just added one "pause" line at end]):
@echo off
copy MakeFont.asm tmp_file.asm
bldallRM.bat tmp_file.asm
pause
Title: Re: How to get the command line?
Post by: jj2007 on September 27, 2022, 10:11:37 AM
Congrats :thumbsup:

As an alternative, drag the *.asc file over the attached batch file.