Lecture 3 Arithmetic Operations/ Condition Code Register

Outline

Arithmetic Instructions

Scaling and Offsetting

Condition Code Register

Branching

Compare Instructions

Table Lookups

Laboratories 3.1 - 3.3

Notes:

The arithmetic and logic instructions provide the intelligence for the processors. This sections focuses on the arithmetic instructions. Because they are commonly needed, scaling and offsetting techniques using fixed place numbers are shown. Since they are slow and bulky, floating point numbers are rarely used in assembly language embedded systems programs.The condition code register contains bits that can remember the state of the processor after an instruction has completed execution. For example, an addition operation may have overflowed and the programmer may want to branch to an error handing routine in the event of an overflow. The condition code register has a bit that is set in the event of an overflow on an instruction. This bit can then be examined by a branch instruction to take the appropriate action.Because it is so useful, the compare instruction, although just another arithmetic operation, is given special attention.