assemblybranchmotorolaeasy68k

Check if Branch Executes in Motorolla 68k


I'm told that the condition code register (CCR) contains $0B. And I'm asked if the following branch will occur.

BGT LABEL

I know that this is the Greater Than branch, but I'm not sure what the $0B represents. If I write $0B as $011, that still doesn't help me in anyway, because what I have no idea how to tell if the branch will execute, any ideas? Am I so posed to in someway tell what flags have been set because of the $0B ? If that's the case, how would I know which flags are on, and how would that in turn, help in knowing if the branch executes or not?


Solution

  • $0B I assume means hex 0B which is binary 0000 1011. Since the low 4 bits of the CCR are NZVC, that means N=1, Z=0, V=1 and C=1.

    You also need to know what flags BGT checks. It jumps if Z=0 and N=V. In this case that is true, so the branch will be taken.