I wrote this a while ago. It takes code that has had all formatting removed and turns it into nicely tabulated code. For it to decide what are valid opcodes it uses a file called Codes.csv but this can be overridden by a command line switch. Operation is pretty obvious except for the Auto button. Auto copies code from the clipboard, tidies it up and places it back on the clipboard.
The command line switches are,
/f"Filename.csv" = new opcode file
/t = use tabs
/s = use spaces
/a = auto
To use the switches, make a shortcut to the executable and add the switches to it. (ex "C:\Projects\CodeTidy.exe" /f"Z80.csv" /t)
The opcode override is so you can have a version for other processors.
If the /a command line switch is used then you won't see anything. It will run, do it's job and exit.
The zip file contains a setup program. If anyone just wants the exe then just ask.
Have fun.
Mike.
It won't let me post an attachment at the moment so I'll try again later.
Here's the source. Be warned, as I wrote it for myself and don't intend to maintain it, there are no comments. However, it should be fairly easy to follow for anyone with reasonable VB experience.
Just noticed the zip size. Only Microsoft could take 2.9k of source and turn it into 1.3M of code.
I like the graphics, especially the auto button. A smaller version of the auto button would make a nice icon for it.
The way I use it, I never actually see the form. I have it as a button on my office toolbar that's set to auto (/a). I copy code from this board, hit the tidy button and paste straight to PFE. The other thing I use it for is to tidy the Microchip template files, whoever thought that 5 was a good tab size wants shooting.
I was thinking about that like making it a toolbar and have it optional to make large or small buttons... I might also make a miniture version called Tiny Tidy... The trick here is all you have to do is drag and drop and it tidys and saves auto.
Here's a newer version with the ability to set the case of the opcodes.
Command line switches are,
/F"Filename.csv" = new opcode file
/T = use tabs
/S = use spaces
/A = auto
/L = make opcodes lower case
/U = make opcodes upper case
It is best to uninstall the old verion first via control panel before installing the new one. Alternatively, just download the exe and replace it in program files/codetidy.
AtomSoft, I stole your Auto graphic to use as an Icon. Hope you don't mind.
I have found a little bug in the latest tidier.
Its setting the label names for the EQU's to lower case in the declarations
but not in the body of the program.
So I am getting case sensitive errors during assembly.
I made the assumption that anything that was not at position 1 was an opcode. I forgot things like cblock can have labels in the opcode position. Silly assumption, I'll go fix it.