What is the flow of control?
- chaning the PC to a different location
- 2 ways of changing hte PC:
→ branches
⇒ loops
⇒ conditionals
→ One way of doing it is an absolute address: move the contents to a register to the PC
→ the next instruction will be fetched from the value of the PC
→ This is used in subroutine returns
→ Other machines have a jump instruction
⇒ the jump on the 6811 requires 3 bytes
• Jump Loop
⇒ the MOV on the msp-430 requires 2 words
• MOV &Loop, PC
⇒ the xm23 requires 3 words
• MOVL Loop, R0
• MOVH Loop, R0
• MOV R0, PC
→ You can also do it with relative addressing
⇒ Control passes to the address associated with the PC + an offset
⇒ 6811: 15 branches, 8 bit offset, 2 bytes
• BRA Loop
• BEQ True_Part
⇒ MSP 430: 8 branches, 10-bit encoded offset, 1 word
• JMP Loops
• JEQ True_Part
⇒ XM23: 8 branches, 10-bit encoded offset, 1 word
• BRA Loop
• BEQ True_Part Index