Annotation of lucent/sys/src/libc/68020/memset.s, revision 1.1

1.1     ! root        1:        TEXT    memset(SB), $0
        !             2:        MOVL    n+8(FP), R0
        !             3:        BLE     return
        !             4:        MOVL    s1+0(FP), A1
        !             5:        CLRL    R1
        !             6:        MOVB    c+7(FP), R1
        !             7:        BEQ     l1
        !             8: 
        !             9: /*
        !            10:  * create 4 replicated copies
        !            11:  * of the byte in R1
        !            12:  */
        !            13:        MOVL    R1, R2
        !            14:        ASLL    $8, R2
        !            15:        ORL     R2, R1
        !            16:        MOVL    R1, R2
        !            17:        SWAP    R2
        !            18:        ORL     R2, R1
        !            19: 
        !            20: /*
        !            21:  * quad-long-at-a-time set
        !            22:  * destination allignment is not
        !            23:  * very important.
        !            24:  */
        !            25: l1:
        !            26:        SUBL    $16, R0
        !            27:        BLT     l2
        !            28:        MOVL    R1, (A1)+
        !            29:        MOVL    R1, (A1)+
        !            30:        MOVL    R1, (A1)+
        !            31:        MOVL    R1, (A1)+
        !            32:        BRA     l1
        !            33: 
        !            34: /*
        !            35:  * cleanup byte-at-a-time
        !            36:  */
        !            37: l2:
        !            38:        ADDL    $15, R0
        !            39:        BLT     return
        !            40: l3:
        !            41:        MOVB    R1, (A1)+
        !            42:        SUBL    $1, R0
        !            43:        BGE     l3
        !            44: 
        !            45: return:
        !            46:        MOVL    s1+0(FP),R0
        !            47:        RTS

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.