Quantcast
Channel: How does this code works in assembly - Stack Overflow
Viewing all articles
Browse latest Browse all 3

How does this code works in assembly

$
0
0

I am learning assembly on x86 and came across a code which actully zeroing the bss section where all unintialised variable are stored

    ;Zero the bss     movw    $__bss_start, %di     movw    $_end+3, %cx     xorl    %eax, %eax     subw    %di, %cx     shrw    $2, %cx     rep; stosl

But not sure how this piece of code works .Could anybody let me know how things are going on here,first instruction would be storing the address of bss segment to di register but whats purpose of last three instruction??


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images