Chapter 5 Using Asssembler

Generation of final list file with resolved program addresses

The final list file is generated as follows.

1.First use the assembler to generate a relocatable object file. Valid options at this stage are o, I, D, g, and the optimization options (O, Od).

2.Next use the linker to generate an executable format file by specifying the start address of each section and linking multiple files. Specify the linker's m option to generate the map file. Refer to chapter 6, "Using The Linker", for details.

3.Use the assembler once more to assemble the source file. This time read the map file generated by the linker with the assembler's a option. If the I or D options are specified, the parameters at this stage must be the same as those of the first assembly.

The following descriptions assume that a map file has already been generated.

as103 -l -a main.map sub.asm

In the above example all files exist in or are output to the current directory. The source file (sub.asm) is assembled using a map file (main.map), generating a list file (sub.lst).

as103 -l -Lc -Lm -a main.map -D MODE prog1.asm

The above example assembles the source file (prog1.asm) in the current directory using a map file (main.map), generating a list file (prog.lst). Assembly will be performed assuming that the identifier MODE has been defined for conditional assembly directives (ifdef). Source statements of unfulfilled conditions and macro expansion source will not be output.

82 Operation Examples

Page 94
Image 94
Panasonic MN1030 user manual As103 -l -a main.map sub.asm, As103 -l -Lc -Lm -a main.map -D Mode prog1.asm