Professional Documents
Culture Documents
Name
Ahmed Daud
Registration Number :
CIIT/DDP-FA10-BTE-002/LHR
daud@live.lancs.ac.uk
Semester
Section
DDP
Department
Electrical Engineering
Course Title
Course Code
EEE342
Assignment Number :
Assignment Topic
Course Book
Submission Date
Submitted To
1|Page
TABLE OF CONTENTS
QUESTION #
PAGE #
Q#1
Q#2
Q#3
References
2|Page
QUESTION NO. 1
Identify the incorrect instructions in the following code segment of 8086-88 assembly language.
SOLUTION:
MOV AX, BX
MUL CX
MOV [256AH], DX
DIV AL
XOR [1256H], BX
; IT XOR MEMORY [1256H] AND BX AND STORE THE RESULT IN LOC [1256H]
; LOAD THE NUMBER INTO A REGISTER, THEN USE THE NEG INSTRUCTION
NEG AX
3|Page
QUESTION NO. 2
Write an 8086-88 assembly language program to convert the Celsius reading into the Fahrenheit
reading. Celsius reading is found in AL register and Fahrenheit reading is to be placed in AH register.
SOLUTION:
; We will convert Celsius to Fahrenheit using formula: f = c * 9 / 5 + 32.
ORG 100H
MOV BL, AL
MOV AL, 9
; COPY 9 IN AL.
IMUL BL
MOV BL, 5
; COPY 5 IN BL.
IDIV BL
ADD AL, 32
; ADD 32 IN AL.
MOV AH, AL
RET
4|Page
QUESTION NO. 3
Write an 8086-88 assembly language program that clears a specific bit in BX register. Number of the
bit which is to be cleared (from 0 to 15) is placed in AL. Program should clear only desired bit leaving
other bits unchanged.
SOLUTION:
MOV DX, 0001H
; COPY 1 IN DX.
MOV CL, AL
SHL DX, CL
NOT DX
AND BX, DX
RET
ALTERNATE SOLUTION:
MOV DX, 0FFFEH
MOV CL, AL
ROL DX, CL
AND BX, DX
5|Page
REFERENCES
Assembly language programming and organization of the IBM PC by Ytha Y. Yu, Charles
Marut
The 80x86 IBM PC and compatible computers: Assembly language, design, and interfacing by
Muhammad Ali Mazidi, Janice Gillispie Mazidi
Assembly Language for Intel-Based Computers by Kip R. Irvine
The Intel Microprocessors: 8086/8088, 80186/80188, 80286, 80386, 80486, Pentium,
Pentium Pro, and Pentium II Processors : Architecture, Programming, and Interfacing by
Barry B. Brey
Assembly language programming for the Intel 80XXX family by William B. Giles
The 80x86 IBM PC and Compatible Computers (Vol 1 and Vol 2)
Microcomputer Systems: The 8086/8088 Family
Online Materials
Intel Developers website http://developer.intel.com
AIX-86 (8086) Datasheet
www.google.com
www.wikipedia.com
http://ocw.mit.edu/
http://see.stanford.edu/
http://mycourses.med.harvard.edu/public/
6|Page