Skip to content

Instantly share code, notes, and snippets.

@mhvelplund
Last active July 24, 2020 07:05
Show Gist options
  • Save mhvelplund/a47ca158d14862375c88c04adec7660f to your computer and use it in GitHub Desktop.
Save mhvelplund/a47ca158d14862375c88c04adec7660f to your computer and use it in GitHub Desktop.
NASM project for VS Code
{
"folders": [
...
],
"settings": {},
"tasks": {
"version": "2.0.0",
"tasks": [
{
"label": "make",
"type": "shell",
"command": "make",
"presentation": {
"echo": false,
"reveal": "never",
"focus": false,
"panel": "dedicated",
"showReuseMessage": false,
"clear": true
},
"options": {
"cwd": "${fileDirname}"
},
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": [
{
"fileLocation": [
"relative",
"${fileDirname}"
],
"applyTo": "allDocuments",
"source": "nasm",
"pattern": {
"regexp": "^([^:]+):(\\d+): ([^:]+): (.*)$",
"file": 1,
"line": 2,
"severity": 3,
"message": 4
}
},
{
"fileLocation": [
"relative",
"${fileDirname}"
],
"applyTo": "allDocuments",
"source": "ld",
"pattern": {
"regexp": "^([^:]+):(\\d+): (.*)$",
"file": 1,
"line": 2,
"message": 3
}
}
]
},
{
"label": "clean",
"type": "shell",
"command": "make",
"args": [
"clean"
],
"presentation": {
"echo": false,
"reveal": "never",
"focus": false,
"panel": "dedicated",
"showReuseMessage": false,
"clear": true
},
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": []
}
]
}
}
%.o : %.asm
nasm -felf64 -F dwarf $< -o $@
hello: greet.o write.o readline.o termio.o
ld $^ -o $@
clean:
rm -f *.o hello
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment