diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..567609b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +build/ diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..6f2005e --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,17 @@ +cmake_minimum_required(VERSION 3.14) +project (yes) + +#set(CMAKE_ASM_NASM_LINK_EXECUTABLE ld) + + +#Set C++ language version +set(CMAKE_CXX_STANDARD 17) +#Enable ASM provided by NASM +enable_language(ASM_NASM) + +set(CMAKE_ASM_NASM_LINK_EXECUTABLE "gcc -o ") + +add_link_options(-fno-pie -m64 -no-pie -pedantic-errors) + +#Make a EXE with cpp and asm files +add_executable(yes yes.asm) diff --git a/yes.asm b/yes.asm new file mode 100644 index 0000000..2436e4e --- /dev/null +++ b/yes.asm @@ -0,0 +1,27 @@ +extern puts + +section .data + text db "y",0 +section .text + global main + +main: + sub rsp, 8 + + +_loop: + + mov rdi, text + cld + call puts ;this is the put s way of printing a string + jmp _loop + +_end: + add rsp, 8 + ret + +; mov rax, 60 ; exit +; mov edi, 1 ; error 1 dont need the exit anymore beacue libc or somthing +; syscall + +