Friday, April 10, 2015

NIOSii Assembly language – Syntax highlighting


TLDR version: Download here , instructions included.

Coding without syntax highlighting is a pain in the butt. That is even more true in assembly with non-intuitive instructions and non-elaborate names for registers etc. This semester I had the course Computer Organization (ECE243). When we weren’t playing with lego and drawing CPU diagrams, we were busy coding the Altera DE2 board with assembly. I could just do most of the work in C though. But are you a C-programmer or are you a hacker? :P

Apparently Assembly language for NIOSii processors is not really popular ….well, not popular enough to have syntax in Sublime Text or Notepad++ !
It turns out, making a custom syntax highlight language is pretty easy in Notepad++ *. There is even a GUI for making it! So I made two! – one for light background and another for dark. Here is how you use it:

        - Download the files from here and unzip them
        - Read the ReadMe.txt if you’re bored of this post already
        - Open Notepad++
        - Click Language > Define your language > Create New > Import
        - Select either of the .xml files provided
        - Get out of that user defined language editor
        - You will now see your new language in the language list

You will get something like this instead of one monotonous colour….Capture
 
 
 
 
 
 
 
 
 
 
 
 
 








* I have to take this opportunity to condemn the author of Notepad++ for pushing his opinions about a certain French “newspaper” down our throats in one of the latest revisions of the software. I wonder where his opinions are at when real journalists get killed instead.
 
 

4 comments:

  1. Hey, thanks a bunch for providing this!

    It's perfect timing – this semester I'm currently studying Embedded Systems using the Nios-II system. After coding hundreds of lines in Assembly, something like this more than the default Assembly syntax is absolutely refreshing. It will certainly motivate me for the more elaborate Altera projects...

    Kudos!

    ReplyDelete