The MASM Forum

Projects => Rarely Used Projects => GoAsm => Topic started by: shankle on October 24, 2013, 06:54:22 AM

Title: Suggestion for the Boss
Post by: shankle on October 24, 2013, 06:54:22 AM
This suggestion is intended to be constructive and I hope it is taken in that light.
I have several hundred programs to change to 64-bit. I find myself going from "cedt.exe"
to a Dos window and back over and over again. Surely there is a better way.
There used to be a "Programmers Workbench" by Microsoft that did what I think
is needed. Comments please or tell me to shut up. 
Title: Re: Suggestion for the Boss
Post by: wjr on October 24, 2013, 10:15:55 AM
I think what you are looking for goes beyond what the Go Tools, with their typical command line nature, can provide. So you are the Boss in the selection of an Editor or IDE with features that can simplify your convert/build process. This also depends upon the complexity of your projects and the consistency in your source file naming, which may allow you to have a generic batch file that the Editor or IDE can use.

There most likely is a better way. For the one that you mentioned, if you really need a DOS window, are you using F10 to get there? Have you set up the Go Tools or a batch file in the Tool / Conf. User Tools... menu? Note the Capture Output option there, so you wouldn't need a pause at the end of a batch file.
Title: Re: Suggestion for the Boss
Post by: shankle on October 24, 2013, 01:12:42 PM
Thank you for responding WJR.
I have done non of the things you mention.

I use an icon on the desktop to compile the program. When it finds an error
I have to go back to cedt.exe to correct the error. Then back to the icon to
compile the program again etc. etc.
This is the method I have been using.
Title: Re: Suggestion for the Boss
Post by: wjr on October 24, 2013, 03:35:02 PM
There often are quite a few corrections along the way for a 64-bit conversion. One way to set up the assembly part for your editor is on that Tools / Conf. User Tools... dialog, select the first -Empty- slot for hot key Ctrl+1. Then set the following, for example:

Menu Text:   GoAsm x64
Command:   C:\Program Files (x86)\GoTools\GoAsm.exe
Argument:   /x64 $(FileTitle).asm
Initial Dir:   $(FileDir)
Also select Capture Output, then OK.

From there, pressing Ctrl+1 will assemble the current file that you are working on in the editor (the above assumes a file extension of asm) and display the GoAsm output within the editor.

You can do similar for GoRC (build a RES file for linker) and GoLink on the next slots:

Menu Text:   GoRC
Command:   C:\Program Files (x86)\GoTools\GoRC.exe
Argument:   /r $(FileTitle).rc
Initial Dir:   $(FileDir)

Menu Text:   GoLink
Command:   C:\Program Files (x86)\GoTools\GoLink.exe
Argument:   /debug coff $(FileTitle).obj $(FileTitle).res @Build.txt
Initial Dir:   $(FileDir)

With the above method using FileTitle, a build could be as easy as Ctrl+1 Ctrl+2 Ctrl+3 (if you name your RC file with the same Title as the ASM one). Note that Build.txt is a text file in your project directory that contains other GoLink command line options and the list of import DLLs (or you can type these out in the Argument field instead).

Another way, it sounds like you have on your desktop either a batch file, or a short cut to one, that is specific to your current project. You can do similar to the above, by pointing to this batch file in the Command field, and clearing the Argument field (unless batch file does something useful here with arguments).

Something like the above should make it a bit easier without having to switch between windows.
Title: Re: Suggestion for the Boss
Post by: shankle on October 24, 2013, 11:16:53 PM

       The sample you gave does not work for me. I get an error on GoTools.
       I did a search on GoTools and it is not in my computer.
       I will try to explain the GoAsm setup that exists in my computer:
       c: Windows
       D: GoAsm
       J: MASM32

       All items relating to GoAsm are in the D partition under GoAsm.
       In D:GoAsm I have placed all headers and programs in codejps.
       So cedt.exe runs in D:\GoAsm\codejps

       On the desktop I have created a Dos command line icon.
       When I click on that icon I key in the following:
          D:
          D:cd \codejps
          D:blahbtch

          blahbtch consists of the following:
            Set INCLUDE=d:\codejps 
            Set PATH=d:\codejps     
            GoAsm /x64/b/c xxxx64.asm
            GoLink /unused xxxx64.obj

       So where and how to I put GoTools in d:\codejps?
       Thank you.
Title: Re: Suggestion for the Boss
Post by: wjr on October 25, 2013, 03:11:40 AM
For the first method, change a portion of the Command field from the example "C:\Program Files (x86)\GoTools\"  to your "D:\GoAsm\" or "D:\GoAsm\codejps\".

