Code Composer Studio 6.1.0 debugger is not acting as it should
Your MSP430 is a 16-bit machine, so the compiler is doing the (10000*tnth) as a multiplication of 16-bit numbers and truncating the result to 16 bits before continuing with the rest of the calculation.  

10000 * 9 = 90000 = 0x15F90  
truncate to 16-bits = 0x5F90 = 24464  
24464 + 9999 = 34463  


If you cast the 10000 integer constant to 32-bits with something like 10000UL and/or cast the variable with (unsigned long)tnth you should see your expected results.

The warning for 'variable "km" was set but never used' is expected.
You're assigning values to km, but never reading them back or using km in any other way, but this has nothing to do with your undesired behavior.

When you changed your 16-bit data type from unsigned to signed, what happens is that the 34463 (0x869F) value is treated as a negative 16-bit value of -31073 (since the MSB is a 1).
When converting this into a 32-bit value, it first gets sign-extended to a 32-bit signed value - so now it's 0xFFFF869F.
But since you're putting this into an unsigned 32-bit integer variable this value is now represented as 4294936223.