Professional Documents
Culture Documents
National University of Computer & Emerging Sciences: Lab 01 Mr. Zia Ur Rehman
National University of Computer & Emerging Sciences: Lab 01 Mr. Zia Ur Rehman
National University of
Computer & Emerging Sciences
Lab 01
Introduction
Mr. Zia Ur Rehman
About me
• BS(SE) –Comsat University(2014-2018)
• Instructor –FAST-NU(2019-)
About me
Office: 307
Office hours – to be decided
Email: zia.urrehman@nu.edu.pk
Some Rules
Some Rules
Dishonesty, Plagiarism
Final Exam 30
Total 100
Note: The evaluation Breakdown plus course outline for all sections will be same
Grading will be combined so don’t rely on your class position look for the batch position
PROGRAM
TRANSLATION
SEQUENCE
Assembly Language
Machine Language
Hardware
Program Translation
Assembler
Assembler, A program that converts source-code programs from
assembly language to machine language. It generates
Object file: A machine language translation of the program.
Linker: Copies sub-routines from link library into object file &
produces executable program.
Debugger: Provides a way for programmer to trace execution of a
program and examine the contents of memory.
What is DosBox
Emulator
Free software
Debugging
Run on every Environment
Can grip on syntax
Easy to use
Interface
Drive mounting
DOSBox does not automatically make any
drive (or a part of it) accessible to the
emulation.
You have to make your directories available as
drives in DOSBox by using the "mount"
command.
Drive mounting
mount c c:\8086
FileName .asm
Cont…
link test.obj (this will create an
executable)
Cont…
Test.exe (to run executable)
Instruction
Assembler converts the instruction in to machine
code.
◦ Machine code is a sequence of bits can be read by the
processor.
Tells CPU what to do.
Each instruction has
◦ Mnemonic (Required)
Symbolic Code for Instructions or Commands to perform
a particular function
mov, inc, add, sub, mul
◦ Operand (Optional/Depend on Instruction)
On which operation is to be performed.
Type of Operands
Immediate
◦ A constant Integer of 8 or 16 bit.
Register
◦ Name of register.
Memory
◦ References to Memory Location.
Arithmetic Instructions
INC operand1
◦ operand = operand + 1
Example
◦ MOV AL, 228 ;
◦ INC AL ; AL = 229
DEC operand1
◦ operand = operand - 1
Example
◦ MOV AL, 255 ;
◦ DEC AL ; AL = 254
Examples
Val=result; MOV AX,result
MOV Val,AX
Sample Code
Example 2
int Y;
int X = (Y + 4) * 3;
Learning Outcomes
Quiz
Thank You :)