Author Topic: How to get the command line?  (Read 425 times)

learn64bit

  • Member
  • **
  • Posts: 128
How to get the command line?
« 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!

zedd151

  • Member
  • *****
  • Posts: 1583
Re: How to get the command line?
« Reply #1 on: September 27, 2022, 03:16:05 AM »
Using MasmBasic Help
@learn64bit... I don't use RichMasm or MasmBasic myself but that link should help you.
Nugget and Gypsy Youtube channel. New videos twice a week or so. If you like the videos, please subscribe and comment.  :biggrin:

learn64bit

  • Member
  • **
  • Posts: 128
Re: How to get the command line?
« Reply #2 on: September 27, 2022, 03:28:11 AM »
Nope. Don't read it. It is something else.

zedd151

  • Member
  • *****
  • Posts: 1583
Re: How to get the command line?
« Reply #3 on: September 27, 2022, 03:49:23 AM »
It is something else.
Okay then. I'm sure jj2007 can help you with whatever issue you are having.
Nugget and Gypsy Youtube channel. New videos twice a week or so. If you like the videos, please subscribe and comment.  :biggrin:

jj2007

  • Moderator
  • Member
  • *****
  • Posts: 13284
  • Assembly is fun ;-)
    • MasmBasic
Re: How to get the command line?
« Reply #4 on: September 27, 2022, 04:44:44 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$()
3. in case you want to bypass RichMasm's F6 build process, put ; OPT_Batch whatever.bat

This example combines 1+2:

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

OPT_Arg1 Hello World, how is the weather today?
Masm32 Tips, Tricks and Traps

Some members can't live without insulting others. It tells us a lot about them.

learn64bit

  • Member
  • **
  • Posts: 128
Re: How to get the command line?
« Reply #5 on: September 27, 2022, 05:20:27 AM »
I am playing with the "m" and "t" of unicode encoded character's font.

learn64bit

  • Member
  • **
  • Posts: 128
Re: How to get the command line?
« Reply #6 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".

jj2007

  • Moderator
  • Member
  • *****
  • Posts: 13284
  • Assembly is fun ;-)
    • MasmBasic
Re: How to get the command line?
« Reply #7 on: September 27, 2022, 05:43:01 AM »
I just want to make a BATCH file for the ".asm".

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

OPT_Batch test.bat tmp_file.asm

Code: [Select]
echo This is test.bat
echo arguments [%1] [%2] [%3]
type %1
echo bye
Masm32 Tips, Tricks and Traps

Some members can't live without insulting others. It tells us a lot about them.

learn64bit

  • Member
  • **
  • Posts: 128
Re: How to get the command line?
« Reply #8 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.

jj2007

  • Moderator
  • Member
  • *****
  • Posts: 13284
  • Assembly is fun ;-)
    • MasmBasic
Re: How to get the command line?
« Reply #9 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.
Masm32 Tips, Tricks and Traps

Some members can't live without insulting others. It tells us a lot about them.

learn64bit

  • Member
  • **
  • Posts: 128
Re: How to get the command line?
« Reply #10 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

jj2007

  • Moderator
  • Member
  • *****
  • Posts: 13284
  • Assembly is fun ;-)
    • MasmBasic
Re: How to get the command line?
« Reply #11 on: September 27, 2022, 10:11:37 AM »
Congrats :thumbsup:

As an alternative, drag the *.asc file over the attached batch file.
Masm32 Tips, Tricks and Traps

Some members can't live without insulting others. It tells us a lot about them.