Skip to content
The Computer Science
TheCScience
  • Engineering Subjects
    • Human Values
    • Computer System Architecture
    • Digital Communication
    • Internet of Things
  • NCERT Solutions
    • Class 12
    • Class 11
  • HackerRank solutions
    • HackerRank Algorithms Problems Solutions
    • HackerRank C solutions
    • HackerRank C++ problems solutions
    • HackerRank Java problems solutions
    • HackerRank Python problems solutions
The Computer Science
TheCScience

Assembly Language in Computer Architecture

YASH PAL, February 27, 2026February 27, 2026

Assembly Language in Computer Architecture – Assembly language is a low-level programming language, and a programming language is defined by a set of rules. The programs written in assembly language are compiled by an assembler. Every assembler has its own assembly language, which is designed for one specific computer architecture. The basic unit of an assembly language program is a line of code.

Assembly Language mainly consists of mnemonic processor instructions or data, and other statements or instructions. It is produced with the help of compiling the high-level language source code like C, C++. Assembly Language, which helps in fine-tuning the program.

An assembly program can be divided into three sections –

  • The data section
  • The bss section
  • The text section

The data Section: The data section is used for declaring initialized data or constants. This data does not change at runtime. You can declare various constant values, file names, or buffer sizes, etc., in this section. The syntax for declaring a data section is –

section.data

The bss Section: The bss section is used for declaring variables. The syntax for declaring bss section is –

section.bss

The text section: The text section is used for keeping the actual code. This section must begin with the declaration global_start, which tells the kernel where the program execution bagine The syntax for declaring a text section is –

section.text
   global_start
_start:

Comments

Assembly language comment begins with a semicolon (;). It may contain any printable character, including blank. It can appear on a line by itself, like –

This program displays a message on screen

or, on the same line along with an instruction, like –

add eax, ebx ; adds ebx to eax

Rules of the Assembly Language:

Each line of an assembly language program is arranged in three columns called fields. The fields specify the following information.

  1. The label field may be empty, or it may specify a symbolic address. A symbolic address consists of one, two, or three, but not more than three alphanumeric characters. The first character must be a letter, the next two may be letters or numerals. The symbol can be chosen arbitrarily by the programmer. A symbolic address in the label field is terminated by a comma so that it will be recognized as a label by the assembler.
  2. The instruction field specifies a machine instruction or a pseudo-instruction. The instruction field in an assembly language program may specify one of the following instructions:
    1. A memory-reference instruction (MRI)
    2. A register-reference or input-output instruction (non-MRI)
    3. A pseudo instruction with or without an operand
  3. The comment field may be empty, or it may include a comment. A line of code may or may not have a comment, but if it has, it must be preceded by a slash for the assembler to recognize the beginning of a comment field. Comments are useful for explaining the program and are helpful in understanding the step-by-step procedure taken by the program. Comments are inserted for explanatory purposes only and are neglected during the binary translation process.

Advantages of Assembly Language:

  • It allows complex jobs to run in a simpler way.
  • It is memory-efficient, as it requires less memory.
  • It is faster in speed, as its execution time is shorter.
  • It is mainly hardware-oriented.
  • It requires less instruction to get the result.
  • It is used for critical jobs.
  • It is not required to keep track of memory locations.
  • It is a low-level embedded system.
  • It is most suitable for writing interrupt service routines and other memory-resident programs.

Disadvantage of Assembly Language

  • It takes a lot of time and effort to write the code for the same.
  • It is very complex and difficult to understand.
  • The syntax is difficult to remember.
  • It has a lack of portability of the program between different computer architectures.
  • It needs more size or memory of the computer to run the long programs written in Assembly Language.

Let’s take an example to Write a assambly language program to subtract two numbers.

ORG 100/Origin of the program is location 100
LDA SUB/Load subtrahend to AC
CMA/Complement AC
INC/Increment AC
ADD MIN/Add minued to AC
STA DIF/Store difference
HLT/Halt computer
MIN,DEC 83/Minuend
SUB,DEC-23/Subtrahend
DIF,HEX0/Difference stored here
END/End of symbolic program
Assembly Language Program to Subtract Two Numbers

Let’s take another example to write the assembly programs to print “Hello world” in Windows.

  1. Open the notepad.
  2. Write below code
global _main
extern _printf
section .text
_main:
push message
call _printf
add esp, 4
ret
message:
db 'Hello, World!', 10, 0
  1. Save the file with any name, for example, XYZ.asm; the extension should be “.asm”.
  2. The above file needs to be compiled with the help of an assembler, which is NASM (Netwide Assembler).
  3. Run the command nasm -f win32 XYZ.asm
  4. After this, Nasm creates one object file that contains machine code, but not the executable code that is XYZ.obj
  5. To create the executable file for windows Minimal GNU is used, which provides the GCC compiler.
  6. Run the command gcc -o XYZ.exe XYZ.obj
  7. Execute the executable file now, “XYZ”
  8. It will show the output as “Hello, world”.
Computer System Architecture engineering subjects Computer System Architecture

Post navigation

Previous post

Computer Architecture fundamentals
Basic structure of a computer
Functional Units of Computer
Development of Computers
Von Neuman and Harvard machine Architecture
Flynn Classification
Computer Structure Architecture
Interfacing Logic Devices
Levels of Design abstraction
Performance Metrics

Register Transfer Language
Memory Transfer
Arithmetic Micro-operations
Arithmetic Complements
Logic Micro-operations
Shift Micro-operations
Bus Architecture
Data Transfer
Central Processing Unit
CPU Bus Architecture

Computer Register and Types
Common Bus System
Instruction Format
Instruction Types
Instruction Cycle
Addressing Modes
Design of a basic computer

Basic function of a Computer
General register organization
Stack organization
Infix to Reverse Polish Notation Conversion
Instruction Types and their classifications
Data transfer and manipulation
Program control
RISC characteristics
CISC characteristics

Pipeline
Types of Pipeline
Arithmetic Pipeline
Instruction Pipeline
Hazards
Vector Processing

Data Representation
Addition and Subtraction
Adder Circuits
Shift and Add Multiplication Method
Booth's Algorithm
Restoring Division Algorithm
Non-Restoring Division Algorithm
Array Multiplier

Memory Classification
Memory Characteristics
Memory Organization
Memory Types
Associative Memory
Cache Memory
Virtual Memory

Input Output Interface
Modes of Data Transfer
Priority Interrupt
Direct Memory Access
Input-Output Processor
Serial Communication

TheCScience

We at TheCScience.com are working towards the goal to give free education to every person by publishing in dept article about Secondary, Senior-Secondary, and Graduation level subjects.

Pages

About US

Contact US

Privacy Policy

DMCA

Engineering Subjects

Internet of Things

Human Values

Digital Communication

Computer System Architecture

Programming Tutorials

Data Structure and Algorithm

C

Java

NCERT

Class 12th

©2026 TheCScience | WordPress Theme by SuperbThemes