Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
usage [2019/09/02 09:13]
neils [Command line usage]
usage [2020/02/20 10:52] (current)
neils [Step 2: install xcbasic64]
Line 1: Line 1:
 ====== Usage ====== ====== Usage ======
  
-===== Usage in GUI =====+//Note: the bellow guide applies to versions 2.3 or later. If you're looking for the older usage guide, please read the [[https://​xc-basic.net/​doku.php?​id=usage&​rev=1580202368|old version of this page]].//
  
-The recommended application to edit and compile **XC=BASIC** programs is [[https://​hamrath.itch.io/​xcedit|XC=EDIT]] by Oliver Hermanni. It supports the entire development process without having to use the command line at all.+===== Installation =====
  
-{{ :z5suv1.png?direct |}}+Before getting started, have a look at this figure to understand how **XC=BASIC** source files are compiled to C64 executable programs. There are two steps involved. First, the **xcbasic64** compiler compiles the .bas source file to an intermediate assembly source. Then **DASM** is kicked in and it assembles the intermediate source file to program file
  
-===== Command line usage =====+{{ ::​toolchain.png?​nolink&​400 |}}
  
-**XC=BASIC** source programs can be compiled to machine code with a single command.+==== Step 1: install DASM ====
  
-Usage in Windows:+  * Go to [[https://​github.com/​dasm-assembler/​dasm/​releases|this page]] and download the latest **DASM** release for your operating system. 
 +  * Extract the package to a location that you'll remember 
 +  * On Linux, you have to add the executable permission: ''​chmod +x dasm''​ 
 +  * Recommended:​ add the executable to the PATH environment variable to make it callable from anywhere. If you don't know how to do this, read one of these guides: [[https://​www.architectryan.com/​2018/​03/​17/​add-to-the-path-on-windows-10/​|Windows]], [[https://​linuxize.com/​post/​how-to-add-directory-to-path-in-linux/​|Linux and macOS]]. On Linux, it's often easier to symlink to the executable in a standard bin directory, e.g ///​usr/​bin//​.
  
- xcb.bat source.bas target.prg +==== Step 2install xcbasic64 ====
-  +
-Usage in Linux:+
  
- ./xcb source.bas target.prg +  * Go to [[https://​github.com/neilsf/​XC-BASIC/​releases|the releases page]] and download the latest **xcbasic64** release for your operating system
-  +  * Extract the package to a location that you'll remember 
-Usage in macOS:+  * On Linux, you have to add the executable permission''​chmod +x xcbasic64''​ 
 +  * Recommended:​ add the executable to the PATH environment variable (see above). ​
  
- ./xcbmac source.bas target.prg +===== Usage =====
-  +
-That's all you have to use in most of the cases. You can also use the binaries in the ''​bin/''​ directory if you want to see and debug the intermediate assembly listing.+
  
-The command line usage of the binary is:+You can now invoke xcbasic64 from the command line as follows:
  
- xcbasic64 source.bas ​target.asm +    ​xcbasic64 ​[-options] ​source.bas target.prg
-  +
-You can omit the output redirection if you just want to see the result on the screen.+
  
-The target then can be compiled using DASM:+ The following command line options ​can be used:
  
- dasm target.asm 
-  
-Or using a singe line command: 
  
- xcbasic64 source.bas > target.asm && dasm target.asm 
  
 +| ''​-o''​ or ''​--output=''​ | Output type. Possible values are: ''​prg''​ (default) or ''​asm''​. \\ If set to ''​asm'',​ DASM will not be invoked and the intermediate assembly source will be output. |
 +|''​-d''​ or ''​--dasm=''​|Path to the DASM executable. Defaults to "​dasm.exe"​ (Windows) or "​dasm"​ (Linux/​Mac). \\ This is required only if DASM is not in the executable path or you want to override this value for some reason.|
 +|''​-s''​ or ''​--symbol=''​|Symbol dump file name. \\ This is passed to DASM as it is. It is useful for debugging your program|
 +|''​-l''​ or ''​--list=''​|List file name. \\ This is passed to DASM as it is. Also useful for debugging.|
 +|''​-n''​ or ''​--noopt''​| Do NOT run the optimizer|
 +|''​ -h''​ or ''​--help''​| Display help|