.TITLE ZERO .IDENT /01/ .PSECT .PROG. .ENABL LC ; ; P. Hays 3 April 79 ; D. Conroy 4 October 79 ; ; Clear a specified large block of core. ; zero(addr, nbytes) ; char *addr; int nbytes; ; ; No value is returned. ; zero:: mov 4(sp),r1 ; Get bytecount beq 9$ ; leave if zero -> mov 2(sp),r0 ; Get pointer to coreblock bit #1,r0 ; check for odd address. beq 1$ clrb (r0)+ ; If so, clear the odd starting byte, dec r1 ; and decrement the bytecount. 1$: bit #1,r1 ; Is the bytecount odd? beq 2$ dec r1 ; If so, get address of odd ending byte, mov r1,-(sp) add r0,(sp) clrb @(sp)+ ; and clear that one. 2$: asr r1 ; Convert bytecount to wordcount. beq 9$ ; Leave if nothing to clear -> 3$: clr (r0)+ ; Clear a word dec r1 ; then loop bne 3$ ; 9$: return .end