 			switch (addressingMode)
 			{
 				case ZPG:
-					_mem[param1] = A;
+					_mem.position = param1;
+					_mem.writeByte(A);
 					break;
 				default:
 					_emulator.log("Invalid addressing mode " + ADDR_NAME[addressingMode] + " for Instruction: STA");

					_emulator.log("Invalid addressing mode " + ADDR_NAME[addressingMode] + " for Instruction: TYA");
					break;
			}
		}
		
		

			switch (addressingMode)
			{
				case ZPG:
					_mem.writeByte(X);
					break;
				default:
