Monday, August 31, 2020

compiling - although this is often used as a generalized and simplified term, it actually has a more precise definition

compiling is taking your source code (after being pre-processed) and converting it into assembly code


for example:


...
main:                                                 # @main
        .cfi_startproc
#   BB#0:
        pushq      %rbp
.Ltmp0:
        .cfi_def_cfa_offset  16
.Ltmp1:
        .cfi_offset  %rbp,  -16
        movq    %rsp, %rbp
Ltmp2:
        .cfi_def_cfa_register   %rbp
        subq      $16, %rsp
        xor1      %eax, %eax
        mov1     %eax, %edi
        movabsq        $.L.str, %rsi
        movb      $0, %al
        callq       get_string
        movabsq        $.L.str, %rdi
        movq       %rax, -8(%rbp)
        movq        -8(%rbp), %rsi
        movb       %0, %al
        callq            printf
        ...





cs50, lec2


No comments:

Post a Comment