With assembly language it is essential to make a plan before coding.
The flowchart for the program is at right. The first box sets a flag to a default value in advance of the test that might change it. This is a common trick. Here is an outline of the program:
The range test is in two parts.
The first part (in this program)
tests if temp is less than or equal to 55.
However, the machine instruction is "set on less than".
If temp is out of range a branch is taken to
out
.
The branch is followed by a no-op for the branch
delay.
Fill in the blanks.