Well, your program is all wrong. TM and CLI operate on one byte of data using one data byte in the instruction.
compares the first byte of DATA with X.
With TM the data in the instruction is a mask.
is not the same as
The C'X' mask in the TM instruction is B'11100111' (I think, I'm not certain), and the BO would branch if DATA contains, for example, B'11111111' since all the 1 bits in the mask match the corresponding 1 bit in the data. Until you learn the instruction better, stick with using just 1 bit in the mask, and just use BO and BZ after the TM. For example -
tests one bit, the DCBOFOPN bit, in DCBOFLGS. This is roughly equivalent to
if (dcboflgs & dcbofopn)
Now think about this -
TM DATA,255-C' '
What would you use this test for?