0% found this document useful (0 votes)
22 views

Exp 3

The document describes an experiment to familiarize with an assembly language program containing arithmetic operations. The program contains instructions like MOV, ADD, SUB, INC, DEC, MUL, DIV, IDIV. The student is asked to generate machine code, write it to memory locations, execute it step-by-step and observe register contents after each instruction to verify results.

Uploaded by

Par Veen
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

Exp 3

The document describes an experiment to familiarize with an assembly language program containing arithmetic operations. The program contains instructions like MOV, ADD, SUB, INC, DEC, MUL, DIV, IDIV. The student is asked to generate machine code, write it to memory locations, execute it step-by-step and observe register contents after each instruction to verify results.

Uploaded by

Par Veen
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 3

Bangladesh University of Professionals (BUP)

Department of Information and Communication Technology (ICT)


Microprocessor and Interfacing Lab
Code: ICE- 3108

Experiment No. 03:


Familiarize with assembly language program containing arithmetic operations, execution of
the program in single step mode and verification of the results.

Program:

MOV AX, 0001H


ADD AX, 6789H
STC
ADC AX, 0488H
;
SUB AX, 156FH
STC
SBB AX, 080FH
;
MOV AX, 00FEH
INC AL
DEC AL
CBW
NEG AL
;
MOV AL, 0AH
MOV BL, 11H
MUL BL
;
MOV AX, 12ABH
MOV BX, 1234H
IMUL BX
;
MOV AX, 00F0H
MOV BL, 10H
DIV BL
;
MOV AX, −205
MOV BL, 4
IDIV BL
;
HLT
Experiment Procedures:

1. Generate the machine code of the above assembly language programming using
emu8086 emulator.

2. Turn on the 8086 microprocessor kit.

3. Set the address 0000H : 1000H in 8086 kit.

4. Write the machine codes in the appropriate memory address according to the following
table:

Offset Address Machine Code Instruction/ Mnemonics

1000 B8 0100 MOV AX, 0001H

1003 05 8967 ADD AX, 6789H

1006 F9 STC

1007 15 8804 ADC AX, 0488H

100A 2D 6F15 SUB AX, 156FH

100D F9 STC

100E 1D 0F08 SBB AX, 080FH

1011 B8 FE00 MOV AX, 00FEH

1014 FE C0 INC AL

1016 FE C8 DEC AL

1018 98 CBW

1019 F6 D8 NEG AL

101B B0 0A MOV AL, 0AH

101D B3 11 MOV BL, 11H

101F F6 E3 MUL BL

1021 B8 AB12 MOV AX, 12ABH

1024 BB 3412 MOV BX, 1234H

1027 F7 EB IMUL BX

1029 B8 F000 MOV AX, 00F0H

102C B3 10 MOV BL, 10H

102E F6 F3 DIV BL

1030 B8 33FF MOV AX, −205

1033 B3 04 MOV BL, 4

1035 F6 FB IDIV BL

1037 F4 HLT
5. Execute this program in single step using S. Observe the register contents after
execution of each instruction and note down in the data table. Perform theoretical
calculations and verify results.

Data Table:

IP Instruction/ Mnemonics AX BX DX Set Remarks


Flag
Initial Status
MOV AX, 0001H
ADD AX, 6789H
STC
ADC AX, 0488H
SUB AX, 156FH
STC
SBB AX, 080FH
MOV AX, 00FEH
INC AL
DEC AL
CBW
NEG AL
MOV AL, 0AH
MOV BL, 11H
MUL BL
MOV AX, 12ABH
MOV BX, 1234H
IMUL BX
MOV AX, 00F0H
MOV BL, 10H
DIV BL
MOV AX, −205
MOV BL, 4
IDIV BL
HLT

Report:
1. Discuss the effect of each instruction/ mnemonics that is used in this program.

You might also like