teaser

Homework assignment

For this assignment, you will have to code a small program that you already all know and use: cat.

Repository & Deadlines

Deadline: Thu, November 17 2016, 23:59.

You must push your code before the deadline to:

git@git.cri.epita.net:p/2019-asm/cat-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][HW] . Any question without this tag will be ignored. You must as usual respect the basic rules for sending a news/email.

Expectations

You can have anything you want into your repository, but, I will only call either:

  • make
  • ./autogen.sh && ./configure && make

in order to build your code.

Here is some examples of the usage for your program:

$ echo "this is an example" > foo
$ echo "this is another example" > bar
$ ./cat < foo 
this is an example
$ ./cat bar
this is another example
$ ./cat foo bar 
this is an example
this is another example
$ ./cat foo non-exists
this is an example
cat: unable to open non-exists: No such file or directory
$ 

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.
  • no function should unnecessarly be exported (ie, only main should be exported)
  • you must use the libc for this assignement, authorised functions are:
    • open
    • close
    • read
    • write
    • err
    • warn
  • 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.