Git Product home page Git Product logo

libft-asm's Introduction

Libftasm

Building

make (#ez)

Memos

available registers for our architecture:

64 bits register 32 bits access 16 bits access 8 bits access volatile function calls (integer)
rax eax ax ah / al
rbx ebx bx bh / bl
rcx ecx cx ch / cl 4th argument
rdx edx dx dh / dl 3rd argument
rsp esp sp spl
rbp ebp bp bpl
rsi esi si sil 2nd argument
rdi edi di dil 1st argument
r8 r8d r8w r8b 5th argument
r9 r9d r9w r9b 6th argument
r10 r10d r10w r10b
r11 r11d r11w r11b
r12 r12d r12w r12b
r13 r13d r13w r13b
r14 r14d r14w r14b
r15 r15d r15w r15b

⚠️ When using a non volatile register, be sure to save its previous value (push it on the stack) before changing it and be sure to restore it after a ret

⚠️ Do not count on volatile registers to keep their values after a call or a syscall

Contributing

  • Use 4 spaces to indent (for both asm and c++ code)
  • Use ".s" as a file extension for nasm files
  • Put nasm files in the srcs folder
  • Put c++ test files in the tests folder
  • Respect the calling conventions mentionned above
  • Write thorough tests

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.