Microcontrollers

Summary (Microcontrollers)

4.6 In this topic, we learned that an assembler can help you write much larger programs than you would be able to write by hand coding in machine code. Not only are the mnemonics for the instructions converted into instruction opcode bytes, but also symbolic addresses are converted into memory addresses. However, every new powerful […]

Advanced Assemblers, Linkers, and Loaders (Microcontrollers)

This topic discusses the advanced assembler and the linker, which are tools needed to assemble large programs; it is written for the reader who intends to write a lot of assembly-language programs or large assembly-language programs. Whereas the last topic gave sufficient detail for the reader to understand the assembler output of a C compiler […]

Cross Assemblers and Downloaders (Microcontrollers)

5.1 In this section we introduce a close cousin of the assembler, the cross-assembler, which, like the assembler, converts sequences of (ASCII) characters into machine instructions. For the most part, this section’s material is descriptive, almost philosophical, rather than precise and practical. It is important general knowledge, and it is included here because the reader […]

Relocatable Assemblers and Loaders (Microcontrollers)

5.2 The downloader described in the previous section is sometimes called an absolute loader, because the location of the program is completely specified by the assembler that writes S-records. There is a limitation with an absolute loader. Suppose that you have written a program that uses a standard subroutine from a collection provided by Motorola […]

Conditional Assemblers (Microcontrollers)

5,3 A near cousin of the assembler, that we examined in the last topic, is the conditional assembler. A conditional assembler allows the use of conditional directives such as IFEQ and ENDC, as listed in Table 5.3. For example, the segment inserted in an assembly language program causes the assembler to include instruction in the […]

Macro Assemblers (Microcontrollers)

5.4 A macro assembler is able to generate a program segment, which is defined by a macro, when the name of the macro appears as an opcode in a program. The macro assembler is still capable of regular assembler functioning, generating a machine instruction for each line of assembly language code; but like a compiler, […]

Documentation (Microcontrollers)

5.5 A significant part of writing large assembly-language programs is the effort to make the program understandable to a programmer who has to debug it. Some tools to do this are provided by state-of-the-art assemblers. Table 5.6 shows assembler directives that significantly clarify assembler listings. The LIST and NOLI ST directives can clean up a […]

Summary (Microcontrollers)

5.6 In this topic, we learned that a more powerful assembler can help you write much larger programs than you would be able to write by hand coding in machine code or by using a simplified assembler. Relocation, conditional assembly, and macro expansion permit the programmer to significantly expand his or her techniques. However, high-level […]

Assembly Language Subroutines (Microcontrollers)

Subroutines are fantastic tools that will exercise your creativity. Have you ever wished you had an instruction that executed a floating-point multiply? The 6812 does not have such powerful instructions, but you can write a subroutine to execute the floating-point multiplication operation. The instruction that calls the subroutine now behaves pretty much like the instruction […]

Local Variables (Microcontrollers)

6.1 In this section we offer a mechanism that will help you write much clearer programs. The main contribution to clarity is modularization of a program into smaller segments, Think small, and the relationships within your program will be clearer. The problem with programs that are not so modularized is that a change to correct […]