For the second method, change the Command field using the "..." on the right and then in the Select File dialog choose your "blahbtch" file.

To fine tune your batch file, you can put "@echo off" on the first line so each command is not shown in the output. You could also make it more generic and instead of "xxxx64" use "%1" so the batch file would then require an argument which the editor would supply if you fill in the Argument field with "$(FileTitle)" and the Initial Dir as in the above.
Title: Re: Suggestion for the Boss
Post by: shankle on October 25, 2013, 05:22:47 AM

          blahbtch consists of the following:
            @echo off
            Set INCLUDE=D:\codejps 
            Set PATH=D:\codejps     
            GoAsm /x64/b/c %1.asm
            GoLink /unused %1.obj


    This is what    Preferences looks like in cedt.exe\tools
      user tool     GoAsm x64
      Menu Text     D:\GoAsm\codejps
      Argument      /x64 $(FileTitle).asm
      InitiaL Dir   $(FileDir)   
     
      x  Capture Output

   This gives "File Not Found"

   I don't know how to handle "FileTitle" and "FileDir"
   so they are variable each time I use a different program.
   How do I modify the Batch file to do this?

   Thanks for your help WJR
Title: Re: Suggestion for the Boss
Post by: FORTRANS on October 25, 2013, 05:37:56 AM
Hi,

   You could set up a BATch file to run your cedt.exe editor.
Use the $1 and %2 parameters to pass arguments as needed
Then go to the command prompt and alternate between the
editor and the assemble and link using the command history
supplied by the up or down keys.  Presto, almost no typing
outside the editor.  If you end up at the desktop, Alt-Tab back
to the command prompt.

Regards,

Steve
Title: Re: Suggestion for the Boss
Post by: wjr on October 25, 2013, 05:56:34 AM
For the first method, the Command field needs the program name as well, for example:

Command:   D:\GoAsm\codejps\GoAsm.exe

For the second method, you have modified the batch file with %1 so nothing left to do there. The editor needs to pass the %1 argument to the batch file, and this is done by setting:

Argument:   $(FileTitle)
Initial Dir:   $(FileDir)

exactly as you see it here. The editor treats $(FileTitle) and $(FileDir) as a variable depending upon which file you are currently editing and sets things accordingly.
Title: Re: Suggestion for the Boss
Post by: shankle on October 25, 2013, 07:43:19 AM

          blahbtch consists of the following:
            @echo off
            Set INCLUDE=D:\codejps 
            Set PATH=D:\codejps     
            GoAsm /x64/b/c %1.asm
            GoLink /unused %1.obj


    This is what preferences looks like in cedt.exe\tools
      user tool     GoAsm x64
      Menu Text     D:\GoAsm\codejps\GoAsm.exe
      Argument      /x64 $(FileTitle).asm
      InitiaL Dir   $(FileDir)   
     
      x  Capture Output

   This gives "File Not Found"

   Am unable to save the preferences I keyed in cedt.exe. Hitting save, apply
   doesn't work. I'm surely not expected to key them in each time.     
   Thanks
Title: Re: Suggestion for the Boss
Post by: wjr on October 25, 2013, 09:06:17 AM
For the "File Not Found", try the Command field using the "..." on the right and then in the Select File dialog choose where you have installed GoAsm.exe which may be "D:\GoAsm\GoAsm.exe" instead. To be sure, this should be for Command, not Menu Text as you have shown above.

You shouldn't need to key this in each time.
Title: Re: Suggestion for the Boss
Post by: shankle on October 25, 2013, 09:55:25 PM
Got it to work one time.
Seems the batch file is not necessary.

    MenuText     GoAsm x64
    Command     D:\codejps\GoAsm.exe
    Argument     /x64 $(FileTitle).asm
    Initial Dir     $(FileDir)

   Checks are in Close on exit,  Capture Output, Save before execution
   Clicking on "Save Tools" and loading it into my file called "Stools.cmd"
   gives "User Command 3.40"  (not what I keyed in preferences)
   The preferences is not saved for repeated executions.
Title: Re: Suggestion for the Boss
Post by: wjr on October 26, 2013, 10:35:21 AM
Correct, for the first method you do not need the batch file, you are telling the editor where to find the individual GoTool. However, a build is then 2 or 3 steps depending if you have a resource file. Fewer steps with the second method if you can get a slot set up for the batch file which assembles and links.

