Index: arch/ia32/include/memstr.h
===================================================================
--- arch/ia32/include/memstr.h	(revision 1084a7848bafa4813443a91f16a7fc9514ecd5d9)
+++ arch/ia32/include/memstr.h	(revision 342de62a7a895713600cd9767854ccfec27478be)
@@ -29,7 +29,4 @@
 #ifndef __ia32_MEMSTR_H__
 #define __ia32_MEMSTR_H__
-
-extern void memsetw(__address dst, size_t cnt, __u16 x);
-extern void memsetb(__address dst, size_t cnt, __u8 x);
 
 /** Copy memory
@@ -70,16 +67,16 @@
 
 
-/** Compare memory
+/** Compare memory regions for equality
  *
  * Compare a given number of bytes (3rd argument)
  * at memory locations defined by 1st and 2nd argument
- * for equality. If memory is equal, returns 0.
+ * for equality. If bytes are equal function returns 0.
  *
- * @param pointer 1
- * @param pointer 2
+ * @param region 1
+ * @param region 2
  * @param number of bytes
- * @return 0 on match or non-zero if different
+ * @return zero if bytes are equal, non-zero otherwise
  */
-static inline int memcmp(const void * mem1, const void * mem2, size_t cnt)
+static inline int memcmp(__address src, __address dst, size_t cnt)
 {
 	__u32 d0, d1, d2;
@@ -93,5 +90,5 @@
 		"1:\n"
 		: "=a" (ret), "=%S" (d0), "=&D" (d1), "=&c" (d2)
-		: "0" (0), "1" (mem1), "2" (mem2), "3" (cnt)
+		: "0" (0), "1" (src), "2" (dst), "3" (cnt)
 	);
 	
@@ -99,3 +96,47 @@
 }
 
+/** Fill memory with words
+ * Fill a given number of words (2nd argument)
+ * at memory defined by 1st argument with the
+ * word value defined by 3rd argument.
+ *
+ * @param destination
+ * @param number of words
+ * @param value to fill
+ */
+static inline void memsetw(__address dst, size_t cnt, __u16 x)
+{
+	__u32 d0, d1;
+	
+	__asm__ __volatile__ (
+		"rep stosw\n\t"
+		: "=&D" (d0), "=&c" (d1), "=a" (x)
+		: "0" (dst), "1" (cnt), "2" (x)
+		: "memory"
+	);
+
+}
+
+/** Fill memory with bytes
+ * Fill a given number of bytes (2nd argument)
+ * at memory defined by 1st argument with the
+ * word value defined by 3rd argument.
+ *
+ * @param destination
+ * @param number of bytes
+ * @param value to fill
+ */
+static inline void memsetb(__address dst, size_t cnt, __u8 x)
+{
+	__u32 d0, d1;
+	
+	__asm__ __volatile__ (
+		"rep stosb\n\t"
+		: "=&D" (d0), "=&c" (d1), "=a" (x)
+		: "0" (dst), "1" (cnt), "2" (x)
+		: "memory"
+	);
+
+}
+
 #endif
Index: arch/ia32/src/asm.S
===================================================================
--- arch/ia32/src/asm.S	(revision 1084a7848bafa4813443a91f16a7fc9514ecd5d9)
+++ arch/ia32/src/asm.S	(revision 342de62a7a895713600cd9767854ccfec27478be)
@@ -38,6 +38,4 @@
 .global enable_l_apic_in_msr
 .global interrupt_handlers
-.global memsetb
-.global memsetw
 
 ## Turn paging on
@@ -152,53 +150,4 @@
 
 
-## Fill memory with bytes
-#
-# Fill a given number of bytes (2nd argument)
-# at memory defined by 1st argument with the
-# byte value defined by 3rd argument.
-#
-DST=12
-CNT=16
-X=20
-memsetb:
-	push %eax
-	push %edi
-
-	movl CNT(%esp),%ecx
-	movl DST(%esp),%edi
-	movl X(%esp),%eax
-
-	rep stosb %al,%es:(%edi)
-
-	pop %edi
-	pop %eax
-	ret
-
-
-## Fill memory with words
-#
-# Fill a given number of words (2nd argument)
-# at memory defined by 1st argument with the
-# word value defined by 3rd argument.
-#
-DST=12
-CNT=16
-X=20
-memsetw:
-	push %eax
-	push %edi
-
-	movl CNT(%esp),%ecx
-	movl DST(%esp),%edi
-	movl X(%esp),%eax
-
-	rep stosw %ax,%es:(%edi)
-
-	pop %edi
-	pop %eax
-
-	ret
-
-
 # THIS IS USERSPACE CODE
 .global utext
Index: arch/ia32/src/ia32.c
===================================================================
--- arch/ia32/src/ia32.c	(revision 1084a7848bafa4813443a91f16a7fc9514ecd5d9)
+++ arch/ia32/src/ia32.c	(revision 342de62a7a895713600cd9767854ccfec27478be)
@@ -51,5 +51,4 @@
 #include <arch/mm/memory_init.h>
 
-
 void arch_pre_mm_init(void)
 {
