Skip to content

Building

Paul Raingeard edited this page Jan 6, 2022 · 16 revisions

VASM and VLINK integration

You can compile your program with VASM and VLINK. The build process is done in a task (to learn more about tasks : https://code.visualstudio.com/Docs/editor/tasks).

Create A build task

Prepare the workspace

You may prepare the workspace as described in this wiki page, or let the createStartupSequence and createExeFileParentDir parameters to true and the workspaces files needed will be created. Another way is to create an example workspace and use it as a bootstrap.

Configuration of the build task

File : .vscode/tasks.json

{
	"version": "2.0.0",
	"tasks": [
		{
			"type": "amigaassembly",
			"vasm": {
				"enabled": true,
				"command": "${config:amiga-assembly.binDir}/vasmm68k_mot",
				"args": [
					"-m68000",
					"-Fhunk",
					"-linedebug"
				]
			},
			"vlink": {
				"enabled": true,
				"command": "${config:amiga-assembly.binDir}/vlink",
				"includes": "*.{s,S,asm,ASM}",
				"excludes": "",
				"createStartupSequence": true,
				"createExeFileParentDir": true,
				"exefilename": "../uae/dh0/myprogram",
				"args": [
					"-bamigahunk",
					"-Bstatic"
				]
			},
			"problemMatcher": [],
			"label": "amigaassembly: build",
			"group": {
				"kind": "build",
				"isDefault": true
			}
		}
	]
}

Now you can launch the build :

  • Ctrl + Shift + B (or Command + Shift + B on Mac)

Compilation diagnostics

VASM will produce errors in the editor. There is a output window to see the raw output from the compiler and linker.

Diagnostics screenshot

Task definition

Global

option description
buildDir ) Specifies the path to the build directory
tmpDir ) Specifies the path to the temporary build directory

VASM

option description
enabled Enables the build with VASM
file VASM executable file with path
options build options sent to VASM, see the documentation or this for more information

VLINK

option description
enabled Enables the link with VLINK
file VLINK executable file with path
includes files to include in the link. If not set, only the opened file in the editor will be built
excludes files to exclude from the link
entrypoint The first '.o' file to send to the liker: entry point of the program. The filename is searched in the vlink path and compared without extension: you may type "mysource.s" or "mysource.o"
createStartupSequence If true, if the startup sequence file does not exists it will be created with the executable file name.
createExeFileParentDir If true, if the parent dir of the executable file does not exits it will be created.
exefilename Output executable file linked relative to the build dir
options build options sent to VLINK, see the vlink site for more information

Configure the build dir and temporary build dir in the settings

{
    "amiga-assembly.buildDir": "build",
    "amiga-assembly.tmpDir": "/tmp",
}

If it is a relative path it will be considered from the first folder in workspace.

For further documentation: vscode tasks.

Changing the build options for syntax checking

The syntax checking on save is done by calling a task. To change it's parameters you have to declare and configure it in the tasks.json file. changing vscode options for syntax checking

The build does not work anymore "spawn xxxx//vasmm68k_mot ENOENT"

The binDir setting is corrupted.

Please restore the default setting and reload the binaries.

rescue the the bindir