Assembly Language Lab-1
Assembly Language Lab-1
ASSEMBLY LANGUAGE
OBJECTIVE
Introduction to microprocessor lab, system and kits and software. Student will get use to the software and lab
equipment, trainers and get use to the lab environment.
TIME REQUIRED : 3 hrs
PROGRAMMING LANGUAGE : NIL
SOFTWARE REQUIRED : Emulator 8086, DOS, Debug
HARDWARE REQUIRED : Core i5 in Computer Labs, MDA – Win8086
INTRODUCTION TO ASSEMBLY LANGUAGE
Assembly language is a low-level programming language. You
need to get some knowledge about computer structure in order
to understand anything. The system bus (shown in yellow)
connects the various components of a computer. The CPU is
the heart of the computer, most of computations occurs inside
the CPU. RAM is a place to where the programs are loaded in
order to be executed.
8086 MICRO-PROCESSOR
We will be studying the assembly language for the microprocessor 8086.
• 8086 micro-processor is a 16-bit microprocessor (a 16-bit microprocessor can operate on the 16-bits of
data at a time) having 16- bit registers.
• 16-bit data bus and 20-bit address bus.
• It can access 1 MB of total memory.
INSIDE A CPU
To write the assembly language programs for 8086 micro-processor, we are required to know the internal
organization at least programming model
GENERAL PURPOSE REGISTERS
8086 CPU has 8 general purpose registers, each register has its own name:
• AX - the accumulator register (divided into AH / AL).
• BX - the base address register (divided into BH / BL).
• CX - the count register (divided into CH / CL).
• DX - the data register (divided into DH / DL).
• SI - source index register.
The address formed with 2 registers is called an effective address. By default, BX, SI and DI registers work
with DS segment register; BP and SP work with SS segment register.
Other general-purpose registers cannot form an effective address! Also, although BX can form an effective
address, BH and BL cannot!
SPECIAL PURPOSE REGISTERS
• IP - the instruction pointer.
• Flags Register - determines the current state of the processor.
IP register always works together with CS segment register and it points to currently executing instruction.
Flags Register is modified automatically by CPU after mathematical operations, this allows to determine the
type of the result, and to determine conditions to transfer control to other parts of the program. Generally, you
cannot access these registers directly.
REGISTERS CLASSIFICATIONS
The registers inside the microprocessor are classified according to the function they perform. In general, they
are classified as: -
• Data registers
• Address registers
• Segment register
• Offset registers
• Status register
REGISTER SIZE
We have three different sizes of registers:
• 8-bit register: AH, AL, BH, BL, CH, CL, DH, DL
• 16-bit registers: AX, BX, CX, DX, SP, BP, SI, DI, SS, DS, CS, ES, FS, GS, IP, FLAGS
• 32-bit registers: EAX, EXB, ECX, EDX, ESI, EDI, ESP, EBP, EIP, and EFLAGS.
SEGMENT AND OFFSET REGISTER
• Address registers store addresses of instructions and data in memory.
RESOURCES:
https://www.youtube.com/watch?v=wLXIWKUWpSs
https://www.tutorialspoint.com/assembly_programming/assembly_introduction.htm