0% found this document useful (0 votes)
31 views

Abdullahi Umar CSC 316 Assignment.

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

Abdullahi Umar CSC 316 Assignment.

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

MEWAR INTERNATIONAL UNIVERSITY, NIGERIA.

FACULTY OF COMPUTING.

COMPUTER SCIENCE DEPARTMENT.

ASSIGNMENT.

CSC 316

COMPILER CONSTRUCTION.

24-07-2024

BY

Abdullahi Umar

WITH

REGISTRATION NUMBER:

MIUSTD2021252

QUESTION:

Q1- Explain the differences between Assembly Language, machine language And high level language.

Q2- List the advantages and disadvantages of each of them.

Q1-ANSWER:

Machine Language:

1. Low-Level Representation: Machine language is the lowest level of programming language. It consists of
binary instructions (0s and 1s) that directly correspond to the instructions executed by the computer's
central processing unit (CPU).

2. Hardware-Specific: Each computer architecture has its own unique machine language. Programs written
in machine language are specific to a particular CPU and cannot be easily ported to other architectures.

3. Difficult for Humans: Writing programs in machine language is extremely challenging for humans due to
its cryptic nature. Instructions are represented as raw binary codes, making it error-prone and tedious.

I.
4. Direct Execution: Machine language instructions are executed directly by the CPU without any
translation. This makes it the fastest way to interact with hardware.

5. Examples: Machine language instructions might include loading data from memory, performing
arithmetic operations, or branching based on conditions.

Assembly Language:

1. Symbolic Representation: Assembly language provides a symbolic representation of machine language


instructions. Instead of binary codes, programmers use mnemonics (e.g., `ADD`, `MOV`, `JMP`) to write
programs.

2. One-to-One Mapping: Each assembly language instruction corresponds directly to a machine language
instruction. Assembler programs convert assembly code into machine code.

3. Platform-Specific: Like machine language, assembly language is platform-specific. However, it is more


readable and easier to work with than raw binary.

4. Close to Hardware: Assembly language allows programmers to access hardware resources directly,
making it useful for tasks like device drivers and embedded systems.

5. Examples: An assembly program might load data from memory, add two numbers, and store the result
back in memory.

High-Level Language:

1. Abstraction: High-level languages (e.g., Python, Java, C++) provide a high level of abstraction.
Programmers write code using human-readable syntax and meaningful keywords.

2. Platform-Independent: High-level code can be compiled or interpreted on different platforms. It


abstracts away hardware details, making programs portable.

3. Productivity: High-level languages simplify programming tasks. They offer built-in functions, libraries,
and data structures, reducing the amount of code needed.

4. Readable and Maintainable: High-level code is easier to read, understand, and maintain. It encourages
good programming practices.

5. Examples: Writing a web application in Python, creating a game in Unity (C#), or developing Android
apps using Java.

Q2-ANSWER:

Machine Language

2
Advantages are:

Speed, Efficiency, Universality, Low-Level Control, Direct Memory Access.

Disadvantages are:

Difficulty, Limited Functionality, Platform-Specificity, Debugging Challenges, Maintenance Complexity.

Assembly Language

Advantages are :

High Level of Control, Access to Registers and Memory, No Compiler Dependency, Easier Bug
Identification.

Disadvantages are :

Machine-Dependent, Lengthy Code, Error-Prone, Limited Execution, Complex Syntax, Incompatibility.

High-Level Language

- Advantages are :

Programmer Friendly, Abstraction, Machine Independence, Ease of Learning, Error Detection,


Productivity.

- Disadvantages are:

Translation Overhead, Slower Execution, Memory Efficiency, No Direct Hardware interaction.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy