6

Control Structures and Subroutines

Life is the sum of all your choices.

—Albert Camus (Nobel Prize Laureate)

OUTLINE

6.1    Introduction

6.2    Indexed Addressing Mode

6.3    Jumping and Branching

6.4    Compare Instructions

6.5    Conditional Flow and Program Loops

6.6    Stack Operation

6.7    Subroutines

6.8    BUFFALO Subroutine

6.9    Summary

OBJECTIVES

Upon completion of this chapter you should be able to

1.  Create short programs using various addressing modes.

2.  Determine the effective address for an indexed mode instruction.

3.  Create short programs using jump and branch instructions.

4.  Determine the relative and destination address when employing branch instructions.

5.  Appreciate the working of conditional branching. ...

Get Microcontroller Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.