Assembly Language From Noob To Pro
Assembly Language
===============
1 ) Assembly
language is a low-level programming language specific to a particular computer
architecture.
2 ) Each
family of processors has its own set of instructions for handling various
operations such as getting input from keyboard, displaying information on
screen and performing various other jobs. These set of instructions are called
'machine language instructions'.
3 ) Machine
language is too obscure and complex for using in software development. So, the
low-level assembly language is
designed for a specific family of processors that represents various
instructions in symbolic code and a more understandable form.
4 ) The
process through which the processor controls the execution of instructions is
referred as the fetch-decode-execute cycle or the execution
cycle. It consists of three continuous steps −
- Fetching
the instruction from memory
- Decoding
or identifying the instruction
- Executing the instruction
5
) An assembly program can be divided into three
sections −
· The data section
· The text section
Text
Segment(Section) - The text section
is used for keeping the actual code (binary code) . This section must begin
with the declaration global _start, which tells the kernel where the
program execution begins.
Data
Segment(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 size, etc., in this section.
BSS
Segment(Section) - The bss section is used for declaring
variables.
section.data
The syntax
for declaring bss section is −
The syntax
for declaring text section is −
section.text
global
_start
_start:
7 ) Assembly language comment begins with a
semicolon (;). It can appear on a line by itself, like −
; This program displays a message on screen
8 ) Assembly language programs consist of three types of statements −
- Executable
instructions or instructions,
- Assembler
directives or pseudo-ops, and
- Macros.
9
)
Comments
Post a Comment