bigdogguru
Administrator
- Joined
- Mar 12, 2010
- Messages
- 9,821
- Helped
- 2,350
- Reputation
- 4,694
- Reaction score
- 2,272
- Trophy points
- 1,413
- Location
- Southwest, USA
- Activity points
- 62,394
A SUBROUTINE is a callable code module. Its code is included exactly one time in the assembled HEX file, when the SUBROUTINE is called the current PC register value is pushed on the stack, the program execution then jumps to the location of the SUBROUTINE, executes it and then the previous PC value is popped from the stack and loaded into the PC register and program execution resumes where it originally left off.
A Macro is a set of instructions and directives referenced by a given name, during assembly when a MACRO is invoked, its name is replaced by the set of instructions or expanded as it is often referred. Multiple references to a MACRO results in multiple and identical sets of instructions occurring in the assembled HEX file. In other words a MACRO is like an alias for a particular set of instructions and directives, which the set replaces the invoked MACRO name during assembly.
A Macro is a set of instructions and directives referenced by a given name, during assembly when a MACRO is invoked, its name is replaced by the set of instructions or expanded as it is often referred. Multiple references to a MACRO results in multiple and identical sets of instructions occurring in the assembled HEX file. In other words a MACRO is like an alias for a particular set of instructions and directives, which the set replaces the invoked MACRO name during assembly.