I didn't need to Save Tools... as it seems to keep adjustments with the current configuration, but if you did get something working and saved it, you should be able to Load Tools... to get that back (or if there is stuff there that doesn't work, select that slot and use Remove).
Title: Re: Suggestion for the Boss
Post by: shankle on October 26, 2013, 10:59:21 AM
The Crimson Editor forum is not functional. Reason Crimson Editor has been taken
over by Emerald Editor. Evidently there are bugs in the Preferences portion of
Crimson Editor and that's probably why I can't get it to work.
Please advise WJR on the use of Emerald Editor instead of Crimson Editor.

Thanks for all your help WJR.
Title: Re: Suggestion for the Boss
Post by: wjr on October 27, 2013, 03:14:11 AM
I would say that would be worth a try. If it works, you have a better ways of building and get to use an editor that I am assuming will be very similar to what you have (including the above Tool set up).

If not, given that it does not appear to be under active development, I would suggest trying to see if another editor would suite your needs even though there would be a bit learning curve to switch (again, worth trying if you have "several hundred programs" to work with). I use EmEditor and am quite pleased with it. For others with possible support here, under Project IDE there are child boards for RadAsm and Easy Code, which have GoAsm versions or add-ons.
Title: Re: Suggestion for the Boss
Post by: shankle on October 27, 2013, 07:07:58 AM
I looked at "EMEditor" and they sure don't want you to use the free version.
Cost is as ridiculous as Sandboxie. They could sell millions if the cost was $10 to 15.
Even if I spent the money, I still don't know if it would solve my going back and forth
from Cedt to the desktop.
On the other hand it scares me that I am using a product that is obsolete. The Emerald
Editor I find is also obsolete. I don't think Notepad would be of any value.
I am at a total loss for how to proceed.
Title: Re: Suggestion for the Boss
Post by: satpro on October 30, 2013, 05:19:32 AM
Hi Shankle,

You could try Notepad++.  It is an excellent tabbed editor that lets you work on as many files at a time as you want, simply switching tabs to get to the other open files.  Has save and save all, as well as an excellent search/replace capability, including finding/replacing in every open file or in EVERY file in that folder or sub-folder.  That is particularly good for renaming labels project-wide.

It has a command-line interface for running your batch file and the cli can be set to your current folder, so if you put GoAsm in a folder with the asm files it is very simple.  Lots of plug-ins, and built-in syntax highlighting for assembly which you can modify or add keywords, directives, etc.  Also, it has the ability to view the same file side by side and even synchronize the two, meaning you can run down either file in the same or different places within the file, and the edits are live on both sides.  Great for looking at the top of the file for something when you are working at the bottom and without having to scroll up and down all the time.

It is frequently updated and will really make you more productive.  Totally recommend it.
Title: Re: Suggestion for the Boss
Post by: Gunther on October 30, 2013, 07:05:22 AM
Hi shankle,

