Search code examples
motorola68000bitflagsstatus-register

Motorola 68k: Understanding the status registrer flag states


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) = $????


Solution

  • 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