diff --git a/examples/run_from_ram/run_from_ram.c b/examples/run_from_ram/run_from_ram.c
index 07ecee1374cc75bc023175d7e6ba32d16d633173..8ece215fa526b39c1f5b3a76a0cfaf20e6873f03 100644
--- a/examples/run_from_ram/run_from_ram.c
+++ b/examples/run_from_ram/run_from_ram.c
@@ -35,7 +35,6 @@ void RamFunction()
 		GPIOD->BSHR = (1<<16) | (1<<(16+4)); // Turn off GPIODs
 		GPIOC->BSHR = (1<<16);
 		Delay_Ms( 250 );
-		count++;
 
 		// But we turbo through twiddling a pin.
 		
@@ -46,14 +45,14 @@ void RamFunction()
 			c.nop\n\
 			c.sw a0, 0(a2)\n\
 			c.sw a1, 0(a2)\n\
-			c.sw a0, 0(a2) /* Writing out takes 2 cycles from what I can tell*/ \n\
-			c.addi a3, 1   /* Insert this for comparative timing,  it's 1 cycle */ \n\
+			c.sw a0, 0(a2)       /* Writing out takes 2 cycles from what I can tell*/ \n\
+			c.addi %[count], 1   /* Insert this for comparative timing,  it's 1 cycle */ \n\
 			c.sw a1, 0(a2)\n\
 			c.sw a0, 0(a2)\n\
 			c.sw a1, 0(a2)\n\
 			c.sw a0, 0(a2)\n\
 			c.sw a1, 0(a2)\n\
-			" : : : "a0", "a1", "a2", "a3" );
+			" : [count]"+r"(count) : : "a0", "a1", "a2" );
 	}
 }