0% found this document useful (0 votes)
34 views13 pages

Coal 6

The document discusses assembly language including its relation to machine language and high-level languages, its portability, and how to create and run assembly programs. Assembly language provides direct access to computer hardware and its instructions map directly to machine language instructions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views13 pages

Coal 6

The document discusses assembly language including its relation to machine language and high-level languages, its portability, and how to create and run assembly programs. Assembly language provides direct access to computer hardware and its instructions map directly to machine language instructions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 13

University of Gujrat

Department of Computer Science

Course Code : CS-252


Computer Organization and Assembly Language

1 Lecture # 6
Introduction to Assembly Language

University of Gujrat
2
Contents

 Specific Machine Levels


 Assembly Language
 Assembly Language relation to machine language
 High-Level Language relation to Machine Language
 Portability of Assembly Language
 Creating and running a Program

University of Gujrat
3 Specific Machine Levels

University of Gujrat
4 Assembly Language
 Low-Level language
 Oldest of all programming Languages
 Bears closest resemblance to native machine language
 Provides direct access to computer hardware requiring you to
understand much about your computer’s architecture and operating
system
 You need to develop an understanding how memory addresses and
instructions work at a low level, if you plan to be High-Level
language developer

University of Gujrat
5 Assembly Language relation to Machine Language
 Machine Language is a numeric language specifically understood
by a computer’s processor
 Assembly language consists of statements written with short
mnemonics such as ADD, SUB and CALL
 Assembly language has one-to-one relation with machine language
i.e. One Assembly Language Instruction corresponds to exactly one
machine language instruction

Assembly Language Machine Language


10100000 01010000
MOV
University of Gujrat
AX,5
6 High-Level Language relation to Machine Language

 High-Level Language have one-to-many relationship with assembly


language and machine language
e.g.
Assembly Language

High Level Language mov ax,y


add ax,4
x = (Y + 4) * 3; mov bx,3
imul bx
mov x,ax

University of Gujrat
7 Is Assembly Language Portable?

 Assembly language program is not portable because it is designed


for specific processor family.

 The instructions in assembly language may directly match the


computer architecture or they may be translated during execution by
a program inside the processor known as microcode interpreter

University of Gujrat
8 Creating and Running a Program

Editor

.ASM .OBJ
File Assembler
File Linker

.EXE
University of Gujrat
File
9 Programs Required

Assembler
A utility program that converts source code program from assembly
language into machine language
Linker
A utility program that combines individual files created by an
assembler into a single executable program
Debugger
A utility program that lets you to step through a program while its
running and examine registers and Memory
University of Gujrat
10 A Simple Program

Move 5 to AX Assembly Language


Move 10 to BX mov ax,5
mov bx,10
ADD BX to AX add ax,bx
Move 15 to BX mov bx,15
ADD BX to AX add ax,bx

University of Gujrat
11
General Instruction Format

 instruction dest, src


 instruction dest
 instruction src
 instruction

University of Gujrat
12 EX01.ASM
[ORG 100h]

mov ax,5
mov bx,10
add ax,bx
mov bx,15
add ax,bx

mov ax,4C00h
int
University of Gujrat
21h
Word Representation

 2 Byte Word
MSB LSB

 Representation in Memory
Representation 1
Big Endian Notation MSB LSB
0
1 Representation 2

Little Endian Notation LSB MSB


0
1

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy