Asm variable in C code

I am reading John Viega's book on safe programming for C and C ++. There is a code snippet where I need help to understand:

asm(".long 0xCEFAEDFE \n"
    "crc32_stored:    \n"
    ".long 0xFFFFFFFF \n"
    ".long 0xCEFAEDFE \n"
);

int main(){
    //crc32_stored used here as a variable
}

What are these lines: "crc32_stored:\n", ".long 0xFFFFFFFF \n"? Is this variable definition and initialization?

Trying to compile code from a book, I got the following error:

error: ‘crc32_stored’ undeclared (first use in this function)
+4
source share
1 answer

crc32_stored: - , . , , crc32_stored, .long 0xFFFFFFFF, FF-. , ( ).

C ( ) : , , , .. int long. C int crc32_stored = 0xFFFFFFFF;, ( ) crc32_stored: .long 0xFFFFFFFF, .

C "crc32_stored", , . , "extern", extern int crc32_stored. "" , .

, , C (.. 4 , 32- ).

: C, . C- , . ( , .)

+3

Source: https://habr.com/ru/post/1613654/


All Articles