yes, notepad++ is a good editor. Another alternative is TEA. (http://tea-editor.sourceforge.net/downloads.html) It's available under Linux, too. You should use the Windows version.

Gunther
Title: Re: Suggestion for the Boss
Post by: shankle on October 30, 2013, 07:30:01 AM
Thanks guys for responding.
Yes, I have gone the "Notepad ++ route. It will  be a tad of a learning curve. Satpro you mentioned
a command line that I might be able to use my batch file in to compile the program. Will this also
list the errors at the bottom of notepad++?

As a side Satpro are your the same one that's on Satelliteguys?
Title: Re: Suggestion for the Boss
Post by: TWell on October 30, 2013, 06:09:49 PM
Needs least NppExec plugin form here (http://sourceforge.net/projects/npp-plugins/files/NppExec/) for commandline handling ?
Title: Re: Suggestion for the Boss
Post by: shankle on November 03, 2013, 05:25:51 AM
Notepad++ works very well and I am happy with it.
I have been playing with NPPexec for 2 days now trying to get a script
to work that will compile the program without leaving Notepad++.
I really don't want to spend 1 month learning how to use Nppexec.
Maybe some of you have experience with Nppexec and GoAsm and
would be inclined to help.
Title: Re: Suggestion for the Boss
Post by: satpro on November 06, 2013, 12:30:20 AM
Quote from: shankle on October 30, 2013, 07:30:01 AM
Thanks guys for responding.
Yes, I have gone the "Notepad ++ route. It will  be a tad of a learning curve. Satpro you mentioned
a command line that I might be able to use my batch file in to compile the program. Will this also
list the errors at the bottom of notepad++?

As a side Satpro are your the same one that's on Satelliteguys?
Shankle,

Sorry for not getting back to you but I have been out with torn knee tendons and most of my time has been spent in bed working on a different computer set up more for watching TV.  I just happened to stumble in here the other day to do some banking and stole a peek on this forum.  I did manage to squeeze in a half-mile marathon today, though.  Kind of a drag knowing you're not 25 anymore.  As for Satelliteguys, I was a satellite guy, but not one of those guys.  Wife & I had a DISH Network dealership until 2008.  Sold the business to campaign for Obama--it was that important at the time.

Below is a short GoAsm script from one of my projects.  If you are handy with the cli then you could put GoAsm and your .asm/.inc files anywhere and just set directories through commands, etc.  In my case I usually just throw a copy of GoAsm and GoLink in the same folder as the main .asm file and work from there, setting sub-folders from within the main file.  Yes, you will get the error messages, etc. in the NppExec sidebar that can be opened and closed right from the toolbar.

Something simple like this (e.g. "ec.bat") would give you "ec.exe":

cls
set INCLUDE=P:\Eclipse\Includes
GoAsm /l /b /c "ec.asm"
GoLink "ec.obj"


You can do it a million different ways but NPP has an option in the NppExec plugin to use the current directory when it runs your batch file, which will mean if the last tab you worked on was a file in that "Includes" folder it would throw a "Could not Open File" error, so in that case just click into a tab of a file located in the same folder as GoAsm before you assemble.

You can write the .bat file right in NPP.  Hope this helps some.
Title: Re: Suggestion for the Boss
Post by: shankle on November 06, 2013, 10:23:41 PM
Thanks Satpro for responding.
I have given up on "NPPEXEC". Will use my cumbersome method that works for me.
The man that wrote the docs for NPPEXEC expects me to decipher his documentation
to fit GoAsm. I was unable to do so.
In your last message what does "cli" mean?
Title: Re: Suggestion for the Boss
Post by: dedndave on November 07, 2013, 03:06:04 AM
CLI is an x86 instruction - CLear Interrupts (clears the interrupt flag, actually)

but, i think in this case, it stands for Command-Line Interface   :P
Title: Re: Suggestion for the Boss
Post by: satpro on November 12, 2013, 07:31:21 AM
Quote from: dedndave on November 07, 2013, 03:06:04 AM
CLI is an x86 instruction - CLear Interrupts (clears the interrupt flag, actually)

but, i think in this case, it stands for Command-Line Interface   :P
:t   Also a 6502/'816 instruction, but Dave wins.

Shankle,
NPPExec is easy to use.  What is giving you grief?  Maybe I can help--use it all the time.  BTW, I'll check back again soon--knees are getting well enough that my wife kicked me out of the BR and back into the office.  Now that she has great video & audio...
Title: Re: Suggestion for the Boss
Post by: shankle on November 12, 2013, 10:43:10 PM
Thank you Satpro for responding.
I below is the latest script file I tried. It gave so many errors that I gave
up and stopped wasting my time.
I installed the plugin "Nppexec"
All the GoAsm - header programs are in d:\codejps
I'm 100% green at this and this script is full of errors.

"D:\codejps\Notepad++\GoAsm.exe""$(FULL_CURRENT_PATH)"-run
"D:\codejps\Notepad++\GoLink.exe""$(FULL_CURRENT_PATH)"-run
set codejps=D:\codejps
cd $(codejps)
env_set INCLUDE=$(codejps)
env_set PATH=$(codejps)
GoAsm /x64/b/c"$(FILE_NAME)"
GoLink /unused"$(NAME_PART).obj"
Title: Re: Suggestion for the Boss
Post by: satpro on November 12, 2013, 11:54:24 PM
Oh, man, is that complicated.  I gave up on it, too.  About the only good I'll be for that is to advise you to try something a whole lot simpler.  My guess is that it's riddled with syntax errors or it's using something NPPExec, which is a lightweight implementation of the command line, doesn't know.

Make it easier, less busy.  Like one or two lines of very direct instruction.  That's why I throw a copy of GoAsm/GoLink right in with the .asm files wherever they are so I can use the current directory and go from there.  The goal is to write assembly code and not be bogged down with the other stuff, right?

Sorry I can't help, but that needs a CLI guy.
Title: Re: Suggestion for the Boss
Post by: shankle on November 13, 2013, 12:44:52 AM
Thanks satpro,
Agreed, that's why I dropped it.
GoAsm and GoLink are in the codejps folder.