Chapter 3 Introduction to Operation
26 Basic Operation of Assembler and Linker
The contents of program2.asm are as follows.
program2.asm also consists of a section called _CODE (attribute CODE, link type PUBLIC), and it
makes an external declaration of data_set.
Assemble
Assemble the two programs that you created to generate relocatable object files.
as103 program1.asm
as103 program2.asm
This will generate two relocatable object files (program1.rf and program2.rf). List files cannot be
generated at this stage. These files will be generated after linking when the relationships of external
references and external definitions are resolved.
global data_set
__CODE section CODE, PUBLIC, 1
data_set mov 0, D2
data_set_loop cmp D1, D2
bcc data_set_end
mov D0, (A00
add 1, D2
add 2, A0
bra data_set_loop
data_set_end rts
end