Could this code damage my processor??!!

Posted by Osama Gamal on Stack Overflow See other posts from Stack Overflow or by Osama Gamal
Published on 2010-04-29T19:39:54Z Indexed on 2010/04/29 19:47 UTC
Read the original article Hit count: 417

Filed under:
|
|

A friend sent me that code and alleges that it could damage the processor. Is that true?

void damage_processor() {
    while (true) {
        // Assembly code that sets the five control registers bits to ones which causes a bunch of exceptions in the system and then damages the processor
        Asm(
            "mov cr0, 0xffffffff \n\t"
            "mov cr1, 0xffffffff \n\t"
            "mov cr2, 0xffffffff \n\t"
            "mov cr3, 0xffffffff \n\t"
            "mov cr4, 0xffffffff \n\t"
        )
    }
}

Is that true?

© Stack Overflow or respective owner

Related posts about c

    Related posts about assembly