teaser

Computer Architecture and Assembly Language - Lab sessions

Repository & Deadlines

Deadline: Sun, December 18 2016 23:59.

You must push your code before the deadline to:

git@git.cri.epita.net:p/2019-asm/tp-LOGIN.git

You must change LOGIN with yours. You have to upload your ssh-key to accounts.cri.epita.net.

You can send questions on the newsgroup: labos.lse on news.epita.fr, with the tag: [ASM][TP] . Any question without this tag will be ignored. You must as usual respect the basic rules for sending a news/email.

General structure of your work:

$ find .
.
./libstring
./lists

Rules

  • all your code must be in x86_64 assembly language, and compiled with gcc.
  • you be use AT&T syntax as seen in courses.
  • you should export your function correctly, don’t have symbols for inner labels in your code (hint: .L).
  • no function should unnecessarly be exported.
  • error messages must be on the standard error output
  • you can’t use any global or static data.
  • string literals must be stored in .rodata.
  • Each folder should contain a Makefile that is creating the asked binaries.
  • Your assembly files should finish by .S and be compiled with gcc, as if you compile C code.
  • You need to respect the calling conventions used on linux for all your exported functions2.

libstring

For this exercise you need to create a shared library libstring.so that contains the following functions:

char *strchr(const char *s, int c);
char *strcpy(char *dest, const char *src);
size_t strlen(const char *s);

For all the functions, see their respective man pages.

lists

For this exercise you need to create a shared library liblists.so that implement the functions contained inside lists.h.

Authorized functions: malloc(3), free(3)