The MASM Forum

General => The Campus => Topic started by: daydreamer on December 02, 2022, 09:52:25 AM

Title: i need script advice
Post by: daydreamer on December 02, 2022, 09:52:25 AM
I want add things to make.bat or separate .bat
Usual is commands to assemble .asm file
Seen delete commands if previous .obj and .exe exists
I dont know to make copy of .asm file and rename it to .txt file in .bat file ?
Is possible?

Is it possible do this also with
Sourcecode\ folder together with all subfolders ,each an asm project folder ,type something in console ?

Title: Re: i need script advice
Post by: zedd151 on December 02, 2022, 11:08:21 AM
easy peasy, use the 'copy' command

copy filename.asm filename.txt


Can be added to the makeit.bat (or whatever batch file name) file, and will make the copy when assembling. I tested it on the 'minimum' example from Masm32 SDK before posting this. It copied 'minimum.asm to minimum.txt' without any problem.
Title: Re: i need script advice
Post by: zedd151 on December 02, 2022, 11:26:43 AM
Quote
Is it possible do this also with
Sourcecode\ folder together with all subfolders ,each an asm project folder ,type something in console ?


Do you mean a recursive copy of all .asm files to .txt files, included in sub folders as well? Would probably be better to investigate using 'xcopy' as that is a bit more involved than the simple 'copy' example I gave above.

It's been a long time since I have used those commands.
Title: Re: i need script advice
Post by: daydreamer on December 02, 2022, 11:52:36 PM
Thanks zedd :thumbsup:
I added copy "x.asm x.txt"to makeit.bat after all ifs that check for assembly error and link error
Going to create revert.bat in same folder
Copy "x.txt x2.asm"
Now i can edit code in any text editor on any device i have
Found out my Samsung tablet also had simple text editor "db text editor"

Title: Re: i need script advice
Post by: Vortex on December 03, 2022, 04:54:57 AM
Hi daydreamer,

A very good tool for advanced scripting :

https://frippery.org/busybox/

QuoteBusyBox is a single binary that contains many common Unix tools. It's often found in embedded Linux systems like routers, in Android smartphones, in Linux containers and anywhere else it would be handy to have a compact set of Unix command line tools.

busybox-w32 is a port of BusyBox to the Microsoft Windows WIN32 API. It brings a subset of the functionality of BusyBox to Windows in a single self-contained native executable.