Sublime Package, Kick Assembler (C64)

What

A simple and free development environment for c64 coding using Sublime text, the Kick Assembler compiler and the Vice c64 emulator. It supports OSX, Linux and Windows.

Kick Assembler (C64) is a language package for the awesome Sublime text editor (version 2 and 3 supported).  The package supports things like syntax coloring, basic navigation and build/run/debug integration with Kick Assembler/Vice.

 

Install

Panic install guide (OSX, Windows, Linux)

  1. Ensure Java Runtime Environment is installed
  2. Download Kick Assembler and ensure KickAss.jar is in your CLASSPATH environment variable
  3. Download Vice c64 emulator and ensure path to x64 is in your PATH environment variable
  4. Install  Sublime Text and Package Control
  5. Install package Kick Assembler (C64)
  6. Code awesome demos!

Detailed installation guides

 

Develop, build and run

  1. Open a Kick Assembler code file in Sublime text. Example code file here.
  2. Hit the F7 key to start Build and Run
  3. Hopefully watch your lovely code execute!

In step 2 above you can select other Build Variants, by instead pressing Super+Shift+P / Ctrl+Shift+P and selecting desired build variant, or by using the associated key (see below). Here follows a description of the available build variants.

Build and Run (F7)

Compiles the current file and runs it using the Vice emulator.

Build and Debug (Shift+F7)

Compiles the current file and runs it using the Vice emulator. This variant allows the creation of a file containing breakpoints, which is sent to the Vice emulator for debugging.

Build and Run Startup (F5)

Compiles a file with name Startup.asm in the same folder as the current file, and runs it using the Vice emulator. Handy if you have several code files included in a main runnable file (Startup.asm).

Build and Debug Startup (Shift+F5)

Compiles a file with name Startup.asm in the same folder as the current file, and runs it using the Vice emulator. Handy if you have several code files included in a main runnable file (Startup.asm). This variant allows the creation of a file containing breakpoints, which is sent to the Vice emulator for debugging.

Build Startup (Super+Shift+B / Ctrl+Shift+B)

Compiles a file with name Startup.asm in the same folder as the current file. Handy if you have several code files included in a main runnable file.

 

Features and details

Syntax coloring

For most C64/Kick Assembler things syntax coloring is available.

Auto complete

Although no specific auto complete support is supplied for c64/Kick Assembler, the auto complete features built in to Sublime Text will help a whole lot, the names of existing labels, macros and other stuff will pop up as you write. Very handy.

Navigate to…

Press Super+r/Ctrl+r to view a list of the Kick Assembler labels, namespaces, functions, macros and pseudofunctions in the current file.

Build errors

If you get a compile/build error, just press the F4 key to go to the file/line where the error occurred.

Debugging and break points

You can easily create break points and make the Vice emulator enter the monitor once the address of the break point is hit. In the Vice monitor you can then step and such. To enable break points, you need the following code in your file (or in a separate file and using the .include directive):

//----------------------------------------------------------
// Code for creating the breakpoint file sent to Vice.
//----------------------------------------------------------
.var _useBinFolderForBreakpoints = cmdLineVars.get("usebin") == "true"
.var _createDebugFiles = cmdLineVars.get("afo") == "true"
.print "File creation " + [_createDebugFiles
 ? "enabled (creating breakpoint file)"
 : "disabled (no breakpoint file created)"]
.var brkFile
.if(_createDebugFiles) {
 .if(_useBinFolderForBreakpoints)
 .eval brkFile = createFile("bin/breakpoints.txt")
 else
 .eval brkFile = createFile("breakpoints.txt")
}
.macro break() {
.if(_createDebugFiles) {
 .eval brkFile.writeln("break " + toHexString(*))
 }
}
//------------------------------------------------------

Once the above code is available to your code file, you can write :break() on a line of code and press Super+Shift+F7/Ctrl+Shift+F7 to run your code in Vice and make it stop once your breakpoint is hit. To insert a breakpoint you can also use the bp-snippet (see below).

Snippets

There is a few “built in” snippets in Kick Assembler C64. A snippet is a template, where the Sublime text editor lets you fill in missing details. You write a sequence of characters (trigger), select the snippet, and start filling in the missing values, pressing tab between each value.
The available snippets so far are (trigger in parenthesis):

  • Breakpoint (bp)
  • For-loop (for)
  • If statement (if)
  • if-else statement (ifel)
  • Macro (macro)
  • C64 subroutine (sub)
  • Sinus curve generation (sin)
  • Cosinus cure generation (cos)

 

More

The Kick Assembler script language

I really recommend learning the Kick Assembler script language by reading the Kick Assembler manual.

Contribute

If you like to contribute there is a GitHub-repository here.

Future

The syntax coloring and language configuration for Sublime Package Kick Assembler (C64) can certainly improve, hopefully i will update periodically.

Follow @SwfNoc on twitter for future updates.

Thanks

The language files were originally downloaded and modified from here.

  1. Dear mates, I found a little bug, that drived me crazy for some time now … but should be easy to fix. Using filenames including spaces (anyway not a good idea) leads to a nonexecution of vice. Cheers and thx for all your efforts,
    Stephan

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: