Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
7 views9 pages

Week 1 - Lecture 1

The document provides an overview of assembly language, detailing its definition, differences from high-level programming languages, advantages, and disadvantages. It emphasizes the importance of assembly language in various fields such as embedded systems, operating systems, and cybersecurity, highlighting its role in performance optimization and hardware control. Additionally, it covers the structure of assembly language statements, the distinction between assemblers and compilers, and the basic components of computers.

Uploaded by

mansoorabdulatef
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)
7 views9 pages

Week 1 - Lecture 1

The document provides an overview of assembly language, detailing its definition, differences from high-level programming languages, advantages, and disadvantages. It emphasizes the importance of assembly language in various fields such as embedded systems, operating systems, and cybersecurity, highlighting its role in performance optimization and hardware control. Additionally, it covers the structure of assembly language statements, the distinction between assemblers and compilers, and the basic components of computers.

Uploaded by

mansoorabdulatef
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/ 9

Table of contents

Introduction about Assembly language ..................................................................................... 2


What is an Assembly Language?  ..................................................................................................... 2
What is the difference between the Assembly language and the high level programming languages?  .... 2
Reasons to Study Assembly Language Programming  ......................................................................... 2
Disadvantages of Assembly Language Compared to High-Level Languages  .......................................... 2
Advantages of Assembly Language Compared to High-Level Languages  .............................................. 2
The Statement Structure in Assembly Language  ................................................................................ 3
Four Different Kinds of Statements in Assembly Language  ................................................................. 3
The difference between the Assembler and the compiler  .................................................................. 3
Fields That Use Assembly Language  ..................................................................................... 5
Basic Units  ......................................................................................................................... 7
Numbering systems  ............................................................................................................ 7
The basic components of any computer  ............................................................................... 7
The history of Micro Processors  .......................................................................................... 8

1 Summarized by: Eng. Anam Al-Ariqi Version 2 Assembly Language


 Keep (‫ || )ﺣﻔﻆ‬ Understand (‫ || )إفهم وعبر بإسلوبك‬ Read only (‫)مجرد قراءة وإطﻼع‬
Introduction about Assembly language

What is an Assembly Language? 

It is a low-level programming language that uses mnemonic codes to represent machine-level


instructions. It is specific to a particular computer architecture and allows programmers to
directly deal with the computer’s internal components.

What is the difference between the Assembly language and the high level programming
languages? 

 Assembly language deals with the computer’s internal components.


 High level programming languages deal with operating systems: windows, Linux, etc.

Reasons to Study Assembly Language Programming 

 Understanding Hardware: Assembly language provides a closer look at how the


computer’s internal components operates. For example, learning how data is moved
between registers and memory helps understand CPU operations.
 Performance Optimization: Assembly language can be used to write highly optimized
code for performance-critical applications. For example, writing a fast Fourier transform
(FFT) algorithm in assembly can be significantly faster than in a high-level language.
 Embedded Systems: Many embedded systems use assembly language for programming
due to resource constraints. For instance, programming a microcontroller for real-time
tasks often requires assembly language.
 Debugging and Reverse Engineering: Knowledge of assembly language is crucial for
debugging low-level code and reverse engineering software. For example, most malware
and viruses are written using assembly language, so we need to learn assembly to
understand their behavior and stop them.

Disadvantages of Assembly Language Compared to High-Level Languages 

 Complexity: Assembly language is more complex and harder to learn than high-level
languages. Writing a simple "Hello, World!" program requires understanding CPU
architecture and instruction sets.
 Lack of Portability: Assembly code is specific to a particular processor architecture.
Code written for an x86 processor will not run on an ARM processor without
modification.
 Time-Consuming: Writing and debugging assembly language programs can be time-
consuming. A task that takes a few lines in Python might require dozens of lines in
assembly.
 Maintenance: Assembly language programs are harder to maintain and understand,
especially by someone who did not originally write the code.

Advantages of Assembly Language Compared to High-Level Languages 

 Performance: Assembly language programs can be highly optimized for speed and
efficiency. For instance, critical sections of an operating system may be written in
assembly to maximize performance.
 Control: Assembly language provides direct control over hardware and system resources.
This is essential for tasks like writing device drivers and real-time applications.
 Size: Programs written in assembly language can be smaller in size, which is crucial for
systems with limited memory.
 Special Instructions: Some processor-specific instructions are not accessible through
high-level languages. For example, SIMD (Single Instruction, Multiple Data) instructions
can be used to accelerate multimedia processing.

2 Summarized by: Eng. Anam Al-Ariqi Version 2 Assembly Language


 Keep (‫ || )ﺣﻔﻆ‬ Understand (‫ || )إفهم وعبر بإسلوبك‬ Read only (‫)مجرد قراءة وإطﻼع‬
The Statement Structure in Assembly Language 

 Label: An identifier for a memory location or instruction, e.g., start:


