The macro instruction capability was developed very

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: a few dozen, or a few hundred, assembly language instructions. Assembly Languages with Macro Instructions In general, assembly languages are termed one-for-one in nature, that is, each assembly language instruction will result in one machine language instruction. However, quite often a certain set of machine language or assembly language instructions have to be used over and over. For example, three instructions, one after the other, might be needed to print out a value on a particular computer. These three instructions, always in the same order, might be used over and over in the same program. Instead of forcing the programmer to write out the set of three instructions every time he/she wants to print a value, we might as well design the assembler (program) in such a way so as to take care of these instructions. Every time the programmer gave the PRINT instruction, for example, the assembler would translate it into three machine language instructions instead of one, thus supplying the complete set of instructions required for printing. Any instruction, such as PRINT, which gets translated into several machine language instructions, is called a macro instruction. There might be many such macro instructions permitted by a particular assembler. Thus, to speed up the coding process, assemblers were developed that could produce a variable amount of machine language instructions for each macro instruction of the assembly language program. The use of macro instructions adds much work to the computer because the translation process becomes more than just changing each word into a number. The assembler must be able to supply the missing steps as well, but it means a tremendous saving of work for the programmer. The programmer gets relieved of the task of writing an instruction for every machine operation performed. Thus the use of macro instructions reduces the length of the programs, cuts down on errors, and simplifies programming. The macro instruction capability was developed very early in t...
View Full Document

This document was uploaded on 04/07/2014.

Ask a homework question - tutors are online