COMP 231 Microprocessor and Assembly Language
COMP 231 Microprocessor and Assembly Language
Microprocessor and
Assembly Language
Course description
General study of both hardware and
software included in the
microcomputer systems.
Intel 8085/8086/8088, and its
associated supporting devices and
software.
Assembly programming language.
Objectives
Introduction to different types of
microprocessors and their
applications.
Different hardware/software that is
supported by microprocessors.
Assembly language programming
and their applications.
Internal evaluation
Lab report: 7
Quiz 1: 3
Quiz 2: 3
Quiz 3: 3
Quiz 4: 3
Assignment 1: 2
Assignment 2: 2
Internal examination 1: 7
Internal examination 2: 7
Lab exam: 5
Viva: 5
Class discipline: 3
Total: 50 marks
Your responsibilities
Understand the lecture slides and do
assignments
Uphold academic honesty in
completing your assignments,
projects, and exams.
Text book
1. John Uffenbeck, The 80x86 Family
design, programming and Interfacing.
2. Microprocessor Architecture,
Programming, and Application with the
8085- Ramesh Gaonkar.
3. Microprocessor Systems: The
8086/8088 Family architecture,
Programming, and Design - Yu-cheng
Liu, Glenn A. Gibson.
Syllabus
1. Introduction and history of
Microprocessors
2. Basic block diagram of a microcomputer,
Stored program computer (Von Neumann
Architecture) and related terminologies,
Bus system architecture.
3. Introduction of 8085 microprocessor and
its Functional Block Diagram and pin
configuration, 8085 Programming Model.
Development of computer
Computer is the most efficient and
versatile electronic machine is a
development of a calculator.
The development & enhancement in
the calculator leads to the
development of computer.
First Gen(1940-56)
Vacuum tubes
First general purpose electronic
digital computer was ENIAC
(Electronic Numerical Integrator And
Calculator).
Enormous in size and consumed very
high power.
Faster than mechanical computer
Second Gen(1956-63)
Transistors
Transistors replaced Vacuum tubes
Smaller, faster, cheaper, energy
efficient and reliable computers.
But generated more heat
Moved from binary machine to
symbolic or assembly language.
Fortran COBOL were also being
developed.
Third Gen(1964-71)
Development of integrated circuit
Transistors were placed on silicon
chips.
Drastically increased the speed and
efficiency.
Users interacts with keyboards and
monitors with user interactive OS.
Calculator
Data processing device that carries
out logic and arithmetic operations.
Accepts data from a small keyboard,
performs the arithmetic and logical
calculation and show the result on
LCD or LED.
Programs are stored in ROM, data
stored in RAM.
Features
Interface easily with keyboards and
displays.
Handle decimal digits as units.
Execute the standard program stored in
ROM
Mathematical functions
Low cost, small size and low power
consumption.
Von-Neumann Architecture
Known as stored program
concept and was developed by
John Von Neumann.
Computer could get instruction by
reading them from memory and a
program could be set or altered by
setting the values of a portion of
memory.
Harvard Architecture
Microprocessor
A P is a programmable, clock driven
electronic device, designed with
registers, flip-flops & timing elements
that reads binary instruction from a
storage device called memory,
accept binary data as input and
process data according to those
instruction and provide the results as
output.
Introduction to Assembly
Language
Programming
Disadvantages:
Need to know detail hardware implementation
Not portable
Slow to development and difficult to debug
Comments
.MODEL SMALL
.STACK
Assembly directive
.CODE
.STARTUP
MOV
D1: MOV
0040H
MOV
AND
LOCK bit
.EXIT
END
Label
AX,40H
;set AX to 0040H
DS,AX
SI,17H
Instructions
Instruction Format
General Format of Instructions
Label:
Opcode
Operands
; Comment
Operands: Instructions of 80x86 family can have one, two, or zero operand
MOV AL, BL
Mode Operand1Operand2
1000100011000011
MOV
Register
mode
Assembler Directives
Source File
DATA
List File
16 DUP(?)
DB
ENDS
CODE
ORG
AX,7000H
7000H
POINTS DB
7010
SUM
0000
00
DATA
CODE
DB
ORG
8000H
DS,AX
MOV
AL,0
8003 8E D8
MOV
DS,AX
8005 B0 00
MOV
AL,0
END TOTAL
ENDS
MOV
CODE ENDS
16 DUP(?)
8000H
MOV
TOTAL:
DATA
7000H
POINTS DB
DATA
0000
AX,7000H
Assembler Directives
SEGMENT directive
ENDS directive
END directive
ORG directive
DB: Define Byte; DW, .
ASSUME directive
Specifies the segment register (segment Register) that will be used to calculate the effective
addresses for all labels and variables defined under a given segment or group name (segment Name
Assembler Directives
Simplified Segment Directives
.MODEL SMALL
DATA
SEGMENT
CODE
SEGMENT
TINY
one
one
SMALL
one
one
MEDIUM
one
multiple
COMPACT
multiple
one
LARGE
multiple
multiple
HUGE
multiple
multiple
FLAT*
one
one
.DATA
ORG
7000H
POINTS DB
SUM
DB
16 DUP(?)
?
.CODE
ORG
TOTAL:
8000H
MOV
AX,7000H
MOV
DS,AX
MOV
AL,0
RET
END
TOTAL
Linker
Assembler
Syntax check
Translate source
files into
OBJ
files
machine code
OBJ
files
Executable
files
numoff.asm
Link numoff
Syntax check;
Translate assembly instructions into machine codes
0000
0200
0000
0000
0003
0005
0008
.model small
.data
org 0200H
12
Var1 DB 12H
.code
B8 0000 MOV AX, 0000
8E D8
MOV DS, AX
A0 0100 label1: MOV AL, DS:[0100H]
EB FB
JMP label1
end
7-54
Binary file