.title memcpy ;+ --- ; ; The routines in this file are things that seemed easier to do in ; MACRO. ;- ---- .library /sys$library:lib.mlb/ $ssdef $qiodef $pcbdef $jibdef $phddef .psect data,rd,wrt,noexe ;+ --- ; ; 4(ap) descriptor of dest ; 8(ap) address of source ; 12(ap) length of source by reference ; 16(ap) possible alternate fill other than zero byte ; ;- --- .psect code,rd,exe,nowrt .entry memcpy,^m movl 4(ap),r6 ;Get the descriptor cvtwl (r6),r7 ;Get the length from the descr movl 4(r6),r6 ;Get the string address movl #0,r8 ;Get the default fill byte cmpl 0(ap),#4 ;Check the argcount bneq 10$ ;Jump it no fill byte passed cvtlb 16(ap),r8 ;Get the fill byte desired 10$: movc5 @12(ap),@8(ap),- r8,r7,(r6) ;Copy memory with fill ret ;+ --- ; ; 4(ap) address of dest ; 8(ap) Length of dest by reference ; ;- --- .entry memfill,^m movl 4(ap),r6 ;Get the dest address 10$: movc5 #0,(r6),#0,@8(ap),(r6) ret ;+ --- ; ; Convert the seconds passed in @8(ap) to a quadword delta time ; 4(ap) points to the quadword where the result is to be stored. ; ;- --- .entry delta_secs,^m movl #-10000000,R1 ;Get one second in delta time movl @8(ap),r2 ;Get the desired seconds emuL r1,r2,#0,@4(ap) ;Compute the result ret ;+ --- ; ; CHMK and change the uic and username to the ones passed. ; ; 4(ap) Username by descriptor ; 8(ap) Uic by value ; ;- --- .entry setuic,^m pushal (ap) ;Pass the args as we got them pushab knl_setuic ;Pass the routine to call calls #2,sys$cmkrnl ;CHMK and do the routine ret ;+ --- ; ; This Kernel mode routine changes the UIC and USERNAME of the ; current process to those passed as parameters. 8(ap) is the ; uic by value. 4(ap) is the address of a descriptor of the ; new username. ; ;- --- .entry knl_setuic,^m movl PCB$L_JIB(r4),r7 ;Get the jib address movl 8(ap),PCB$L_UIC(r4) ;Set the new uic movl 4(ap),r6 ;Get the descriptor addr cvtwl (r6),r5 ;Get the length movl 4(r6),r6 ;Get the string address movc5 r5,(r6),#32,- #JIB$S_USERNAME,- JIB$T_USERNAME(r7) ;Set the new username movl #SS$_NORMAL,r0 ;return success ret .end