Using Section Directives

The following code illustrates the use and behavior of the section directives .text, .section, .pushsection, .popsection, and .previous:

Example: Code Sequence Using Section Directives

.text            //Default

.section A       //Makes A the current section.
                //.text is A’s previous section.

.pushsection B   //Pushes A onto the stack and makes B the
                //current section. A is B’s previous section.

.pushsection C   //Pushes B onto stack and makes C the current
                //section, B is C’s previous section.

.popsection      //Pops B from stack and makes it current.

.popsection      //Pops A from stack and makes it current.
                //.text is A’s previous section.

.previous        //Makes A’s previously current section .text the
                //current section. A becomes .text’s previous
                //section.

.previous        //Makes A the current section, .text becomes A’s
                //previous section.