Professional Documents
Culture Documents
Lab # 02
Objective:
Getting familiar with Program Structure and Arithmetic operations using Assembly Language
Program in EMU8086.
Theory:
Arithmetic and logic instructions can be performed on 8-bit (byte) and 16-bit values. The
first operand has to be a register and the result is stored in that register.
org 100h
A DW 11
B DW 4
SUM DW ?
DIFFERENCE DW ?
MULTIPLICATION DW ?
DIVISION DW ?
; Add A and B
MOV AX, A
ADD AX, B
MOV SUM, AX
; Difference of A and B
MOV AX, A
SUB AX, B
MOV DIFFERENCE, AX
; Multiplication of A and B
MOV AX, A
MOV BX, B
MUL BX
MOV MULTIPLICATION, AX
; Division of A by B
MOV AX, A
DIV BX
MOV DIVISION, AX
Tasks to do:
1. Write two appropriated assembly language code to accomplish the following tasks
(use as many as possible arithmetic instructions with less number of registers):
2. Convert 260 oC (Celsius) to using the following expression and store in a F variable:
°F = °C x 9/5 + 32 - 1
3. Convert 1000 oF (Fahrenheit) to oC (Celsius) using the following expression and store
in a C variable:
°C = (°F - 32) x 5/9 + 1
4. After getting the result, clear the AX register contents and negate the BX register
contents.
5. In both cases store the final value of the register AX, BX, CX, DX similar to the
following table (make two separate tables):
AH AL
AX
? ?
BH BL
BX
? ?
CH CL
CX
? ?
DH DL
DX
? ?
F or C