이 자료는 42서울 서브젝트 과제입니다.
소개
An assembly (or assembler) language, often abbreviated asm, is a low-level programming
종종 asm으로 축약되는 어셈블리는 로우레벨의 프로그래밍 언어,입니다!
language for a computer, or other programmable device, in which there is a very strong
컴퓨터 또는 기타 장비에서 프로그래밍이 가능한 언어 입니다.
(but often not one-to-one) correspondence between the language and the architecture’s machine code instructions.
어셈블리어는 특정 컴퓨터 아키텍처에 따라 특정됩니다.
뭔소린지 뭐르겠다. (어셈블리가 기계어와 일대일 대응이 되는 컴퓨터 프로그래밍 저급언어, 라는데 뭔소리인지 모르겟다. 같이 알아보자.)
아키텍쳐란?
아키텍처란 건축학을 의미한다고 한다. 컴퓨터 아키텍쳐(Computer architecture)의 경우" 비즈니스 요구사항을 만족하는 시스템을 구축하기 위한 전체 시스템에 대한 구조를 정의한 문서다. (컴퓨터 시스템의 하드웨어 구조를 말함., 하드웨어 장치인 cpu,레지스터, 기억장치, 입출력 장치 등과 같은 여러가지 컴퓨터 구성 요소들에 대한 전반적인 기계 구조와 이를 설계하는 방법입니다 .)
Each assembly language is specific to a particular computer
architecture. In contrast, most high-level programming languages are generally portable
과제 소개
• Your Makefile must at least contain the rules $(NAME), all, clean, fclean and
re. And must recompile/relink only necessary files.
To turn in bonuses to your project, you must include a rule bonus to your Makefile,
which will add all the various headers, librairies or functions that are forbidden on
the main part of the project. Bonuses must be in a different file _bonus.{c/h}.
Mandatory and bonus part evaluation is done separately.
We encourage you to create test programs for your project even though this work
won’t have to be submitted and won’t be graded. It will give you a chance
to easily test your work and your peers’ work. You will find those tests especially
useful during your defence. Indeed, during defence, you are free to use your tests
and/or the tests of the peer you are evaluating.
Submit your work to your assigned git repository. Only the work in the git repository will be graded. If Deepthought is assigned to grade your work, it will be done
after your peer-evaluations. If an error happens in any section of your work during
Deepthought’s grading, the evaluation will stop.
You must write 64 bits ASM. Beware of the "calling convention".
You can’t do inline ASM, you must do ’.s’ files.
You must compile your assembly code with nasm.
You must use the Intel syntax, not the AT&T
Mandatory part
• The library must be called libasm.a.
• You must submit a main that will test your functions and that will compile with
your library to show that it’s functional.
• You must rewrite the following functions in asm:
◦ ft_strlen (man 3 strlen)
◦ ft_strcpy (man 3 strcpy)
◦ ft_strcmp (man 3 strcmp)
◦ ft_write (man 2 write)
◦ ft_read (man 2 read)
◦ ft_strdup (man 3 strdup, you can call to malloc)
• You must check for errors during syscalls and properly set them when needed
• Your code must set the variable errno properly.
• For that, you are allowed to call the extern ___error.
Bonus part
You can rewrite these functions in asm. The linked list function will use the following