Command line assembler

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

Re: Command line assembler

Post by Frank »

The command line assembler will tell you, it will print out the error on the command line. Give it all a try and you will see it all works.
Frank
Posts: 159
Joined: Sun May 03, 2015 2:43 pm

Re: Command line assembler

Post by Frank »

Matthew from Disaster Area Designs has put together a zip file containing everything needed: notepad++, FXCore assembler, config files and default program sources.

Get the zip and follow the youtube video on how to set it up. Links to zip and video on the FXCore d/l page
sebxx4
Posts: 26
Joined: Mon Jun 27, 2022 8:08 am

Re: Command line assembler

Post by sebxx4 »

Thanks, I'll try.
sebxx4
Posts: 26
Joined: Mon Jun 27, 2022 8:08 am

Re: Command line assembler

Post by sebxx4 »

Can I program flash memory with it? I mean to replace preloaded effects with own?
Frank
Posts: 159
Joined: Sun May 03, 2015 2:43 pm

Re: Command line assembler

Post by Frank »

Yes, you can reprogram the flash memory with new programs. If you open a shell, cd into the fxcore directory and run: FXCoreAsm.exe -h
you will get this help info:

FXCore Command Line Assembler 2.0.0.0 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 or ICP, may not be used with -re, -p or -x
-re : Assemble start run from RAM and exit leaving FXCore in run from RAM, requires FXCore dev board or ICP, may not be used with -r, -p or -x
-ee : Exit run from RAM after leaving FXCore in run from RAM, requires FXCore dev board or ICP, accepts -i other options ignored
-p n : Assemble and program location n, n=0 to 15, requires FXCore dev board or ICP, may not be used with -r, -re or -x
-i hex_num : Set I2C address of target to hex_num, MUST have leading 0x. 0x30 is default
-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, -re or -p
-s : Print serial number and exit
After assembly the assembler will write a .lst file showing assembled code or assembly errors encountered.
Example: FXCoreCmdAsm.exe -a -c u16 u16 my_prg.fxc
This program relies on the HIDSharp library released under the Apache open source license.

So lots of options to run from RAM, program a specific flash location, get the serial number, etc. Read the READ_ME.txt file, look at the macros that Matthew made for notepad++, etc. to see how to make up your own macros to customize things to how you want them. You could write a batch file to program finished product as ling as you have the ICP and it can plug into your board, etc.
Frank
Posts: 159
Joined: Sun May 03, 2015 2:43 pm

Re: Command line assembler

Post by Frank »

New version 2.2.0.0 of assembler posted for all platforms. Make sure to use the included hidsharp.dll as it has also been updated.

Note that the new version will catch unknown command line parameters and there was a typo in the original Sublime Text files where the I2C address was missing the "-i", it was just "0x30" and not "-i 0x30", if you used the original files as a template to customize your own build files you may need to fix this in them if you did not already catch it.

Support for running the PC version under mono on Linux has been added, see the PDF file for required packages and running it in a shell. We have tested this under Ubuntu Server 20. Sublime Text is available for Linux so the build files for MacOS from the website will be a good starting point but will probably require some changes like paths to work under Linux.
PhilHaw
Posts: 65
Joined: Thu Mar 07, 2019 5:37 pm

Re: Command line assembler

Post by PhilHaw »

Having recently become a fan of Sublime text on Windows, is there any chance of a Windows version of the fxcore_hw.sublime-build for Linux under mono?

Perhaps it could be based on the Linux version; maybe I will have a go at hacking it :geek:

Phil
Philip Hawthorne

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

Re: Command line assembler

Post by PhilHaw »

First attempt at hacking Matthew's Linux Sublime text build file to run on Windows. I haven't got the error handling implemented yet.

Code: Select all

{
	// set working dir for relative paths
// change this to suit the location of FXCoreAsm.exe
      "working_dir" : "C:/Program Files (x86)/Experimental Noize/FXCore Assembler",

      	"file_patterns": ["*.fxc","*.FXC"],

// REGEX for capturing errors

// file regex finds the name of the file for highlighting errors
      "file_regex" : "Source File: (.+)$",

// line regex finds the errors in the output .LST
      "line_regex" : "ERROR.* ([0-9]+):([0-9]+)?(.+)$",

      // allow user to cancel "run from RAM" mode by pressing Ctrl+Pause/Break
      "cancel":
      {
            "cmd" : "FXCoreCmdAsm.exe -ee",
      },

// default build type is assemble only

     "cmd": ["FXCoreCmdAsm.exe", "-a", "$file"],

"variants": [

{
	"name": "Run from RAM",
	"cmd" : "FXCoreCmdAsm.exe -re -i 0x30 $file",
},

{
	"name": "End run from RAM",
	"cmd" : "FXCoreCmdAsm.exe -ee -i 0x30",
},

]

}
Philip Hawthorne

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

Re: Command line assembler

Post by Frank »

Looks like a good start, will need to install Sublime on Windows and give it a go. The more things we can support the more choice people have on mixing editors and OS as they like.
PhilHaw
Posts: 65
Joined: Thu Mar 07, 2019 5:37 pm

Re: Command line assembler

Post by PhilHaw »

So far so good Frank but I'm struggling with getting the correctly formatted command to pass to Windows cmd.exe via the shell_cmd option in the Sublime Text build file.

In the Linux version it's:

Code: Select all

// default build type is assemble only

      "shell_cmd": "if mono FXCoreCmdAsm.exe -a '$file_path'/'$file_name'; then echo 'Hex saved to '$file_path'/'$file_base_name'.hex'; else cat '$file_path'/'$file_base_name'.lst; fi",
I can get it to assemble ok using the simplified command:

Code: Select all

"shell_cmd" : "FXCoreCmdAsm.exe -a $file"
but I keep getting errors e.g. "-a was unexpected at this time" if I try the more complex shell command string. I need a Windows command line guru!

Phil.
Philip Hawthorne

Blue Nebula Development Team
Post Reply