Remarks (Microcontrollers)

2.8
One might wonder why some move instructions, such as LDAA, TSTA, and STAA, always put V = 0 rather than leaving V unchanged as they do C. The reason is that doing so allows all of the signed branches to work after these instructions as well as after the
arithmetic type of instruction. For example, suppose that one wants to look at the contents of some memory location, say $811, and branch to location L if the contents Off location 458, treated as a signed number, are greater than 0, The sequence
tmp33-44_thumb[1]
does exactly this. If the TST instruction had left V unaffected, we would have had to use the longer sequence:
tmp33-45_thumb[2]
A little more experience will show that the designer’s choice here is quite reasonable, because we will find a more frequent use of signed branches for load instructions than for checking for signed overflow, as we will do in the next topic.


Do You Know These Terms?

See the end of topic 1 for instructions.
stack push pull
hardware stack buffer post byte hidden register prefix byte
subroutine jump to
subroutine return address branch to
subroutine return from
subroutine
hardware interrupt
I/O interrupt
interrupt
handling
interrupt handler
device handler
interrupt service
routine
service routine
latency time
interrupt inhibit
interrupt mask
stop disable machine state
return from interrupt
tmp33-46_thumb[1]

Next post:

Previous post: