Aids to Program Writing and Testing
J. C. Cluley · 1987
In the programs listed in previous sections of this book we have shown both the instructions in mnemonic form and the corresponding machine code in hex notation. It is convenient to begin with the program in mnemonic form as this makes it much easier to read and to amend later on. It is, however, necessary to convert it to machine code before it can be run. When writing small programs the conversion can be performed manually, but it becomes a much more tedious process for longer programs. The tedium is much reduced, as is the chance of making mistakes, if the conversion is done by a computer program. Such a program is called an Assembler. Although each instruction in mnemonic form generates a corresponding instruction in machine code, the assembler needs to recognise other commands which inform it of the location into which the first instruction is to be loaded, where to reserve storage for variables, etc. These extra commands are called assembler directives or pseudo-operation statements where they affect the operation of the assembler, and assignment statements where they identify a name with a value or an address. Thus the command which tells the assembler where to load the first instruction in the machine code program (the program origin) is ORG 1000