Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Egyptian Academy for Engineering and Advanced Technology

Electrical Engineering Department

Academic level: 2 Semester: Spring 2018/2019


Course Title : Microprocessor & its applications Course code :ECO 272

Q1: Implement an instruction sequence that calculates the absolute


difference between the contents of AX and BX and places it in DX.

CMP AX, BX
JC DIFF2
DIFF1: MOV DX, AX
SUB DX, BX; (DX)=(AX)-(BX)
JMP DONE
DIFF2: MOV DX, BX
SUB DX, AX; (DX)=(BX)-(AX)
DONE: NOP

Q2: Write a program to calculate the factorial of 05h.


Solution:
MOV BL, 05h
MOV AL, 01h
AGAIN: MUL BL
DEC BL
JNZ AGAIN
Q3: write a program to calculate the numbers from 0 to 100.
mov ax,0000d
mov cx,100d
again: add ax,cx
dec cx
jnz again
Q4: write a program to calculate the even numbers from 0 to 100.
mov ax,0000d
mov cx,100d
again: add ax,cx
sub cx,02d
jnz again

Q5: Show the main differences between the microcontroller and the
microprocessor giving examples.

Q6: Show the microcontroller classifications according to :


a. Memory
b. Bus size

c. Instruction set

You might also like