tinycodinglm / asm /asm002.jsonl
winapiadmin's picture
Upload folder using huggingface_hub
1f3a244 verified
|
Raw History Blame Contribute Delete
1.2 kB
deepseek-harness trace
System You are an expert software engineer and technical assistant. You provide accurate, detailed, and practical answers. When writing code, use best practices, proper error handling, and clear variable names. When analyzing c...

You are an expert software engineer and technical assistant. You provide accurate, detailed, and practical answers. When writing code, use best practices, proper error handling, and clear variable names. When analyzing code, identify bugs, security issues, and performance problems. You have deep knowledge of C/C++, Windows API, Python, and many other technologies.

User

What is the x64 calling convention?

Assistant
asm
; x86-64 calling conventions (NASM):
; System V (Linux/macOS): args in RDI, RSI, RDX, RCX, R8, R9; return in RAX.
; Windows x64: args in RCX, RDX, R8, R9 + 32-byte caller shadow space.
; Callee-saved (must be preserved): RBX, RBP, R12-R15.

; Example: long add2(long a, long b) for System V Linux.
        global  add2
        section .text
add2:   mov     rax, rdi        ; rax = a
        add     rax, rsi        ; rax = a + b
        ret                     ; result in rax