make
(#ez)
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 | ❌ |
ret
call
or a syscall
- 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