Index: kernel/arch/amd64/src/amd64.c
===================================================================
--- kernel/arch/amd64/src/amd64.c	(revision 0f94c3d5de72d78a731147c9a1063270222411f2)
+++ kernel/arch/amd64/src/amd64.c	(revision f24d300581dcff87298e80ad8a95d552d34abead)
@@ -73,5 +73,5 @@
 static void clean_IOPL_NT_flags(void)
 {
-	asm (
+	asm volatile (
 		"pushfq\n"
 		"pop %%rax\n"
@@ -79,7 +79,5 @@
 		"pushq %%rax\n"
 		"popfq\n"
-		:
-		:
-		: "%rax"
+		::: "%rax"
 	);
 }
@@ -91,11 +89,9 @@
 static void clean_AM_flag(void)
 {
-	asm (
+	asm volatile (
 		"mov %%cr0, %%rax\n"
 		"and $~(0x40000), %%rax\n"
 		"mov %%rax, %%cr0\n"
-		:
-		:
-		: "%rax"
+		::: "%rax"
 	);
 }
Index: kernel/arch/amd64/src/cpu/cpu.c
===================================================================
--- kernel/arch/amd64/src/cpu/cpu.c	(revision 0f94c3d5de72d78a731147c9a1063270222411f2)
+++ kernel/arch/amd64/src/cpu/cpu.c	(revision f24d300581dcff87298e80ad8a95d552d34abead)
@@ -78,19 +78,17 @@
 {
 	asm volatile (
-		"movq %%cr0, %%rax;"
-		"btsq $1, %%rax;" /* cr0.mp */
-		"btrq $2, %%rax;"  /* cr0.em */
-		"movq %%rax, %%cr0;"
-
-		"movq %%cr4, %%rax;"
-		"bts $9, %%rax;" /* cr4.osfxsr */
-		"movq %%rax, %%cr4;"
-		:
-		:
-		:"%rax"
-		);
+		"movq %%cr0, %%rax\n"
+		"btsq $1, %%rax\n"  /* cr0.mp */
+		"btrq $2, %%rax\n"  /* cr0.em */
+		"movq %%rax, %%cr0\n"
+		
+		"movq %%cr4, %%rax\n"
+		"bts $9, %%rax\n"   /* cr4.osfxsr */
+		"movq %%rax, %%cr4\n"
+		::: "%rax"
+	);
 }
 
-/** Set the TS flag to 1. 
+/** Set the TS flag to 1.
  *
  * If a thread accesses coprocessor, exception is run, which 
@@ -100,24 +98,20 @@
 void fpu_disable(void)
 {
-	asm	volatile (
-		"mov %%cr0,%%rax;"
-		"bts $3,%%rax;"
-		"mov %%rax,%%cr0;"
-		:
-		:
-		:"%rax"
-		);
+	asm volatile (
+		"mov %%cr0, %%rax\n"
+		"bts $3, %%rax\n"
+		"mov %%rax, %%cr0\n"
+		::: "%rax"
+	);
 }
 
 void fpu_enable(void)
 {
-	asm	volatile (
-		"mov %%cr0,%%rax;"
-		"btr $3,%%rax;"
-		"mov %%rax,%%cr0;"
-		:
-		:
-		:"%rax"
-		);	
+	asm volatile (
+		"mov %%cr0, %%rax\n"
+		"btr $3, %%rax\n"
+		"mov %%rax, %%cr0\n"
+		::: "%rax"
+	);
 }
 
Index: kernel/arch/amd64/src/fpu_context.c
===================================================================
--- kernel/arch/amd64/src/fpu_context.c	(revision 0f94c3d5de72d78a731147c9a1063270222411f2)
+++ kernel/arch/amd64/src/fpu_context.c	(revision f24d300581dcff87298e80ad8a95d552d34abead)
@@ -40,7 +40,7 @@
 {
 	asm volatile (
-		"fxsave %0"
-		: "=m"(*fctx)
-		);
+		"fxsave %[fctx]\n"
+		: [fctx] "=m" (*fctx)
+	);
 }
 
@@ -49,7 +49,7 @@
 {
 	asm volatile (
-		"fxrstor %0"
-		: "=m"(*fctx)
-		);
+		"fxrstor %[fctx]\n"
+		: [fctx] "=m" (*fctx)
+	);
 }
 
@@ -58,5 +58,5 @@
 	/* TODO: Zero all SSE, MMX etc. registers */
 	asm volatile (
-		"fninit;"
+		"fninit\n"
 	);
 }
Index: kernel/arch/amd64/src/userspace.c
===================================================================
--- kernel/arch/amd64/src/userspace.c	(revision 0f94c3d5de72d78a731147c9a1063270222411f2)
+++ kernel/arch/amd64/src/userspace.c	(revision f24d300581dcff87298e80ad8a95d552d34abead)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup amd64	
+/** @addtogroup amd64
  * @{
  */
@@ -48,34 +48,31 @@
 void userspace(uspace_arg_t *kernel_uarg)
 {
-	ipl_t ipl;
+	ipl_t ipl = interrupts_disable();
 	
-	ipl = interrupts_disable();
-
-	/* Clear CF,PF,AF,ZF,SF,DF,OF */
+	/* Clear CF, PF, AF, ZF, SF, DF, OF */
 	ipl &= ~(0xcd4);
-
-	asm volatile (""
-			  "pushq %0\n"
-			  "pushq %1\n"
-			  "pushq %2\n"
-			  "pushq %3\n"
-			  "pushq %4\n"
-			  "movq %5, %%rax\n"
-			  /* %rdi is defined to hold pcb_ptr - set it to 0 */
-			  "xorq %%rdi, %%rdi\n"
-			  "iretq\n"
-			  : : 
-			  "i" (gdtselector(UDATA_DES) | PL_USER), 
-			  "r" (kernel_uarg->uspace_stack+THREAD_STACK_SIZE), 
-			  "r" (ipl), 
-			  "i" (gdtselector(UTEXT_DES) | PL_USER), 
-			  "r" (kernel_uarg->uspace_entry),
-			  "r" (kernel_uarg->uspace_uarg)
-			  : "rax"
-			  );
+	
+	asm volatile (
+			"pushq %[udata_des]\n"
+			"pushq %[stack_size]\n"
+			"pushq %[ipl]\n"
+			"pushq %[utext_des]\n"
+			"pushq %[entry]\n"
+			"movq %[uarg], %%rax\n"
+			
+			/* %rdi is defined to hold pcb_ptr - set it to 0 */
+			"xorq %%rdi, %%rdi\n"
+			"iretq\n"
+			:: [udata_des] "i" (gdtselector(UDATA_DES) | PL_USER),
+			   [stack_size] "r" (kernel_uarg->uspace_stack + THREAD_STACK_SIZE),
+			   [ipl] "r" (ipl),
+			   [utext_des] "i" (gdtselector(UTEXT_DES) | PL_USER),
+			   [entry] "r" (kernel_uarg->uspace_entry),
+			   [uarg] "r" (kernel_uarg->uspace_uarg)
+			: "rax"
+		);
 	
 	/* Unreachable */
-	for(;;)
-		;
+	while (1);
 }
 
