├── .gitignore ├── .vscode └── launch.json ├── .vscodeignore ├── README.md ├── extension.js ├── language-configuration.json ├── package.json └── syntaxes └── kickassembler.tmLanguage /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | // A launch configuration that launches the extension inside a new window 2 | { 3 | "version": "0.1.0", 4 | "configurations": [ 5 | { 6 | "name": "Launch Extension", 7 | "type": "extensionHost", 8 | "request": "launch", 9 | "runtimeExecutable": "${execPath}", 10 | "args": ["--extensionDevelopmentPath=${workspaceRoot}" ] 11 | } 12 | ] 13 | } -------------------------------------------------------------------------------- /.vscodeignore: -------------------------------------------------------------------------------- 1 | .vscode/** 2 | .vscode-test/** 3 | test/** 4 | .gitignore 5 | jsconfig.json 6 | vsc-extension-quickstart.md 7 | .eslintrc.json 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PROJECT ARCHIVED 2 | 3 | This project did not evolve beyond the prototype stage. Check out [Paul Hocker's extension](https://marketplace.visualstudio.com/items?itemName=paulhocker.kick-assembler-vscode-ext) instead! 4 | 5 | # Kick Assembler README 6 | 7 | This extension allows you to interact with the Commodore 64 cross-assembler Kick Assembler. 8 | 9 | It is a port of the [Sublime Text extension by Swoffa](https://github.com/Swoffa/SublimeKickAssemblerC64), and all the credit should go to him and other previous authors and contributors! 10 | 11 | ## Features 12 | 13 | The extension offers syntax highlighting and some commands to build an executable program from the assembler source code. 14 | 15 | - "Kick Assembler: Build" will compile the assembler code in the current open file. 16 | 17 | ## Requirements 18 | 19 | You need to have Kick Assembler already installed on your machine. Kick Assembler requires Java, and you should have the `java` executable present in your path. 20 | 21 | You probably also want a copy of the Vice C64 emulator if you want to run your programs! 22 | 23 | ## Extension Settings 24 | 25 | You will need to set the path to the Kick Assembler JAR file, for example: 26 | 27 | ```json 28 | { 29 | "kickassembler.kickAssPath": "C:\\dev\\C64\\KickAssembler\\KickAss.jar" 30 | } 31 | ``` 32 | 33 | ## Known Issues 34 | 35 | None yet. 36 | 37 | Future releases will (hopefully) offer an integration with x64 for executing and debugging programs. 38 | 39 | ## Release Notes 40 | 41 | ### 1.0.0 42 | 43 | Initial release. 44 | -------------------------------------------------------------------------------- /extension.js: -------------------------------------------------------------------------------- 1 | let vscode = require('vscode'); 2 | let cp = require('child_process'); 3 | 4 | function activate(context) { 5 | console.log('Congratulations, your extension "kickassembler" is now active!'); 6 | 7 | // Define the build and run command 8 | let commandBuildRun = vscode.commands.registerCommand('kickassembler.build_run', function() { 9 | if (buildProgram() == 0) { 10 | runProgram(); 11 | } 12 | }); 13 | 14 | // Define the build and debug command 15 | let commandBuildDebug = vscode.commands.registerCommand('kickassembler.build_debug', function() { 16 | if (buildProgram() == 0) { 17 | runDebugProgram(); 18 | } 19 | }); 20 | 21 | // Define the build command 22 | let commandBuild = vscode.commands.registerCommand('kickassembler.build', function () { 23 | buildProgram(); 24 | }); 25 | 26 | context.subscriptions.push(commandBuild); 27 | context.subscriptions.push(commandBuildRun); 28 | context.subscriptions.push(commandBuildDebug); 29 | } 30 | 31 | function deactivate() { 32 | } 33 | 34 | exports.activate = activate; 35 | exports.deactivate = deactivate; 36 | 37 | /** 38 | * Build the program with the compiler 39 | */ 40 | 41 | function buildProgram() { 42 | let errorCode = 0; 43 | 44 | // Check path settings 45 | let configuration = vscode.workspace.getConfiguration('kickassembler'); 46 | let kickAssPath = configuration.get('kickAssPath'); 47 | let javaPath = configuration.get("javaPath"); 48 | 49 | if (kickAssPath == "") { 50 | vscode.window.showErrorMessage('Kick Assembler JAR path not defined! Set kickassembler.kickAssPath in User Settings.'); 51 | return; 52 | } 53 | 54 | let editor = vscode.window.activeTextEditor; 55 | 56 | let outputChannel = vscode.window.createOutputChannel('Kick Assembler Build'); 57 | outputChannel.clear(); 58 | outputChannel.show(); 59 | 60 | let java = cp.spawn(javaPath, [ 61 | "-jar", 62 | kickAssPath, 63 | editor.document.fileName 64 | ]); 65 | 66 | java.on('close', function(e) { 67 | outputChannel.appendLine('Child process exit code: ' + e); 68 | errorCode = e; 69 | if (e != 0) { 70 | vscode.window.showErrorMessage('Compilation failed with errors.'); 71 | } 72 | }); 73 | 74 | java.stdout.on('data', function(data) { 75 | outputChannel.append('' + data); 76 | }); 77 | 78 | java.stderr.on('data', function(data) { 79 | outputChannel.append('' + data); 80 | }); 81 | 82 | return errorCode; 83 | } 84 | 85 | /** 86 | * Run the VICE emulator with the compiled program 87 | */ 88 | 89 | function runProgram() { 90 | let configuration = vscode.workspace.getConfiguration('kickassembler'); 91 | let vicePath = configuration.get("vicePath"); 92 | 93 | let editor = vscode.window.activeTextEditor; 94 | let prg = editor.document.fileName; 95 | 96 | // very crude but will suffice for now 97 | prg = prg.replace(".asm", ".prg"); 98 | 99 | let vice = cp.spawn(vicePath, [prg], { 100 | detached : true, 101 | stdio : 'ignore' 102 | }); 103 | 104 | vice.unref(); 105 | } 106 | 107 | /** 108 | * Run C64 debugger with the compiled program 109 | */ 110 | 111 | function runDebugProgram() { 112 | let configuration = vscode.workspace.getConfiguration('kickassembler'); 113 | let debuggerPath = configuration.get("debuggerPath"); 114 | 115 | let editor = vscode.window.activeTextEditor; 116 | let prg = editor.document.fileName; 117 | 118 | // very crude but will suffice for now 119 | prg = prg.replace(".asm", ".prg"); 120 | 121 | let db = cp.spawn(debuggerPath, [prg], { 122 | detached : true, 123 | stdio : 'ignore' 124 | }); 125 | 126 | db.unref(); 127 | } 128 | -------------------------------------------------------------------------------- /language-configuration.json: -------------------------------------------------------------------------------- 1 | { 2 | "comments": { 3 | // symbol used for single line comment. Remove this entry if your language does not support line comments 4 | "lineComment": "//", 5 | // symbols used for start and end a block comment. Remove this entry if your language does not support block comments 6 | "blockComment": [ "/*", "*/" ] 7 | }, 8 | // symbols used as brackets 9 | "brackets": [ 10 | ["{", "}"], 11 | ["[", "]"], 12 | ["(", ")"] 13 | ], 14 | // symbols that are auto closed when typing 15 | "autoClosingPairs": [ 16 | ["{", "}"], 17 | ["[", "]"], 18 | ["(", ")"], 19 | ["\"", "\""], 20 | ["'", "'"] 21 | ], 22 | // symbols that that can be used to surround a selection 23 | "surroundingPairs": [ 24 | ["{", "}"], 25 | ["[", "]"], 26 | ["(", ")"], 27 | ["\"", "\""], 28 | ["'", "'"] 29 | ] 30 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "kickassembler", 3 | "displayName": "Kick Assembler (C64)", 4 | "description": "Language syntax and build commands for the C64 cross-assembler Kick Assembler.", 5 | "version": "0.0.1", 6 | "publisher": "tomconte", 7 | "engines": { 8 | "vscode": "^1.5.0" 9 | }, 10 | "categories": [ 11 | "Programming Languages" 12 | ], 13 | "activationEvents": [ 14 | "onCommand:kickassembler.build", 15 | "onCommand:kickassembler.build_run", 16 | "onCommand:kickassembler.build_debug" 17 | ], 18 | "main": "./extension", 19 | "contributes": { 20 | "languages": [{ 21 | "id": "kickassembler", 22 | "aliases": ["KickAssembler (C64)", "kickassembler"], 23 | "extensions": [".asm",".inc",".s",".a"], 24 | "configuration": "./language-configuration.json" 25 | }], 26 | "grammars": [{ 27 | "language": "kickassembler", 28 | "scopeName": "source.assembly.kickassembler", 29 | "path": "./syntaxes/kickassembler.tmLanguage" 30 | }], 31 | "commands": [{ 32 | "command": "kickassembler.build", 33 | "title": "Kick Assembler: Build" 34 | },{ 35 | "command": "kickassembler.build_run", 36 | "title": "Kick Assembler: Build and Run" 37 | },{ 38 | "command": "kickassembler.build_debug", 39 | "title": "Kick Assembler: Build and Debug" 40 | }], 41 | "configuration": { 42 | "title": "Kick Assembler Configuration", 43 | "properties": { 44 | "kickassembler.kickAssPath": { 45 | "type": "string", 46 | "default": "KickAss.jar", 47 | "description": "Full path to KickAss.jar" 48 | }, 49 | "kickassembler.javaPath": { 50 | "type": "string", 51 | "default": "/usr/bin/java", 52 | "description": "Full path to Java executable" 53 | }, 54 | "kickassembler.vicePath": { 55 | "type": "string", 56 | "default": "x64", 57 | "description": "Full path to VICE executable" 58 | }, 59 | "kickassembler.debuggerPath": { 60 | "type": "string", 61 | "default": "C64Debugger", 62 | "description": "Full path to debugger executable" 63 | } 64 | } 65 | } 66 | }, 67 | "repository": { 68 | "type": "git", 69 | "url": "https://github.com/tomconte/vscode-kickassembler" 70 | }, 71 | "icon": "images/kickasslogo.png", 72 | "galleryBanner": { 73 | "color": "#0000AA", 74 | "theme": "dark" 75 | }, 76 | "devDependencies": { 77 | "vscode": "^1.0.0", 78 | "mocha": "^2.3.3", 79 | "eslint": "^3.6.0" 80 | } 81 | } -------------------------------------------------------------------------------- /syntaxes/kickassembler.tmLanguage: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | 13 | fileTypes 14 | 15 | .asm 16 | .inc 17 | .s 18 | .a 19 | 20 | foldingStartMarker 21 | \/\*|\{\s*$ 22 | foldingStopMarker 23 | \*\/|^\s*\} 24 | name 25 | KickAssembler (C64) 26 | patterns 27 | 28 | 29 | match 30 | \b(adc|and|asl|bit|clc|cld|cli|clv|cmp|cpx|cpy|dec|dex|dey|eor|inc|inx|iny|lda|ldx|ldy|lsr|nop|ora|pha|php|pla|plp|rol|ror|sbc|sec|sed|sei|sta|stx|sty|tax|txa|tay|tya|tsx|txs)\b 31 | name 32 | keyword 33 | 34 | 35 | match 36 | \b(aac|aax|alr|anc|ane|arr|aso|asr|atx|axa|axs|dcm|dcp|dop|hlt|ins|isb|isc|jam|kil|lae|lar|las|lax|lse|lxa|oal|rla|rra|sax|sbx|skb|sha|shs|say|shx|shy|slo|skw|sre|sxa|sya|tas|top|xaa|xas)\b 37 | name 38 | illegal 39 | 40 | 41 | match 42 | \b(bcc|bcs|beq|bmi|bne|bpl|brk|bvc|bvs|jmp|jsr|rti|rts)\b 43 | name 44 | keyword.control 45 | 46 | 47 | begin 48 | /\* 49 | captures 50 | 51 | 0 52 | 53 | name 54 | punctuation.definition.comment 55 | 56 | 57 | end 58 | \*/\n? 59 | name 60 | comment.block 61 | 62 | 63 | begin 64 | // 65 | captures 66 | 67 | 1 68 | 69 | name 70 | punctuation.definition.comment 71 | 72 | 73 | end 74 | $\n? 75 | name 76 | comment.line.double-slashs 77 | 78 | 79 | captures 80 | 81 | 1 82 | 83 | name 84 | storage.type.kickass 85 | 86 | 87 | match 88 | (?:^|\s)(\.(word|byte|text|dword))\b 89 | 90 | 91 | match 92 | \b(CmdArgument|Hashtable)\b 93 | name 94 | storage.type.kickass 95 | 96 | 97 | match 98 | \b(toIntString|toBinaryString|toOctalString|toHexString)\b 99 | name 100 | support.function.string 101 | 102 | 103 | match 104 | \b(abs|acos|asin|atan|atan2|cbrt|ceil|cos|cosh|exp|expm1|floor|hypot|IEEEremainder|log|log10|log1p|max|min|pow|mod|random|round|signum|sin|sinh|sqrt|tan|tanh|toDegrees|toRadians)\b 105 | name 106 | support.function.math 107 | 108 | 109 | match 110 | \b(LoadBinary|LoadPicture|LoadSid|createFile)\b 111 | name 112 | support.function.file 113 | 114 | 115 | match 116 | \b(Matrix|RotationMatrix|ScaleMatrix|MoveMatrix|PerspectiveMatrix|Vector)\b 117 | name 118 | support.function.3d 119 | 120 | 121 | captures 122 | 123 | 1 124 | 125 | name 126 | storage.type.keyword.kickass.field 127 | 128 | 129 | match 130 | (?:^|\s)(\.(var|label|const))\b 131 | 132 | 133 | captures 134 | 135 | 1 136 | 137 | name 138 | keyword.kickass.function.object 139 | 140 | 141 | match 142 | (?:^|\s)(\.(struct|enum))\b 143 | 144 | 145 | captures 146 | 147 | 1 148 | 149 | name 150 | keyword.kickass.function 151 | 152 | 153 | match 154 | (?:^|\s)(\.(eval|fill|print|printnow|import|align|assert|asserterror|error))\b 155 | 156 | 157 | captures 158 | 159 | 1 160 | 161 | name 162 | keyword.kickass 163 | 164 | 165 | match 166 | (?:^|\s)(\.(pc|importonce|pseudopc|return|eval))\b 167 | 168 | 169 | match 170 | \b(true|false)\b 171 | name 172 | constant.language 173 | 174 | 175 | match 176 | \b(BLACK|WHITE|RED|CYAN|PURPLE|GREEN|BLUE|YELLOW|ORANGE|BROWN|LIGHT_RED|DARK_GRAY|GRAY|DARK_GREY|GREY|LIGHT_GREEN|LIGHT_BLUE|LIGHT_GRAY|LIGHT_GREY)\b 177 | name 178 | constant.language.color 179 | 180 | 181 | match 182 | \b(LDA_IMM|LDA_ZP|LDA_ZPX|LDX_ZPY|LDA_IZPX|LDA_IZPY|LDA_ABS|LDA_ABSX|LDA_ABSY|JMP_IND|BNE_REL|RTS)\b 183 | name 184 | constant.language.opcodes 185 | 186 | 187 | match 188 | \b(BF_C64FILE|BF_BITMAP_SINGLECOLOR|BF_KOALA|BF_FLI)\b 189 | name 190 | constant.language.file 191 | 192 | 193 | match 194 | \b(AT_ABSOLUTE|AT_ABSOLUTEX|AT_ABSOLUTEY|AT_IMMEDIATE|AT_INDIRECT|AT_IZEROPAGEX|AT_IZEROPAGEY|AT_NONE)\b 195 | name 196 | constant.language.pseudocommand 197 | 198 | 199 | match 200 | \b(PI|E)\b 201 | name 202 | constant.language.math 203 | 204 | 205 | 206 | captures 207 | 208 | 1 209 | 210 | name 211 | storage.type 212 | 213 | 2 214 | 215 | name 216 | variable.parameter 217 | 218 | 219 | match 220 | \b(list|List)\(\s*(\$?\d+)*\s*\) 221 | name 222 | list 223 | 224 | 225 | captures 226 | 227 | 1 228 | 229 | name 230 | keyword.control.for 231 | 232 | 2 233 | 234 | name 235 | storage.type.for 236 | 237 | 238 | match 239 | (?:^|\s)(\.for)\s*\((var)\b 240 | 241 | 242 | captures 243 | 244 | 1 245 | 246 | name 247 | keyword.control 248 | 249 | 250 | match 251 | (?:^|\s)((\.if)\b|(else)\b) 252 | 253 | 254 | begin 255 | " 256 | end 257 | " 258 | name 259 | string.quoted.double.untitled 260 | patterns 261 | 262 | 263 | match 264 | \\. 265 | name 266 | constant.character.escape 267 | 268 | 269 | 270 | 271 | 272 | captures 273 | 274 | 1 275 | 276 | name 277 | meta.label.identifier 278 | 279 | 2 280 | 281 | name 282 | entity.name.label 283 | 284 | 285 | match 286 | ^\s*(((!)|(!?([A-Za-z_][A-Za-z0-9_]*)+))\:) 287 | name 288 | label 289 | 290 | 291 | captures 292 | 293 | 1 294 | 295 | name 296 | meta.filenamespace.identifier 297 | 298 | 2 299 | 300 | name 301 | keyword.type.filenamespace 302 | 303 | 3 304 | 305 | name 306 | entity.name.filenamespace 307 | 308 | 309 | match 310 | ^\s*((\.filenamespace)\s*([A-Za-z_][A-Za-z0-9_]*))\b 311 | 312 | 313 | captures 314 | 315 | 1 316 | 317 | name 318 | meta.namespace.identifier 319 | 320 | 2 321 | 322 | name 323 | keyword.type.namespace 324 | 325 | 3 326 | 327 | name 328 | entity.name.namespace 329 | 330 | 331 | match 332 | (?:^|\s)((\.namespace)\s*([A-Za-z_][A-Za-z0-9_]*))\b 333 | 334 | 335 | captures 336 | 337 | 1 338 | 339 | name 340 | meta.pseudocommand.identifier 341 | 342 | 2 343 | 344 | name 345 | storage.type.pseudocommand 346 | 347 | 3 348 | 349 | name 350 | entity.name.pseudocommand 351 | 352 | 353 | match 354 | (?:^|\s)((\.pseudocommand)\s*([A-Za-z_][A-Za-z0-9_]*))\b 355 | 356 | 357 | captures 358 | 359 | 1 360 | 361 | name 362 | meta.label.identifier 363 | 364 | 2 365 | 366 | name 367 | storage.type.function 368 | 369 | 3 370 | 371 | name 372 | entity.name.function 373 | 374 | 375 | match 376 | (?:^|\s)((\.function)\s*([A-Za-z0-9_]*))\b 377 | 378 | 379 | captures 380 | 381 | 1 382 | 383 | name 384 | meta.macro.identifier 385 | 386 | 2 387 | 388 | name 389 | storage.type.macro 390 | 391 | 3 392 | 393 | name 394 | entity.name.macro 395 | 396 | 397 | match 398 | (?:^|\s)((\.macro)\s*([A-Za-z_][A-Za-z0-9_]*))\b 399 | 400 | 401 | match 402 | #?\$[0-9a-fA-F]+ 403 | name 404 | constant.numeric.hex 405 | 406 | 407 | match 408 | \#[0-9a-fA-F]+\b 409 | name 410 | constant.numeric.decimal 411 | 412 | 413 | match 414 | \b\d+\b 415 | name 416 | constant.numeric.decimal 417 | 418 | 419 | match 420 | \#%[0-1]+\b 421 | name 422 | constant.numeric.binary 423 | 424 | 425 | scopeName 426 | source.assembly.kickassembler 427 | uuid 428 | 107f6c61-6808-4778-893e-8fb1cbb81f30 429 | 430 | --------------------------------------------------------------------------------