Annotation of 43BSD/lib/libc/vax/gen/bcopy.s, revision 1.1.1.1

1.1       root        1: /*
                      2:  * Copyright (c) 1983 Regents of the University of California.
                      3:  * All rights reserved.  The Berkeley software License Agreement
                      4:  * specifies the terms and conditions for redistribution.
                      5:  */
                      6: 
                      7: #ifdef LIBC_SCCS
                      8:        .asciz  "@(#)bcopy.s    5.3 (Berkeley) 3/9/86"
                      9: #endif LIBC_SCCS
                     10: 
                     11: /* bcopy(from, to, size) */
                     12: 
                     13: #include "DEFS.h"
                     14: 
                     15: ENTRY(bcopy, R6)
                     16:        movl    4(ap),r1
                     17:        movl    8(ap),r3
                     18:        movl    12(ap),r6
                     19:        cmpl    r1,r3
                     20:        bgtr    2f              # normal forward case
                     21:        blss    3f              # overlapping, must do backwards
                     22:        ret                     # equal, nothing to do
                     23: 1:
                     24:        subl2   r0,r6
                     25:        movc3   r0,(r1),(r3)
                     26: 2:
                     27:        movzwl  $65535,r0
                     28:        cmpl    r6,r0
                     29:        jgtr    1b
                     30:        movc3   r6,(r1),(r3)
                     31:        ret
                     32: 3:
                     33:        addl2   r6,r1
                     34:        addl2   r6,r3
                     35:        movzwl  $65535,r0
                     36:        jbr     5f
                     37: 4:
                     38:        subl2   r0,r6
                     39:        subl2   r0,r1
                     40:        subl2   r0,r3
                     41:        movc3   r0,(r1),(r3)
                     42:        movzwl  $65535,r0
                     43:        subl2   r0,r1
                     44:        subl2   r0,r3
                     45: 5:
                     46:        cmpl    r6,r0
                     47:        jgtr    4b
                     48:        subl2   r6,r1
                     49:        subl2   r6,r3
                     50:        movc3   r6,(r1),(r3)
                     51:        ret

unix.superglobalmegacorp.com

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