From bfffbf587dcb6fc7a3f42c536ecd05bfbd30c6b2 Mon Sep 17 00:00:00 2001 From: zombie Date: Tue, 7 Sep 2021 19:58:21 -0400 Subject: [PATCH] did your mom last night --- .gitignore | 1 + helloworld/hello | Bin 8968 -> 8936 bytes helloworld/hello.asm | 32 ++++++++++++++++++++++---------- helloworld/hello.o | Bin 1120 -> 1120 bytes printf/CMakeLists.txt | 17 +++++++++++++++++ printf/hello.asm | 41 +++++++++++++++++++++++++++++++++++++++++ printf/hello.o | Bin 0 -> 1056 bytes 7 files changed, 81 insertions(+), 10 deletions(-) create mode 100644 .gitignore create mode 100644 printf/CMakeLists.txt create mode 100644 printf/hello.asm create mode 100644 printf/hello.o diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ea24011 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +printf/build/ diff --git a/helloworld/hello b/helloworld/hello index b55677b51b453e65fb1737b1721a9140a2c2fba9..4411c27f0a1edf834a920599d10bbd0a505861af 100755 GIT binary patch delta 319 zcmeBhd*M1kgE3>GWb~f9#saQnB%{LE*%i&>)ksTftvS&2#bn)p$2vVuZ_qzXtq10#d0fCHEXBlIS3R1mk+1abu!m>Bq> z2E$}cafpLV1F097%&4fzS&~{&0=9FqlVa=S6N(CqIg?*1+B5P`)>JYV6;Obf_5ngM humEYc$)!r#oD7N(A)Cp93c{23D5)^oOn#`O4gi_jJIeq7 delta 324 zcmaFi+Tk`qgRx_xWcOS9#saQnCJh4KAjNe>)ktSfSUJ%4B%(oTqw}bKZ#L+#gXg(|A`-ECTl1p z7^;B{XJTLh>O=;{U=AaLs{pFF?c{|D;+7UbSpfzn239m(E;z(Nrh(LRO#Y~#DN&r0 znp%*PnwMUZ!2o6_=a=S{q!vw9R&1TTTv3rRaPmn-dq&pDoJ!`R911|aK)}HWp;>?w Z`{Yn1ZB7A2h=}*(P9<~3=*b6_)B%YhI*>EZ#4IsQB7(g9(< z-aT1?NmPgjsFI&`hYgV0&j@Bu&S84Ps6DxmS)5%3C?LSVG|^FN@*HMI{XJsd*`r?=x3Q1OgR;0LTQ8%b~7g008`ZF%tj) delta 254 zcmaFB@qlB(0!G$}3+)*LCq6W1ESN0GXfL{fi2)2gKqv-QAk8^Bm(iHfe)2*_bIu3M z5Q&P(4;huj|3g)QDW7f@RS?6cd$JUhqM@(li4swtZXU3h=l_E~oe<{h-8*c6s`i7F z@`H?rfyp&YZw%GIJVpi -o ") + +add_link_options(-fno-pie -m64 -no-pie -pedantic-errors) + +#Make a EXE with cpp and asm files +add_executable(hello hello.asm) diff --git a/printf/hello.asm b/printf/hello.asm new file mode 100644 index 0000000..a8f13fa --- /dev/null +++ b/printf/hello.asm @@ -0,0 +1,41 @@ +extern puts + +section .data + text db "Bottom Text",10,0 +section .text + global main + +main: + sub rsp, 8 + mov r9b, [text] + + + mov rax, 1 ;syscall 1 + mov rdi, 1 ; arg 1 (stdout) + mov rsi, text ; the shit to print + mov rdx, 12 ; the length + syscall ;invoke +; ^^^^ is the linux syscall way of printing a string + + mov r8b, [text] + add r8b, 1 + mov [text], r8b + + + + + mov rdi, text + cld + call puts + + add rsp, 8 + ret + + + +_end: + mov rax, 60 ; exit + mov edi, 1 ; error 1 + syscall + + diff --git a/printf/hello.o b/printf/hello.o new file mode 100644 index 0000000000000000000000000000000000000000..c3f4ec98402835bd446e976e0c82630dfc5898f5 GIT binary patch literal 1056 zcmb<-^>JfjWMqH=Mg}_u1P><4z~F#jLfH-s>HnwNrzACS4ox?$-BA>dkS8+d{?B&2fi{gUkk{(?9