viandoxdev / xsnk

snake in x86_64 assembler (Linux)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

xsnk - Snake, in x86_64 assembly

Linux only, no std

This is a simple snake game in the terminal, in about 750 lines of assembly.

Building

Use the makefile, there is a build target.

Running

either

make run

or build then

./xsnk

Debugging

The debug targets are used to debug xsnk using gdb:

  • The debug target starts gdb and redirects output to /dev/pts/3 (should be a terminal)
  • The debug-server and debug-client targets are meant to be used in two different terminal, one terminal with the server will display the application (and accept inputs, this is the whole reason these targets exists), and the client one will be for gdb control.

All these targets load the symbols from symbols.h, these are structs used for debugging in gdb they are prefixed by s_.

Fun fact, I learned while making this project that instead of doing:

leaq symbol(%rip), %rax
movq (%rax), %rax

you could just do:

movq symbol(%rip), %rax

So some of the code is still using the top thing.

About

snake in x86_64 assembler (Linux)

License:GNU General Public License v3.0


Languages

Language:Assembly 93.5%Language:Makefile 3.8%Language:C 2.7%