by steve-myers » Mon Mar 05, 2012 11:22 pm
Well, your program is all wrong. TM and CLI operate on one byte of data using one data byte in the instruction.
CLI DATA,C'X'
compares the first byte of DATA with X.
With TM the data in the instruction is a mask.
TM DATA,C'X'
BO EQUAL
is not the same as
CLI DATA,C'X'
BE EQUAL
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 -
TM DCBOFLGS,DCBOFOPN
tests one bit, the DCBOFOPN bit, in DCBOFLGS. This is roughly equivalent to
if (dcboflgs & dcbofopn)
in C.
Now think about this -
TM DATA,255-C' '
What would you use this test for?