Motorola 68k: Understanding the status registrer flag states

3.7k Views Asked by At

I'm having trouble understanding how exactly the Status Register (SR) content works.

enter image description here

Let's say that the content of (SR) = $0300. How would I figure out in which states the flags are?
Of course that would also answer the question, if the flags are in [insert states here], (SR) = $????

1

There are 1 best solutions below

1
tofro On BEST ANSWER

Convert the SR contents to binary, write it next to the boxes:

Most of the bits are just flags and signal a yes/no condition, except the Interrupt Priority Mask, which actually is a number between 0 and 7.

$0300 = 0b0000001100000000

T0S003000XNZVC

meaning

  • No Trace mode
  • No Supervisor mode
  • Interrupt priority level: 3
  • No extent, negative, zero, overflow or carry condition