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??