cmake now builds all the binaries and made length run without segfaulting... still doesnt work tho

This commit is contained in:
zombie maniac 2021-09-18 04:30:57 -04:00
parent b6470befab
commit e63923d4a8
3 changed files with 13 additions and 9 deletions

View file

@ -11,7 +11,13 @@ enable_language(ASM_NASM)
set(CMAKE_ASM_NASM_LINK_EXECUTABLE "gcc <CMAKE_ASM_NASM_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
add_compile_options(-g)
add_link_options(-fno-pie -m64 -no-pie -pedantic-errors)
#Make a EXE with cpp and asm files
add_executable(length length.asm)
add_executable(yes yes.asm)
add_executable(case case.asm)

View file

@ -1,7 +1,7 @@
extern puts
extern printf
default rel
%include "/home/zombie/Documents/bigdocs/redownloadables/gitshit/nbrooks211/zombie-core-utils/length_func.inc"
%include "../length_func.inc"
@ -11,7 +11,6 @@ section .rodata
section .data
text db "rEEEeee!EEeeeEeEEeE!EEEEEeEEE$eeeEE)EEeEeEEeeeEeEEEEEeeeEeeEeeEeeeeeEeEeEeeE",0
textlength db 76
section .text
global main
@ -20,10 +19,8 @@ main:
push text
mov r8, text
call length_func
pop r8

View file

@ -1,6 +1,6 @@
length_func:
pop r8
_loop67865432:
@ -13,8 +13,9 @@ _loop67865432:
_exitloop4323567:
dec r8 ; idk how to do it properly do im doing this instead
dec r8
dec r8
dec r8
push r8
mov rax, r8
ret