Could be anything but:
 Must not start with a number or special character such as: ! @ # …etc.
 Must not be an Opcode/ directive name such as: MOV, ORG, END …etc.
 Mnemonic: The operation code, e.g., MOV, Or directive name e.g. ORG Or macro name
 Operands: The data to be processed, e.g., AX, 1
 Comments: Explanatory text, e.g., ; This is a comment

Example:

start: MOV AX, 1 ; Move the value 1 into register AX

Four Different Kinds of Statements in Assembly Language 

 Data Definition: Defines data storage.


Example: DB 10 (Defines a byte with the value 10)
 Instruction: Specifies an operation for the CPU to perform.
Example: ADD AX, BX (Adds the value in register BX to AX)
 Directive: Provides instructions to the assembler, not the CPU.
Example: ORG 100h (Sets the origin address for the code)
 Macro: Defines a sequence of instructions that can be reused.
Example:
MACRO INCREMENT
INC AX
ENDM

The difference between the Assembler and the compiler 

 Assembler: A program that translates assembly language into machine code. Assembly
Language A symbolic representation of the machine language of a specific processor,
augmented by additional types of statements that facilitate program writing and that
provide instructions to the assembler.
 Compiler: A program that converts another program from some source language (or
programming language) to machine language (object code). Some compilers output
assembly language which is then converted to machine language by a separate
assembler.
A compiler is distinguished from an assembler by the fact that each input statement does not, in general,
correspond to a single machine instruction or fixed sequence of instructions. A compiler may support such
features as automatic allocation of variables, arbitrary arithmetic expressions, control structures such as

3 Summarized by: Eng. Anam Al-Ariqi Version 2 Assembly Language


 Keep (‫ || )ﺣﻔﻆ‬ Understand (‫ || )إفهم وعبر بإسلوبك‬ Read only (‫)مجرد قراءة وإطﻼع‬
FOR and WHILE loops, variable scope, input/output operations, higher-order functions and portability of
source code.

4 Summarized by: Eng. Anam Al-Ariqi Version 2 Assembly Language


 Keep (‫ || )ﺣﻔﻆ‬ Understand (‫ || )إفهم وعبر بإسلوبك‬ Read only (‫)مجرد قراءة وإطﻼع‬
The Significance of Assembly Language for Cybersecurity Specialists
ً ً ‫ اﻷسمبلي توفر‬:‫ فهم بنية الجهاز‬
‫فهما عميقا لكيفية تفاعل التعليمات البرمجية مع بنية الجهاز على مستوى وحدة المعالجة‬
.‫المركزية والذاكرة‬
ً :‫ تحليل البرمجيات الخبيثة‬
‫ للتغلب‬،‫ مثل اﻷسمبلي‬،‫غالبا ما يكتب مطورو البرمجيات الخبيثة برامجهم بلغات قريبة من لغة اﻷلة‬
.‫ فهم اﻷسمبلي يساعد محللي اﻷمن في تحليل الشيفرة الخبيثة وتفكيكها‬،‫ لذا‬.‫على أنظمة الحماية‬

‫ خاﺻة عند استغﻼل الثغرات حيث يحتاج‬،‫ فهم اﻷسمبلي ضروري في اﻹختبارت المتعلقة باﻻختراق‬:‫ اﻹختبارت المتعلقة باﻻختراق‬
.‫المختبر إلى كتابة شيفرات تستغل هذه الثغرات أو تعديلها مباشرة‬

‫ يمكن لمختصي اﻷمن السيبراني قراءة وتحليل التعليمات البرمجية المكتوبة بلغة اﻵلة‬،‫ من خﻼل اﻷسمبلي‬:‫ الهندسة العكسية‬
‫ ما يسمح بفهم البرنامج واكتشاف اﻷخطاء اﻷمنية أو الوظائف‬،‫والتي يتم تحويلها لﻸسمبلي أثناء عملية الهندسة العكسية‬
‫الخبيثة‬
ُ ‫ التعامل مع اﻷنظمة‬
IoT ‫ يحتاج متخصص اﻷمن السيبراني للتعامل مع أنظمة مدمجة مثل‬،‫ في بعض اﻷحيان‬:‫المدمجة‬
‫عال مع موارد محدودة‬
ٍ ‫والتي تتطلب اﻷسمبلي لتحقيق أداء‬

Fields That Use Assembly Language 


Assembly language is utilized in various fields that require high levels of control and efficiency in resource
usage. Here are some detailed examples:

1. Embedded Systems

 Definition: Embedded systems are small computing systems hidden inside larger
electronic devices, such as home appliances, cars, and medical devices.
 Usage: Assembly language is used to ensure high performance and precise control in
resource-constrained devices.
 Examples:
o Programming microcontrollers in devices like washing machines and remote
controls.
o Developing software for mobile phones and embedded systems in cars (e.g.,
Anti-lock Braking Systems (ABS)).
2. Operating Systems

 Definition: Operating systems are software that manage computer resources and provide
