diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2013-02-02 13:32:07 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2013-02-02 13:32:07 +0000 |
commit | 22cba234393e85cacb460dd6e3f6aadc75278969 (patch) | |
tree | 2a2b3982e48ded6f3aa6d8d4539b9873d7c5d4d9 /sys/lib/libkern/arch | |
parent | bfb23955a64b7aa0e072e92cbfc69f31228df265 (diff) |
Kernel bits for m68k/ELF, mostly from NetBSD. In addition, the `pmod' symbel
in fpsp has to be renamed due to a clash with other parts of the kernel.
Diffstat (limited to 'sys/lib/libkern/arch')
-rw-r--r-- | sys/lib/libkern/arch/m68k/bcmp.S | 36 | ||||
-rw-r--r-- | sys/lib/libkern/arch/m68k/bzero.S | 28 | ||||
-rw-r--r-- | sys/lib/libkern/arch/m68k/ffs.S | 16 | ||||
-rw-r--r-- | sys/lib/libkern/arch/m68k/htonl.S | 4 | ||||
-rw-r--r-- | sys/lib/libkern/arch/m68k/htons.S | 6 | ||||
-rw-r--r-- | sys/lib/libkern/arch/m68k/memcmp.S | 50 | ||||
-rw-r--r-- | sys/lib/libkern/arch/m68k/memset.S | 74 | ||||
-rw-r--r-- | sys/lib/libkern/arch/m68k/scanc.S | 28 | ||||
-rw-r--r-- | sys/lib/libkern/arch/m68k/skpc.S | 16 | ||||
-rw-r--r-- | sys/lib/libkern/arch/m68k/strcmp.S | 18 | ||||
-rw-r--r-- | sys/lib/libkern/arch/m68k/strlen.S | 10 | ||||
-rw-r--r-- | sys/lib/libkern/arch/m68k/strncmp.S | 22 | ||||
-rw-r--r-- | sys/lib/libkern/arch/m68k/strncpy.S | 18 |
13 files changed, 163 insertions, 163 deletions
diff --git a/sys/lib/libkern/arch/m68k/bcmp.S b/sys/lib/libkern/arch/m68k/bcmp.S index ddcbf5a46d2..4c2f2b4ebb1 100644 --- a/sys/lib/libkern/arch/m68k/bcmp.S +++ b/sys/lib/libkern/arch/m68k/bcmp.S @@ -1,4 +1,4 @@ -/* $OpenBSD: bcmp.S,v 1.4 2007/11/24 19:38:04 deraadt Exp $ */ +/* $OpenBSD: bcmp.S,v 1.5 2013/02/02 13:32:06 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -46,38 +46,38 @@ * - use nested DBcc instructions or use one and limit size to 64K */ ENTRY(bcmp) - movl sp@(4),a0 | string 1 - movl sp@(8),a1 | string 2 - movl sp@(12),d0 | length + movl %sp@(4),%a0 | string 1 + movl %sp@(8),%a1 | string 2 + movl %sp@(12),%d0 | length beq bcdone | if zero, nothing to do - movl a0,d1 - btst #0,d1 | string 1 address odd? + movl %a0,%d1 + btst #0,%d1 | string 1 address odd? beq bceven | no, skip alignment - cmpmb a0@+,a1@+ | yes, compare a byte + cmpmb %a0@+,%a1@+ | yes, compare a byte bne bcnoteq | not equal, return non-zero - subql #1,d0 | adjust count + subql #1,%d0 | adjust count beq bcdone | count 0, reutrn zero bceven: - movl a1,d1 - btst #0,d1 | string 2 address odd? + movl %a1,%d1 + btst #0,%d1 | string 2 address odd? bne bcbloop | yes, no hope for alignment, compare bytes - movl d0,d1 | no, both even - lsrl #2,d1 | convert count to longword count + movl %d0,%d1 | no, both even + lsrl #2,%d1 | convert count to longword count beq bcbloop | count 0, skip longword loop bclloop: - cmpml a0@+,a1@+ | compare a longword + cmpml %a0@+,%a1@+ | compare a longword bne bcnoteq | not equal, return non-zero - subql #1,d1 | adjust count + subql #1,%d1 | adjust count bne bclloop | still more, keep comparing - andl #3,d0 | what remains + andl #3,%d0 | what remains beq bcdone | nothing, all done bcbloop: - cmpmb a0@+,a1@+ | compare a byte + cmpmb %a0@+,%a1@+ | compare a byte bne bcnoteq | not equal, return non-zero - subql #1,d0 | adjust count + subql #1,%d0 | adjust count bne bcbloop | still more, keep going rts bcnoteq: - moveq #1,d0 + moveq #1,%d0 bcdone: rts diff --git a/sys/lib/libkern/arch/m68k/bzero.S b/sys/lib/libkern/arch/m68k/bzero.S index 8557998ba1d..b61d55ff2a1 100644 --- a/sys/lib/libkern/arch/m68k/bzero.S +++ b/sys/lib/libkern/arch/m68k/bzero.S @@ -1,4 +1,4 @@ -/* $OpenBSD: bzero.S,v 1.4 2007/11/24 19:38:04 deraadt Exp $ */ +/* $OpenBSD: bzero.S,v 1.5 2013/02/02 13:32:06 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -45,28 +45,28 @@ * - use nested DBcc instructions or use one and limit size to 64K */ ENTRY(bzero) - movl sp@(4),a0 | destination - movl sp@(8),d0 | count + movl %sp@(4),%a0 | destination + movl %sp@(8),%d0 | count beq bzdone | nothing to do - movl a0,d1 - btst #0,d1 | address odd? + movl %a0,%d1 + btst #0,%d1 | address odd? beq bzeven | no, skip alignment - clrb a0@+ | yes, clear a byte - subql #1,d0 | adjust count + clrb %a0@+ | yes, clear a byte + subql #1,%d0 | adjust count beq bzdone | if zero, all done bzeven: - movl d0,d1 - lsrl #2,d1 | convert to longword count + movl %d0,%d1 + lsrl #2,%d1 | convert to longword count beq bzbloop | no longwords, skip loop bzlloop: - clrl a0@+ | clear a longword - subql #1,d1 | adjust count + clrl %a0@+ | clear a longword + subql #1,%d1 | adjust count bne bzlloop | still more, keep going - andl #3,d0 | what remains + andl #3,%d0 | what remains beq bzdone | nothing, all done bzbloop: - clrb a0@+ | clear a byte - subql #1,d0 | adjust count + clrb %a0@+ | clear a byte + subql #1,%d0 | adjust count bne bzbloop | still more, keep going bzdone: rts diff --git a/sys/lib/libkern/arch/m68k/ffs.S b/sys/lib/libkern/arch/m68k/ffs.S index 970db7568cc..cca620e30f9 100644 --- a/sys/lib/libkern/arch/m68k/ffs.S +++ b/sys/lib/libkern/arch/m68k/ffs.S @@ -1,4 +1,4 @@ -/* $OpenBSD: ffs.S,v 1.4 2007/11/24 19:38:04 deraadt Exp $ */ +/* $OpenBSD: ffs.S,v 1.5 2013/02/02 13:32:06 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -38,11 +38,11 @@ #include "DEFS.h" ENTRY(ffs) - movl sp@(4),d0 - movl d0,d1 - negl d0 - andl d0,d1 - movql #32,d0 - bfffo d1{#0:#32},d1 - subl d1,d0 + movl %sp@(4),%d0 + movl %d0,%d1 + negl %d0 + andl %d0,%d1 + movql #32,%d0 + bfffo %d1{#0:#32},%d1 + subl %d1,%d0 rts diff --git a/sys/lib/libkern/arch/m68k/htonl.S b/sys/lib/libkern/arch/m68k/htonl.S index 22d8aaca2c1..d13088cd286 100644 --- a/sys/lib/libkern/arch/m68k/htonl.S +++ b/sys/lib/libkern/arch/m68k/htonl.S @@ -1,4 +1,4 @@ -/* $OpenBSD: htonl.S,v 1.4 2007/11/25 18:25:35 deraadt Exp $ */ +/* $OpenBSD: htonl.S,v 1.5 2013/02/02 13:32:06 miod Exp $ */ /* $NetBSD: htonl.S,v 1.2 1994/10/26 06:39:27 cgd Exp $ */ /*- @@ -41,5 +41,5 @@ ALTENTRY(ntohl, _htonl) ALTENTRY(bswap32, _htonl) ENTRY(htonl) - movl sp@(4),d0 + movl %sp@(4),%d0 rts diff --git a/sys/lib/libkern/arch/m68k/htons.S b/sys/lib/libkern/arch/m68k/htons.S index d9b4a308931..6fd535f8e74 100644 --- a/sys/lib/libkern/arch/m68k/htons.S +++ b/sys/lib/libkern/arch/m68k/htons.S @@ -1,4 +1,4 @@ -/* $OpenBSD: htons.S,v 1.4 2007/11/25 18:25:35 deraadt Exp $ */ +/* $OpenBSD: htons.S,v 1.5 2013/02/02 13:32:06 miod Exp $ */ /* $NetBSD: htons.S,v 1.2 1994/10/26 06:39:27 cgd Exp $ */ /*- @@ -41,6 +41,6 @@ ALTENTRY(ntohs, _htons) ALTENTRY(bswap16, _htons) ENTRY(htons) - clrl d0 - movw sp@(6),d0 + clrl %d0 + movw %sp@(6),%d0 rts diff --git a/sys/lib/libkern/arch/m68k/memcmp.S b/sys/lib/libkern/arch/m68k/memcmp.S index cefea2a60fa..e9d032cc426 100644 --- a/sys/lib/libkern/arch/m68k/memcmp.S +++ b/sys/lib/libkern/arch/m68k/memcmp.S @@ -1,4 +1,4 @@ -/* $OpenBSD: memcmp.S,v 1.3 2007/11/24 19:38:04 deraadt Exp $ */ +/* $OpenBSD: memcmp.S,v 1.4 2013/02/02 13:32:06 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -46,47 +46,47 @@ * - use nested DBcc instructions or use one and limit size to 64K */ ENTRY(memcmp) - movl sp@(4),a0 | string 1 - movl sp@(8),a1 | string 2 - movl sp@(12),d0 | length + movl %sp@(4),%a0 | string 1 + movl %sp@(8),%a1 | string 2 + movl %sp@(12),%d0 | length beq bcdone | if zero, nothing to do - movl a0,d1 - btst #0,d1 | string 1 address odd? + movl %a0,%d1 + btst #0,%d1 | string 1 address odd? beq bceven | no, skip alignment - cmpmb a0@+,a1@+ | yes, compare a byte + cmpmb %a0@+,%a1@+ | yes, compare a byte bne bcnoteq | not equal, return non-zero - subql #1,d0 | adjust count + subql #1,%d0 | adjust count beq bcdone | count 0, reutrn zero bceven: - movl a1,d1 - btst #0,d1 | string 2 address odd? + movl %a1,%d1 + btst #0,%d1 | string 2 address odd? bne bcbloop | yes, no hope for alignment, compare bytes - movl d0,d1 | no, both even - lsrl #2,d1 | convert count to longword count + movl %d0,%d1 | no, both even + lsrl #2,%d1 | convert count to longword count beq bcbloop | count 0, skip longword loop bclloop: - cmpml a0@+,a1@+ | compare a longword + cmpml %a0@+,%a1@+ | compare a longword bne bcnoteql | not equal, return non-zero - subql #1,d1 | adjust count + subql #1,%d1 | adjust count bne bclloop | still more, keep comparing - andl #3,d0 | what remains + andl #3,%d0 | what remains beq bcdone | nothing, all done bcbloop: - cmpmb a0@+,a1@+ | compare a byte + cmpmb %a0@+,%a1@+ | compare a byte bne bcnoteq | not equal, return non-zero - subql #1,d0 | adjust count + subql #1,%d0 | adjust count bne bcbloop | still more, keep going rts bcnoteql: - subql #4,a0 - subql #4,a1 - movl #4,d0 + subql #4,%a0 + subql #4,%a1 + movl #4,%d0 jra bcbloop bcnoteq: - clrl d0 - clrl d1 - movb a0@-,d0 - movb a1@-,d1 - subl d1,d0 + clrl %d0 + clrl %d1 + movb %a0@-,%d0 + movb %a1@-,%d1 + subl %d1,%d0 bcdone: rts diff --git a/sys/lib/libkern/arch/m68k/memset.S b/sys/lib/libkern/arch/m68k/memset.S index e2ecdc5f7b1..75b4b38d352 100644 --- a/sys/lib/libkern/arch/m68k/memset.S +++ b/sys/lib/libkern/arch/m68k/memset.S @@ -1,4 +1,4 @@ -/* $OpenBSD: memset.S,v 1.3 2007/11/24 19:38:04 deraadt Exp $ */ +/* $OpenBSD: memset.S,v 1.4 2013/02/02 13:32:06 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -45,55 +45,55 @@ * - use nested DBcc instructions or use one and limit size to 64K */ ENTRY(memset) - movl d2,sp@- - movl sp@(8),a0 | destination - movl sp@(16),d0 | count + movl %d2,%sp@- + movl %sp@(8),%a0 | destination + movl %sp@(16),%d0 | count beq bzdone | nothing to do - movb sp@(15),d2 | character - movl a0,d1 - btst #0,d1 | address odd? + movb %sp@(15),%d2 | character + movl %a0,%d1 + btst #0,%d1 | address odd? beq bzeven | no, skip alignment - movb d2,a0@+ | set one byte - subql #1,d0 | adjust count + movb %d2,%a0@+ | set one byte + subql #1,%d0 | adjust count beq bzdone | if zero, all done bzeven: - cmpl #15,d0 + cmpl #15,%d0 ble bzbloop | too small to be worthwhile - clrl d1 | replicate byte to fill longword - movb d2,d1 - movl d1,d2 - lsll #8,d1 - orl d1,d2 - lsll #8,d1 - orl d1,d2 - lsll #8,d1 - orl d1,d2 - movl d0,d1 | convert to longword count - lsrl #2,d1 + clrl %d1 | replicate byte to fill longword + movb %d2,%d1 + movl %d1,%d2 + lsll #8,%d1 + orl %d1,%d2 + lsll #8,%d1 + orl %d1,%d2 + lsll #8,%d1 + orl %d1,%d2 + movl %d0,%d1 | convert to longword count + lsrl #2,%d1 #ifdef DEBUG - moveml #0xffff,sp@- - movl d2,sp@- - movl d1,sp@- - movl d0,sp@- - movl a0,sp@- - movl #foo,sp@- - jsr _printf - addl #20,sp - moveml sp@+,#0xffff + moveml #0xffff,%sp@- + movl %d2,%sp@- + movl %d1,%sp@- + movl %d0,%sp@- + movl %a0,%sp@- + movl #foo,%sp@- + jsr _C_LABEL(printf) + addl #20,%sp + moveml %sp@+,#0xffff #endif bzlloop: - movl d2,a0@+ | set one longword - subql #1,d1 | adjust count + movl %d2,%a0@+ | set one longword + subql #1,%d1 | adjust count bne bzlloop | still more, keep going - andl #3,d0 | what remains + andl #3,%d0 | what remains beq bzdone | nothing, all done bzbloop: - movb d2,a0@+ | set one byte - subql #1,d0 | adjust count + movb %d2,%a0@+ | set one byte + subql #1,%d0 | adjust count bne bzbloop | still more, keep going bzdone: - movl sp@(8),d0 | return destination - movl sp@+,d2 + movl %sp@(8),%d0 | return destination + movl %sp@+,%d2 rts #ifdef DEBUG diff --git a/sys/lib/libkern/arch/m68k/scanc.S b/sys/lib/libkern/arch/m68k/scanc.S index d315640318f..7f3dfeeb713 100644 --- a/sys/lib/libkern/arch/m68k/scanc.S +++ b/sys/lib/libkern/arch/m68k/scanc.S @@ -1,4 +1,4 @@ -/* $OpenBSD: scanc.S,v 1.3 2003/06/02 23:28:08 millert Exp $ */ +/* $OpenBSD: scanc.S,v 1.4 2013/02/02 13:32:06 miod Exp $ */ /* $NetBSD: scanc.S,v 1.2 1994/10/26 06:39:31 cgd Exp $ */ /* @@ -45,20 +45,20 @@ * scanc(count, startc, table, mask) */ ENTRY(scanc) - movl sp@(4),d0 | get length + movl %sp@(4),%d0 | get length jeq Lscdone | nothing to do, return - movl sp@(8),a0 | start of scan - movl sp@(12),a1 | table to compare with - movb sp@(19),d1 | and mask to use - movw d2,sp@- | need a scratch register - clrw d2 | clear it out - subqw #1,d0 | adjust for dbra + movl %sp@(8),%a0 | start of scan + movl %sp@(12),%a1 | table to compare with + movb %sp@(19),%d1 | and mask to use + movw %d2,%sp@- | need a scratch register + clrw %d2 | clear it out + subqw #1,%d0 | adjust for dbra Lscloop: - movb a0@+,d2 | get character - movb a1@(0,d2:w),d2 | get table entry - andb d1,d2 | mask it - dbne d0,Lscloop | keep going til no more or non-zero - addqw #1,d0 | overshot by one - movw sp@+,d2 | restore scratch + movb %a0@+,%d2 | get character + movb %a1@(0,%d2:w),%d2 | get table entry + andb %d1,%d2 | mask it + dbne %d0,Lscloop | keep going til no more or non-zero + addqw #1,%d0 | overshot by one + movw %sp@+,%d2 | restore scratch Lscdone: rts diff --git a/sys/lib/libkern/arch/m68k/skpc.S b/sys/lib/libkern/arch/m68k/skpc.S index f5cea15ced1..f932807b473 100644 --- a/sys/lib/libkern/arch/m68k/skpc.S +++ b/sys/lib/libkern/arch/m68k/skpc.S @@ -1,4 +1,4 @@ -/* $OpenBSD: skpc.S,v 1.3 2003/06/02 23:28:08 millert Exp $ */ +/* $OpenBSD: skpc.S,v 1.4 2013/02/02 13:32:06 miod Exp $ */ /* $NetBSD: skpc.S,v 1.2 1994/10/26 06:39:32 cgd Exp $ */ /* @@ -45,14 +45,14 @@ * skpc(mask, count, startc) */ ENTRY(skpc) - movl sp@(8),d0 | get length + movl %sp@(8),%d0 | get length jeq Lskdone | nothing to do, return - movb sp@(7),d1 | mask to use - movl sp@(12),a0 | where to start - subqw #1,d0 | adjust for dbcc + movb %sp@(7),%d1 | mask to use + movl %sp@(12),%a0 | where to start + subqw #1,%d0 | adjust for dbcc Lskloop: - cmpb a0@+,d1 | compate with mask - dbne d0,Lskloop | keep going til no more or zero - addqw #1,d0 | overshot by one + cmpb %a0@+,%d1 | compare with mask + dbne %d0,Lskloop | keep going til no more or zero + addqw #1,%d0 | overshot by one Lskdone: rts diff --git a/sys/lib/libkern/arch/m68k/strcmp.S b/sys/lib/libkern/arch/m68k/strcmp.S index 8305c1c3430..758470f448f 100644 --- a/sys/lib/libkern/arch/m68k/strcmp.S +++ b/sys/lib/libkern/arch/m68k/strcmp.S @@ -1,4 +1,4 @@ -/* $OpenBSD: strcmp.S,v 1.4 2007/11/24 19:38:04 deraadt Exp $ */ +/* $OpenBSD: strcmp.S,v 1.5 2013/02/02 13:32:06 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -42,17 +42,17 @@ * right?? */ ENTRY(strcmp) - movl sp@(4),a0 | a0 = string1 - movl sp@(8),a1 | a1 = string2 + movl %sp@(4),%a0 | a0 = string1 + movl %sp@(8),%a1 | a1 = string2 scloop: - movb a0@+,d0 | get *string1 - cmpb a1@+,d0 | compare a byte + movb %a0@+,%d0 | get *string1 + cmpb %a1@+,%d0 | compare a byte bne scexit | not equal, break out - tstb d0 | at end of string1? + tstb %d0 | at end of string1? bne scloop | no, keep going - moveq #0,d0 | strings are equal + moveq #0,%d0 | strings are equal rts scexit: - subb a1@-,d0 | *string1 - *string2 - extbl d0 + subb %a1@-,%d0 | *string1 - *string2 + extbl %d0 rts diff --git a/sys/lib/libkern/arch/m68k/strlen.S b/sys/lib/libkern/arch/m68k/strlen.S index a7f4a301464..7afc6449ca1 100644 --- a/sys/lib/libkern/arch/m68k/strlen.S +++ b/sys/lib/libkern/arch/m68k/strlen.S @@ -1,4 +1,4 @@ -/* $OpenBSD: strlen.S,v 1.4 2007/11/24 19:38:04 deraadt Exp $ */ + /*- * Copyright (c) 1990 The Regents of the University of California. @@ -36,10 +36,10 @@ #include "DEFS.h" ENTRY(strlen) - moveq #-1,d0 - movl sp@(4),a0 | string + moveq #-1,%d0 + movl %sp@(4),%a0 | string slloop: - addql #1,d0 | increment count - tstb a0@+ | null? + addql #1,%d0 | increment count + tstb %a0@+ | null? bne slloop | no, keep going rts diff --git a/sys/lib/libkern/arch/m68k/strncmp.S b/sys/lib/libkern/arch/m68k/strncmp.S index 724e0772986..ee7727a7916 100644 --- a/sys/lib/libkern/arch/m68k/strncmp.S +++ b/sys/lib/libkern/arch/m68k/strncmp.S @@ -1,4 +1,4 @@ -/* $OpenBSD: strncmp.S,v 1.4 2007/11/24 19:38:04 deraadt Exp $ */ +/* $OpenBSD: strncmp.S,v 1.5 2013/02/02 13:32:06 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -42,22 +42,22 @@ * right?? */ ENTRY(strncmp) - movl sp@(12),d1 | count + movl %sp@(12),%d1 | count beq scdone | nothing to do - movl sp@(4),a0 | a0 = string1 - movl sp@(8),a1 | a1 = string2 + movl %sp@(4),%a0 | a0 = string1 + movl %sp@(8),%a1 | a1 = string2 scloop: - movb a0@+,d0 | get *string1 - cmpb a1@+,d0 | compare a byte + movb %a0@+,%d0 | get *string1 + cmpb %a1@+,%d0 | compare a byte bne scexit | not equal, break out - tstb d0 | at end of string1? + tstb %d0 | at end of string1? beq scdone | yes, all done - subql #1,d1 | no, adjust count + subql #1,%d1 | no, adjust count bne scloop | more to do, keep going scdone: - moveq #0,d0 | strings are equal + moveq #0,%d0 | strings are equal rts scexit: - subb a1@-,d0 | *string1 - *string2 - extbl d0 + subb %a1@-,%d0 | *string1 - *string2 + extbl %d0 rts diff --git a/sys/lib/libkern/arch/m68k/strncpy.S b/sys/lib/libkern/arch/m68k/strncpy.S index 93abe58adf7..d9d9363024c 100644 --- a/sys/lib/libkern/arch/m68k/strncpy.S +++ b/sys/lib/libkern/arch/m68k/strncpy.S @@ -1,4 +1,4 @@ -/* $OpenBSD: strncpy.S,v 1.4 2007/11/24 19:38:04 deraadt Exp $ */ +/* $OpenBSD: strncpy.S,v 1.5 2013/02/02 13:32:06 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -36,20 +36,20 @@ #include "DEFS.h" ENTRY(strncpy) - movl sp@(4),d0 | return value is toaddr - movl sp@(12),d1 | count + movl %sp@(4),%d0 | return value is toaddr + movl %sp@(12),%d1 | count beq scdone | nothing to do - movl sp@(8),a0 | a0 = fromaddr - movl d0,a1 | a1 = toaddr + movl %sp@(8),%a0 | a0 = fromaddr + movl %d0,%a1 | a1 = toaddr scloop: - movb a0@+,a1@+ | copy a byte + movb %a0@+,%a1@+ | copy a byte beq scploop | copied null, go pad if necessary - subql #1,d1 | adjust count + subql #1,%d1 | adjust count bne scloop | more room, keep going scdone: rts scploop: - subql #1,d1 | adjust count + subql #1,%d1 | adjust count beq scdone | no more room, all done - clrb a1@+ | clear a byte + clrb %a1@+ | clear a byte jra scploop | keep going |