0% found this document useful (0 votes)
2 views3 pages

19 and 20[1]

The document explains the conversion process from high-level languages to low-level languages, highlighting the role of cross-compilers in translating source code into machine code. It also details the assembly language to machine language conversion process, emphasizing the use of assemblers and the creation of object files. Additionally, it outlines the advantages of assembly language development, including efficient memory usage, high performance, and low-level hardware access.

Uploaded by

mayurreddie
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views3 pages

19 and 20[1]

The document explains the conversion process from high-level languages to low-level languages, highlighting the role of cross-compilers in translating source code into machine code. It also details the assembly language to machine language conversion process, emphasizing the use of assemblers and the creation of object files. Additionally, it outlines the advantages of assembly language development, including efficient memory usage, high performance, and low-level hardware access.

Uploaded by

mayurreddie
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

19) With sketch diagram explain the conversion process of a high-level language to low-

level language?
Ans)

 The program written in any of the high level language is saved with the corresponding language
extension (.c for C, .cpp for C++, etc). Any text editor like ‘notepad’ or ‘WordPad’ from
Microsoft® or the text editor provided by an Integrated Development (IDE) tool supporting the
high level language in use can be used for writing the program.
 Most of the high level languages support modular programming approach and hence you can
have multiple source files called modules written in corresponding high level language. The
source files corresponding to each module is represented by a file with corresponding language
extension. Translation of high level source code to executable object code is done by a cross-
compiler.
 The cross-compilers for different high level languages for the same target processor are
different. It should be noted that each high level language should have a cross-compiler for
converting the high level source code into the target processor machine code. Without cross-
compiler support a high level language cannot be used for embedded firmware development.
C51 Cross-compiler from Keil software is an example for Cross- compiler. C51 is a popular
cross-compiler available for ‘C’ language for the 8051 family of micro controller. Conversion
of each module’s source code to corresponding object file is performed by the cross compiler.
 Rest of the steps involved in the conversion of high level language to target processor’s machine
code aresame as that of the steps involved in assembly language based development.
20) Explain assembly language to machine language conversion process. What are the advantages of
assembly language based developments?
Ans)

 Translation of assembly code to machine code is performed by assembler. The assemblers for
different target machines are different and it is common that assemblers from multiple vendors
are available in the market for the same target machines. Some target processor’s/controller’s
assembler may be proprietary and is supplied by a single vendor only.
 Each source module is written in Assembly and is stored as .src fi le or .asm fi le. Each fi le can
be assembled separately to examine the syntax errors and incorrect assembly instructions. On
successful assembling of each .src/.asm fi le a corresponding object file is created with
extension ‘.obj’.
 The object file does not contain the absolute address of where the generated code needs to be
placed on the program memory and hence it is called a re-locatable segment. It can be placed
at any code memory location and it is the responsibility of the linker/locator to assign absolute
address for this module.
 Absolute address allocation is done at the absolute object file creation stage. Each module can
share variables and subroutines (functions) among them. Exporting a variable/function from a
module (making a variable/function from a module available to all other modules) is done by
declaring that variable/function as PUBLIC in the source module.
Advantages of Assembly Language Based Development:
 Efficient Code Memory and Data Memory Usage (Memory Optimization): Since the
developer is well versed with the target processor architecture and memory organization,
optimized code can be written for performing operations. This leads to less utilization of code
memory and efficient utilization of data memory. Remember memory is a primary concern in
any embedded product (Though silicon is cheaper and new memory techniques make memory
less costly, external memory operations impact directly on system performance).

 High Performance: Optimized code not only improves the code memory usage but also
improves the total system performance. Through effective assembly coding, optimum
performance can be achieved for a target application.

 Low Level Hardware: Access Most of the code for low level programming like accessing
external device specific registers from the operating system kernel, device drivers, and low
level interrupt routines, etc. are making use of direct assembly coding since low level device
specific operation support is not commonly available with most of the high-level language cross
compilers.

 Code Reverse Engineering: Reverse engineering is the process of understanding the


technology behind a product by extracting the information from a finished product. Reverse
engineering is performed by ‘hackers’ to reveal the technology behind ‘Proprietary Products’.
Though most of the products employ code memory protection, if it may be possible to break
the memory protection and read the code memory, it can easily be converted into assembly
code using a dis-assembler program for the target machine.

You might also like