x86_64 Linux assembly files handwritten from scratch with caveman logic to practice fundamentals
-
this repo contains simple assembly programs that help me practice fundamentals of
x86_64 Linux Assembly. -
this will contain every kind of program handwritten by your truly in assembly.
- First of all the question should be where to run. The register sequence I address to while writing this program is specifically followed only on 64bit Linux Architectures. The Builders of the kernels might be having their hands in this specific register addrressing but I dont know that much. Even I dont know what I just wrote here but here is the TLDR.
TLDR: Use Linux to execute these
-
gccoras: almost every linux distro comes preinstalled with them, but If you are a freak who uses arch or gnome or LFS or anything similar, make sure you install these with your respective package managers. -
ld: well this is a sub-pre-requisite (is that a word?) toas, but I think you get this shipped by default with the GNU compiler but I dont know. Better safe than sorry.
- Finally the Execution (not exactly, compile it first)
- Compile: two ways, via
gccoras. Keep in mindaswill give you and object file,gccis one way, no checkpoints.
## Using `as`
as {filename.s} -o {objectname.o}
ld {objectname} -o {binaryname}
# example:
# as hello.s -o hello.o
# ld hello.o -o hello
#-------------------------------------------
## Using gcc
gcc -nostdlib {filename.s} -o {binaryname} -no-pie
# example:
# gcc -nostdlib hello.s -o hello -no-pie- Run it: just run it
# How
./{binaryname}
# example
# ./hello