Generation of .OBJ file using a cross-assembler


Generation of .OBJ file by using a cross-assembler:

The file assembly language program file, e.g. MULT.ASM which is created by using an editor is simply a text file. We cannot execute this file directly. At first we have to assemble the file, and then we have to link it. The step of assembly the translation of the program of assembly language to machine code requires the generation of a .OBJ file.

We have used some examples in the text of ‘2500 A.D i.e. the 8085 cross-assembler of version 4.01.

In the prompt mode the translation is:

We type ‘X8085<cr>’ just for performing the translation in the prompt mode. We denote ‘<cr>’ just for the return of carriage, which we do by simply typing the key upon which we mark ‘Enter’. The prompting of the assembler at each and every step in this prompt mode is done. The advantage of this prompt mode lies in the fact that we don’t have to memorize each and every step while the implementation.

The prompting of the assembler occurs after typing the prompt mode X8085<cr>.

The destinations are listed as (N, T, P, D, E, L, <cr> = N>)

where listing signifies for listing the code of the source, object, and the error details if anything gets encountered. The listing process may be on the terminal, or moreover even gets printed by the printer, or gets stored as a file with the .LST extension on disk. Further the listing process, if it is desired, may be confined to the listing only to the source code lines which are erroneous.

The abbreviation shown below signifies:

  • N for None where no listing is made,

  • T for Terminal where listing is done on the terminal,

  • P for Printer where listing gets printed by the printer,

  • D for Disk where listing gets stored as a .LST disk file,

  • E for Error which gets only listed,

  • L for Listing ON and OFF.

If we do not list, just typing the carriage return ‘<cr>’ to be done. Moreover, it is always good for responding by typing the ‘T’. Then, the listing will be on terminal. Error occurs at the source code here the listing will get paused. The error gets noted by the user, and then by typing ‘<cr>’ we get proceed to the desired further and then again look at the next error. After responding with typing E, the prompting of the of the assembler by the user is shown below:

The errors listed to destination are T, P, D, <cr> = T:

After responding to the carriage return the errors are listed to the terminal end as a result there are many errors which are encountered during the assembly process, So for the generation of a.LST file to the disk responding to the prompt by D should be done. Contact with the source file is shown below:

Input filename:

The source name of the file must be responded by the user. In the given example the user must respond to ‘MULT.ASM’. MULT is also sufficient to carry out the task. After that the user is prompted by the assembler for the name of the output file which is as follows:

Output filename:

The user responding with the change of address ‘<cr>’, the resulting name of the output file in the given example must be ‘MULT.OBJ’. While responding with ‘DIV’ by the user, the name of the output file must be ‘DIV.OBJ’. In general, the name of the output file is responded by the user by the change of address i.e ‘<cr>’. If we choose the file MULT.LST to get generated on the disk, so by using a text editor the errors can be identified and the contents of MULT.LST can be seen. Thereafter by the help of the editor, any corrections can be corrected with the help of the editor in the MULT.ASM file.

At last after the complete successful of the which is error free the result gets placed in MULT.OBJ file.

Option
Function
X8085 MULT-T
Displays listing on terminal. It pauses
 
when error is encountered
 
Continues when <cr> is pressed
X8085 MULT-P
Prints listing using printer
X8085 MULT-D
Generates .LST file on disk
X8085 MULT-ET
Displays only error listing on terminal
X8085 MULT-EP
Prints only error listing using printer
X8085 MULT-ED
Generates .LST file containing errors only

Following diagram depicts the steps required to execute .ASM program execution –

Updated on: 30-Jul-2019

182 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements