I wrote this a while ago. It takes code that has had all formatting removed and turns it into nicely tabulated code.
It turns this,
Reset ORG 0x000 ; processor reset vector
nop
goto main ; go to beginning of program
ISR ORG 0x004 ; interrupt vector location
movwf w_temp ; save off current W register contents
movf STATUS,w ; move STATUS register into W register
movwf status_temp ; save off contents of STATUS register
movf PCLATH,W ; move PCLATH register into W register
movwf pclath_temp ; save off contents of PCLATH register
Into,
For it to differentiate between opcodes and labels 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.
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
/N = make narrow - uses less horizontal space.
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 file 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, tidy any code on the clipboard and exit.
The zip file contains a setup program. If you installed the earlier version then it is best to uninstall it first via control panel before installing the new one.
Please check further down this thread as if there is a bug in this code I will not be able to edit this post due to the 15 minute edit timer.
Mike.
The other thread had gotten long and convoluted so I started this new one. If a mod wants to delete the old one it would prevent future confusion.
It turns this,
Reset ORG 0x000 ; processor reset vector
nop
goto main ; go to beginning of program
ISR ORG 0x004 ; interrupt vector location
movwf w_temp ; save off current W register contents
movf STATUS,w ; move STATUS register into W register
movwf status_temp ; save off contents of STATUS register
movf PCLATH,W ; move PCLATH register into W register
movwf pclath_temp ; save off contents of PCLATH register
Into,
Code:
Reset ORG 0x000 ; processor reset vector
nop
goto main ; go to beginning of program
ISR ORG 0x004 ; interrupt vector location
movwf w_temp ; save off current W register contents
movf STATUS,w ; move STATUS register into W register
movwf status_temp ; save off contents of STATUS register
movf PCLATH,W ; move PCLATH register into W register
movwf pclath_temp ; save off contents of PCLATH register
For it to differentiate between opcodes and labels 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.
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
/N = make narrow - uses less horizontal space.
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 file 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, tidy any code on the clipboard and exit.
The zip file contains a setup program. If you installed the earlier version then it is best to uninstall it first via control panel before installing the new one.
Please check further down this thread as if there is a bug in this code I will not be able to edit this post due to the 15 minute edit timer.
Mike.
The other thread had gotten long and convoluted so I started this new one. If a mod wants to delete the old one it would prevent future confusion.
Last edited: