This document discusses microprocessors and provides an example of an assembly language program that checks if a number is even or odd. It begins with definitions of a microprocessor as an electronic circuit that functions as the central processing unit of a computer. It then discusses the basic operations of a microprocessor like arithmetic, logical operations. The inside of a microprocessor is described as having three main units - the arithmetic logic unit, control unit, and registers. An example assembly language program is provided and explained with figures that show the steps of taking an input number, dividing it by 2, comparing the remainder to 0, and printing whether it is even or odd.
2. Introduction to Microprocessor & Code
Presenter :
Avijit Adhikary
ID : 173-33-549
MD. Sajib RANA
ID : 173-33-551
Presentation Name
3. Index • Definition of Microprocessor
• Operations of Microprocessor
• Inside of a Microprocessor
• An Executed Code that is performed by
EMU8086 Emulator
4. Definition
What is Microprocessor?
Microprocessor is an electronic circuit that
functions as the central processing unit
(CPU) of a computer, providing
computational control.
Microprocessor is the core of the system.
It called as heart of a computer.
5. Operations
Types of Operations :
Initially microprocessor performs two basic things while executing the instruction:
It performs some basic operations like addition, subtraction, multiplication, division
and some logical operations, using its:
Arithmetic Operation : Addition, Subtraction, Multiplication, Division
Logical Operation : Logical Operations (Such as AND, OR, XOR)
In Short “ It’s called as Central Processing Unit(CPU) that execute ALU operations.”
6. Inside
Inside of a Microprocessor :
Internally, the microprocessor is
made up of three main units.
Arithmetic and Logic Unit (ALU)
Control Unit
Array of Registers
7. Executed Code
Write a program in assembly language to check whether a number is even or odd.
8. .MODEL SMALL ; Established Code
Structure
.STACK 100H ; Enter into DOS
.DATA
MSG1 DW ' is an EVEN Number $’ ; Define Data MSG1
MSG2 DW ' is an ODD Number $’ ; Define Data MSG2
.CODE
MAIN PROC
MOV AX, @DATA
MOV DS, AX ; Initialized “DS” Register
MOV AH, 1 ; Input a Number from Keyboard
INT 21H
MOV BL, 2 ; Move “2” into “BL” Register
DIV BL ; Divide Inputted value by BL Register Value
MOV AL, AH ; Move “AH” register value into “AL”
CMP AL, 0 ; Subtract “AL” value from “0”
JNZ ODD ; Jump ODD
EVEN:
LEA DX, MSG1 ; Collect Data Address as MSG1
MOV AH, 9 ; Print MSG1
INT 21H
JMP EXIT ; Jump to Exit
ODD:
LEA DX, MSG2 ; Collect Data Address as MSG2
MOV AH, 9 ; Print MSG2
INT 21H
EXIT:
MOV AH, 4CH ; Exit from DOS
INT 21H
MAIN ENDP
Program : Part 1 Program : Part 2