Command line assembler

Frank
Posts: 158
Joined: Sun May 03, 2015 2:43 pm

Command line assembler

Post by Frank »

New command line assembler has been released. Allows you to use an editor like Notepad++ to write and assemble FXCore files.

First want to thank Matthew Farrow of Disaster Area Designs/Alexander Pedals for testing it and contributing the command file and tutoring me on using Notepad++.

The zip file includes the language file for Notepad++ to do syntax highlighting for FXCore language.

Assembler supports all the functions of the GUI assembler so no changes to your source needed, command line arguments are:

FXCoreCmdAsm.exe -h
FXCore Command Line Assembler Help
Usage: fxcorecmdasm.exe [Options] filename
-h : Print usage info and exit
-a : Assemble to HEX file
-c size_pre reg_pro_pre: Write C array file, option MUST be followed with the strings to prepen to the size and registers/program arrays
-r : Assemble and run from RAM, requires FXCore dev board, may not be used with -p
-p n : Assemble and program location n, n=0 to 15, requires FXCore dev board, may not be used with -r
-i hex_num : Set I2C address of target to hex_num, MUST have leading 0x. 0x30 is default
After assembly the assembler will write a .lst file showing assembler code or errors encountered.
Example: fxcorecmdasm.exe -a -c u16 u16 my_prg.fxc
PhilHaw
Posts: 65
Joined: Thu Mar 07, 2019 5:37 pm

Re: Command line assembler

Post by PhilHaw »

This is great news!

The GUI Assembler was, to be honest, pretty awful - Sorry Frank 8-)

Notepad++ is such a well-featured editor that I have been using for a while now so many thanks to Matthew for making this work with FXCore assembly language. Having just got it working I can say it really does make FXCore programming a much more pleasurable experience :)
Philip Hawthorne

Blue Nebula Development Team
PhilHaw
Posts: 65
Joined: Thu Mar 07, 2019 5:37 pm

Re: Command line assembler

Post by PhilHaw »

I just realized that it's possible to add keyboard shortcuts for the new Assemble, Run and List options. These could be added when setting up the command line Run options but you can also add them later by looking under the Run... menu where you will see an option ‘Modify Shortcut/Delete Command’. This opens the following dialog where you can see I have added Alt+A, Alt+R and Alt+L as the shortcuts for the Assemble, Run and List FXCore commands.Image
Philip Hawthorne

Blue Nebula Development Team
Frank
Posts: 158
Joined: Sun May 03, 2015 2:43 pm

Re: Command line assembler

Post by Frank »

The UDL also supports comment and code collapsing, use region and end for code collapsing like:

; region read pots
cpy_cs r0. pot0
cpy_cs r1, pot1
.
.
; end

I also like the document map (View -> Document Map)

For adding shortcuts I suggest using "Settings -> Shortcut Mapper..." as it will show all and note any existing conflicts.
PhilHaw
Posts: 65
Joined: Thu Mar 07, 2019 5:37 pm

Re: Command line assembler

Post by PhilHaw »

Thanks Frank, another couple of excellent features I didn't know about in Notepad++ :o
Philip Hawthorne

Blue Nebula Development Team
scmitche
Posts: 12
Joined: Mon Mar 16, 2020 5:28 am

Re: Command line assembler

Post by scmitche »

I've had a battle trying to get notepad++ running for FX-Core use in my Toshiba Windows 10 32-bit laptop. I got around the problem by copying the standard FX-Core Experimental Noize folders and contents to Program Files(x86). It's all working well now.

Windows 10 32-bit by default puts programs into 'Program Files' not 'Program Files (x86)', I tried to edit the commands I was putting into notepad++ via the Run command by removing the (x86) part of the strings to be added but it still failed. Then Philip Hawthorne looked at the supplied 'assemble.cmd' and the (x86) is there in the script file - no doubt what caused my annoying problem. I'm not reversing things now but it would be worth an edit of assemble.cmd for anyone else having trouble under Win10 32-bit.

Steve
Frank
Posts: 158
Joined: Sun May 03, 2015 2:43 pm

Re: Command line assembler

Post by Frank »

I did not know there was a 32-bit version of Windows 10. I thought 10 was 64-bit only.

You should only need the FXCore command line assembler, the command file and the LibFT260.dll file in the x86 directory in your case and not the GUI assembler file. The only thing the GUI and command line versions share externally is the LibFT260.dll file so it has to be in the same directory as the executable in each case.
DisasterArea
Posts: 26
Joined: Sat Jul 25, 2020 7:07 pm

Re: Command line assembler

Post by DisasterArea »

PhilHaw wrote: Mon Oct 26, 2020 6:30 pm I just realized that it's possible to add keyboard shortcuts for the new Assemble, Run and List options. These could be added when setting up the command line Run options but you can also add them later by looking under the Run... menu where you will see an option ‘Modify Shortcut/Delete Command’. This opens the following dialog where you can see I have added Alt+A, Alt+R and Alt+L as the shortcuts for the Assemble, Run and List FXCore commands.Image
Yes, I had keyboard shortcuts set up before I sent this over to Frank. The reason I wrote the .cmd file / batch is so that I could have the command line assembler pause and show me that there were errors / no errors, otherwise it just pops up and disappears.

When Frank added the program / run from RAM options I added more support in the .cmd for those as well, and I have shortcuts for anything I'd need to do. I agree that the GUI editor is a bit clunky, but it's not easy to write a great text editor from scratch. NPP has been under continuous development by a whole community for YEARS, and it's not fair to expect Frank to write something that good in a few months.

I originally suggested the command-line assembler so that I could use a 3rd party editor, knowing that porting just the assembler portion would likely be a lot simpler than rewriting the GUI editor. Rather than bother Frank with dozens of editor requests, the command-line assembler was a way for me to solve my own problems. I shared the results with Frank more as a thank-you for working on the CLA than anything else. I'm glad you guys like it.
PhilHaw
Posts: 65
Joined: Thu Mar 07, 2019 5:37 pm

Re: Command line assembler

Post by PhilHaw »

Thanks again for all your work on this. I had been in touch via email with Frank a few months back and I believe we discussed using another Editor. At the time I was using Notepad++ for editing but having to run the GUI Assembler alongside it. Having written a text editor of sorts on some old hardware many moons ago, I know how hard it is so I hope my earlier 'awful' comment hasn't offended Frank. It can't be easy getting a new chip design onto the market while writing all the support documents and applications and everything else that's required.

Now with the command line assembler and the work you guys have done in integrating it with Notepad++, we have a great tool for FXCore development.

BTW, for anyone who would like to change any of the language highlighting styles, it's quite easy to edit these in Notepad++ by accessing Language > User Defined Language > Define your language ...
Philip Hawthorne

Blue Nebula Development Team
Frank
Posts: 158
Joined: Sun May 03, 2015 2:43 pm

Re: Command line assembler

Post by Frank »

New version posted, only the exe has changed all other files in zip are the same as previous so if you have it installed and running just replace the exe.

2 new commands:
-x n : Program an assembled HEX file to location n, n=0 to 15, requires FXCore dev board or ICP, may not be used with -r or -p
-s : Print serial number and exit

These are more for production, using a batch file you could quickly program all 16 locations from hex files with -x which is faster than having to assemble each source. Also you may not want the source code on the production floor.

-s is for those that want to create a database of their products FXCore serial numbers.
Post Reply