Professional Documents
Culture Documents
Introduction
In Writing a program in assembly
language requires knowledge of the
computer’s instruction set, the rules of its
use, and the hardware on which it runs.
An assembly language program consists
of one or more segments for defining
data and for machine instructions and a
segment named the stack that contains
stored addresses.
We will utilize ROM (Read-only Memory), the
important feature of ROM in programming is its
Basic Input/Output System (BIOS), RAM
(Random Access Memory) , its importance is
its availability as a “worksheet” for temporary
storage and execution of programs, and
Addressing Memory Locations, an assembly
language programmer has to distinguish
between the address of memory location and
its contents.
SEGMENTS
Code Segment
Data Segment
Stack Segment
Segment Boundaries
Code Segment – the code segment
contains the machine instructions that
are to execute. Typically, the first
executable instruction is at the start of
this segment, and the operating system
links to this location for program
execution. The CS (code segment)
register addresses this segment.
Data Segment – The data segment
contains a program’s defined data,
constants, and work areas. The DS
(data segment) register addresses this
segment.
Stack Segment – the stack contains
any data addresses that you need to
save temporarily for your own “called”
subroutines to return to your main
program. The SS (stack segment)
register addresses this segment.
Segment Boundaries
MOV CX, 00
MOV CH, 00
MOV CL, 00
AX register