Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site umcp-cs.UUCP Path: utzoo!linus!philabs!seismo!rlgvax!cvl!umcp-cs!chris From: chris@umcp-cs.UUCP Newsgroups: net.sources Subject: bcopy.s: defines bcopy() and cpyn(). Message-ID: <3069@umcp-cs.UUCP> Date: Sun, 9-Oct-83 19:16:50 EDT Article-I.D.: umcp-cs.3069 Posted: Sun Oct 9 19:16:50 1983 Date-Received: Mon, 10-Oct-83 08:54:30 EDT Organization: Univ. of Maryland, Computer Science Dept. Lines: 44 # Block copy routines for VAXen. # For non-vax people: # bcopy (from, to, count) register char *from, *to; register int count; { # while (--count >= 0) *to++ = *from++; # } # cpyn (to, from, count) register char *to, *from; register int count; { # while (--count >= 0) *to++ = *from++; # } # # bcopy (from, to, count) char *from, *to; int count; # # Copy "count" bytes from "from" to "to"; not guaranteed to # work if "from" and "to" overlap. # # cpyn (to, from, count) char *to, *from; int count; .align 2 .globl _cpyn _cpyn: .word 0 movl 4(ap),r3 # r3 = to movl 8(ap),r1 # r1 = from brb 2f .align 2 .globl _bcopy _bcopy: .word 0 movl 4(ap),r1 # r1 = from movl 8(ap),r3 # r3 = to brb 2f 1: subl2 r0,12(ap) # count-=65535 (bytes moved this time) movc3 r0,(r1),(r3) # r1, r3 magically point to next 65K 2: movzwl $65535,r0 cmpl 12(ap),r0 # <= 65535 bytes to move? jgtr 1b # brif not, move 65535 and try again movc3 12(ap),(r1),(r3) # move up to 65535 bytes ret -- In-Real-Life: Chris Torek, Univ of MD Comp Sci UUCP: {seismo,allegra,brl-bmd}!umcp-cs!chris CSNet: chris@umcp-cs ARPA: chris.umcp-cs@UDel-Relay