services to other software components.
 Usage: Assembly language is used to write critical parts of operating systems to ensure
efficiency and security.
 Examples:
o Kernels of operating systems like the Linux kernel.
o Memory management, multiprocessing, and interrupt handling.
3. Low-Level Development

 Definition: Software that interacts directly with hardware or uses processor-specific


instructions.
 Usage: Assembly language is used to write drivers and parts of software that require
high performance.

5 Summarized by: Eng. Anam Al-Ariqi Version 2 Assembly Language


 Keep (‫ || )ﺣﻔﻆ‬ Understand (‫ || )إفهم وعبر بإسلوبك‬ Read only (‫)مجرد قراءة وإطﻼع‬
 Examples:
o Writing device drivers for peripherals like printers and network interfaces.
o Developing BIOS and UEFI software that run when the computer starts.
4. Games and Graphics

 Definition: Software that requires intensive graphical processing and high performance.
 Usage: Assembly language can be used to optimize performance in game engines and
parts of graphical software.
 Examples:
o Accelerating graphics routines in games.
o Enhancing performance of graphics libraries like OpenGL and DirectX.
5. Information Security

 Definition: A field focused on protecting systems and networks from attacks and
breaches.
 Usage: Assembly language is used in malware analysis and developing security testing
tools.
 Examples:
o Writing and exploring security exploits.
o Developing reverse engineering tools and analyzing malicious software.
6. Scientific and Engineering Applications

 Definition: Applications that require high performance and precision in computations.


 Usage: Assembly language is used to program algorithms that need intensive processing.
 Examples:
o Particle physics simulations.
o Big data analysis and astronomical image processing.
7. Education and Training

 Definition: Teaching computing principles and programming through a deeper


understanding of computer operations.
 Usage: Assembly language is used as an educational tool to illustrate how processors
work and how instructions are executed.
 Examples:
o Teaching courses in computer engineering.
o Training students to write low-level programs.
8. Industrial Control and Automation

 Definition: Systems that control and manage industrial processes.


 Usage: Assembly language is used to program programmable logic controllers (PLCs)
used in industrial automation.
 Examples:
o Programming industrial robots.
o Controlling automated production systems in factories.
9. Instrumentation and Control

 Definition: Devices used to measure and control physical variables such as pressure and
temperature.
 Usage: Assembly language is used to program systems that require high accuracy and
fast response.
 Examples:
o Developing control systems for aircraft.
o Programming medical measurement instruments.

6 Summarized by: Eng. Anam Al-Ariqi Version 2 Assembly Language


 Keep (‫ || )ﺣﻔﻆ‬ Understand (‫ || )إفهم وعبر بإسلوبك‬ Read only (‫)مجرد قراءة وإطﻼع‬
Basic Units 
1 bit = 1 bit (0, 1)
nibble = 4 bits
Byte = 8 bits
word = 16 bits (2 Bytes)
Doubleword = 32 bits (4 Bytes)
Quadword = 64 bits (8 Bytes)
kilobyte (KB) = 210 bytes (=1024 byte)
megabyte (MB) = 220 bytes (=1024 KB)
gigabyte (GB) = 230 bytes (=1024 MB)
terabyte (TB) = 240 bytes (=1024 GB)
petabyte (PB) = 250 bytes (=1024 TB)
Exabyte (EB) = 260 bytes (=1024 PB)

Numbering systems 
Decimal Hexadecimal Binary
0 0 0000
1 1 0001
2 2 0010
3 3 0011
4 4 0100
5 5 0101
6 6 0110
7 7 0111
8 8 1000
9 9 1001
10 A 1010
11 B 1011
12 C 1100
13 D 1101
14 E 1110
15 F 1111

The basic components of any computer 

Computer

I/O
Memory Microprocessor Buses
input/output
‫الذاكرة‬ ‫المعالج‬ ‫الناقﻼت‬
‫المخرجات‬/‫المدخﻼت‬

RAM ROM Control bus

Address bus

Data bus

7 Summarized by: Eng. Anam Al-Ariqi Version 2 Assembly Language


 Keep (‫ || )ﺣﻔﻆ‬ Understand (‫ || )إفهم وعبر بإسلوبك‬ Read only (‫)مجرد قراءة وإطﻼع‬
The history of Micro Processors 

(a) 1970s Processors

(b) 1980s Processors

(c) 1990s Processors

8 Summarized by: Eng. Anam Al-Ariqi Version 2 Assembly Language


 Keep (‫ || )ﺣﻔﻆ‬ Understand (‫ || )إفهم وعبر بإسلوبك‬ Read only (‫)مجرد قراءة وإطﻼع‬
(d) Recent Processors

9 Summarized by: Eng. Anam Al-Ariqi Version 2 Assembly Language


 Keep (‫ || )ﺣﻔﻆ‬ Understand (‫ || )إفهم وعبر بإسلوبك‬ Read only (‫)مجرد قراءة وإطﻼع‬

You might also like