Provides SPARC assembly syntax highlighting and snippets for Sublime Text 2/3.
- Total 2K
- Win 1K
- OS X 645
- Linux 494
|Feb 23||Feb 22||Feb 21||Feb 20||Feb 19||Feb 18||Feb 17||Feb 16||Feb 15||Feb 14||Feb 13||Feb 12||Feb 11||Feb 10||Feb 9||Feb 8||Feb 7||Feb 6||Feb 5||Feb 4||Feb 3||Feb 2||Feb 1||Jan 31||Jan 30||Jan 29||Jan 28||Jan 27||Jan 26||Jan 25||Jan 24||Jan 23||Jan 22||Jan 21||Jan 20||Jan 19||Jan 18||Jan 17||Jan 16||Jan 15||Jan 14||Jan 13||Jan 12||Jan 11||Jan 10||Jan 9|
SPARC Syntax for Sublime Text 2/3
This package provides SPARC assembly language syntax highlighting, as well as a few code snippets.
Although SPARC is fairly uncommon in practice, it is still used as a teaching language in some universities. Writing SPARC without syntax highlighting is a horror that no mortal need endure.
Hilariously, my SPARC class was the final SPARC course my university offered before switching to x86. I hope that other students find this more useful than my classmates will.
Getting the files
=> Ctrl+Shift+P >> Package Control: Install Package >> SPARC Assembly => Enter
Then restart Sublime Text again, and you're done! Revel in the awesome power of syntax highlighting!
If you'd rather install via Git, navigate to your Sublime Text 2
directory in your terminal…
- OS X:
~/Library/Application\ Support/Sublime\ Text\ 2/Packages
%APPDATA%/Sublime Text 2/Packages/
…and paste (try middle click if you don't know the shortcut) the command:
git clone firstname.lastname@example.org:ProtractorNinja/SPARC-sublime.git SPARC
To install manually, download this archive into a folder called
SPARC in your
Sublime Text 2
Packages directory (
Preferences -> Browse Packages...).
Make sure to restart Sublime Text 2 when you're finished.
Setting SPARC as the default language
Other languages include the SPARC file extensions,
.m, in their
syntax definitions (R and Objective-C, respectively). To combat this, I've
sparc.sublime-settings file which should change the auto-syntax
preference to SPARC. If I have failed, then you may make the change manually by
.m file and clicking
View -> Syntax -> Open all with
current extension as... -> SPARC.
The syntax highlighting should be mostly straightforward, but I'd like to point
out an important distinction between certain opcodes: those opcodes that
involve a delay slot—branching commands, jumping, and subroutine calls—are
colored differently than those that do not. The complete list is located in
nop will also have
its own color, as I decided that
nop should stand out when it is used.
Regular machine registers (
have their own colorations that differ from the strange and mysterious
%sp. Everything else following a
% symbol (e.g. macro-
defined registers such as
define(my_register, l0)) has a
distinctive color. Monokai does not color variables.
The SPARC package provides 7 snippets for super simple insertion of certain code structures. They are listed below.
main creates a basic empty program template, with sections for code and extra
subr inserts a basic non-leaf subroutine that has its own register window.
while you wait,
while expands into a simple while loop structure!
for your convenience,
for is like while, but with an iterator register
arr provides access (either for a
ld or a
st) to an element in a single
dimensional array, as long as the address of the beginning of the array is
arr2d might seem complicated, but it's just the same as
arr except that it
works with a two-dimensional array instead.
if you want a conditional block, use
if. Feel free to remove the “else”
if_not_condition: ...) if you don't need an else.
Every shot features the beautiful and amazing (and free!) Adobe Source Code Pro Light. It works wonders on zoomed-in displays.