Chapter 5 Using Assembler

5.4Operation Examples

There are three steps to perform when you need a final list file with resolved addresses.

1.With the assembler, generate a relocatable object file (.rf).

2.With the linker, generate an executable format file (.ex) and map file (.map).

3.With the assembler again, use the map file to generate a final list file (.lst) with addresses resolved by the linker.

Program assembly

Generation of a list file with the l option on the first assembly will not resolve addresses, so you would not do so unless you have some special purpose. For the same reason, the Li, Lm, and Lc options are also not used.

as103 -g sample.asm

The above command assembles the source file (sample.asm) in the current directory, and generates a relocatable object file (sample.rf) with debug information in the current directory.

as103 -g -D VERSION -o test.rf /user/source/main.asm

The above command assembles the source file (main.asm) in the /user/source directory. For conditional assembly of the source file, assembly will proceed as though VERSION were defined.

The above command also generates a relocatable object file named test.rf with debug information in the current directory.

as103 -g -o test.rf -I /user/lib sample.asm

The above example assembles the source file (sample.asm) in the current directory. Files specified by include will be read from the /user/lib directory.

The above command also generates a relocatable object file named test.rf with debug information in the current directory.

as103 -I/user/defs -o /user/src/sample.rf -D TYPE file.asm

The above example assembles the source file (file.asm) in the current directory. For conditional assembly (ifdef), assembly will proceed as though TYPE were declared. The assembler reads files specified with the include directive from the directory /user/defs.

The above example will store the relocatable object file with name sample.rf in the /user/src directory.

Operation Examples 81

Page 93
Image 93
Panasonic MN1030 user manual Operation Examples, Program assembly, As103 -g -D Version -o test.rf /user/source/main.asm