hello world
This commit is contained in:
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
/bin/
|
||||||
|
/out/
|
||||||
6
.vscode/extensions.json
vendored
Normal file
6
.vscode/extensions.json
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"recommendations": [
|
||||||
|
"maziac.asm-code-lens",
|
||||||
|
"vadimcn.vscode-lldb"
|
||||||
|
]
|
||||||
|
}
|
||||||
13
.vscode/launch.json
vendored
Normal file
13
.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"type": "lldb",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "GDB64",
|
||||||
|
"program": "bin/game",
|
||||||
|
"stopOnEntry": false,
|
||||||
|
"preLaunchTask": "asm64"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
14
.vscode/tasks.json
vendored
Normal file
14
.vscode/tasks.json
vendored
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"version": "2.0.0",
|
||||||
|
"tasks": [
|
||||||
|
{
|
||||||
|
"label": "asm64",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "mkdir -p out; mkdir -p bin; nasm -F dwarf -g -f elf64 game.s -o out/game.o; ld -m elf_x86_64 -o bin/game out/game.o;",
|
||||||
|
"group": {
|
||||||
|
"kind": "build",
|
||||||
|
"isDefault": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1 +1,5 @@
|
|||||||
Making a game for linux terminal using pure asm
|
Making a game for linux terminal using pure asm
|
||||||
|
|
||||||
|
# References:
|
||||||
|
[Computer Enhance Course](https://www.computerenhance.com)
|
||||||
|
[Linux syscalls reference table](https://syscalls.mebeim.net/?table=x86/64/x64/v6.12)
|
||||||
18
game.s
Normal file
18
game.s
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
global _start
|
||||||
|
|
||||||
|
section .text
|
||||||
|
|
||||||
|
_start:
|
||||||
|
mov rax, 1 ; sys_write
|
||||||
|
mov rdi, 1 ; out
|
||||||
|
mov rsi, helloThere ; str
|
||||||
|
mov rdx, helloThereLen ; size
|
||||||
|
syscall ;
|
||||||
|
|
||||||
|
mov rax, 60 ; sys_exit
|
||||||
|
mov rdi, 0 ; code
|
||||||
|
syscall ;
|
||||||
|
|
||||||
|
section .rodata
|
||||||
|
helloThere: db "Hello there ;)", 0xA, "General Kenobi!!!", 0xA
|
||||||
|
helloThereLen: equ $ - helloThere
|
||||||
Reference in New Issue
Block a user