0

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

Dominik Car
  • 191
  • 1
  • 8

1 Answers1

3

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
tofro
  • 5,640
  • 14
  • 31
  • Yeah, stupid me thought so but the paranoid me was looking for a catch. So basically reading the nibble as binary and converting it to hex ($0300 means I0 and I1 are set to one cause 0011 =3) – Dominik Car Feb 17 '18 at 09:16