Mic Final
Mic Final
Micro Project on
Calculator
Diploma of Engineering
in
Computer Engineering
by
Computer Engineering
Summer 2020
CERTIFICATE
2019-20
This is to certify that the micro project entitled “Calculator” has been submitted by Group
Members under the guidance of Mrs.Anuja Borkar in partial fulfillment of the requirement for
the award of Diploma of Engineering in Computer Engineering from Maharashtra State Board of
Technical Education.
“Calculator”
GROUP MEMBERS
18 – Dhanashree Dhanoki
19-Taher Kachwala
27-Varun Dabholkar
30-Vedangi Jadhav
47-Jinal Gandhi
PART –A PLAN
1 Brief Introduction
3 Action Plan
4 Resources Required
PART –B
OUTCOMES
1 Brief Description
2 Aim of Micro-Project
PART-A PLAN
Procedure:
Procedure is a block of code that is sequence of instructions which need to be executed several times in the
main program and called whenever required. In this the program control is transferred to the procedure when
call instruction is executed.
After the execution of the procedure program control is again transferred back to the main program.
1) Proc
2) Endp
Syntax: - Proc_name:
procedure body
Ret
3) CALL
4) RET
When we use Procedure the no, of lines of the main program reduces that is the memory required is less.
Extra overhead time is required for linkage between the calling program and the called
program
Which results low speed of execution. RET is required at the end of the procedure.
voce
3 Assembler Masm 1
4 Linker Tlink 1
5 Debugger Debug orTD 1
PART-B OUTCOME
Advantages:
1) Allows to save memory space.
2) Program development becomes easier.
3) Debugging of errors in program become easy.
4) Reduced size of program
5) Reusability of procedure.
Disadvantages:
1) CALL and RET instructions are always required to integrate with procedures.
2) Requires the extra time to link procedure and return from it.
3) For small group of instructions, linking and returning back time more than the execution time, hence for
small group of instructions procedures cannot be preferred.
Algorithm:
Step. 1: Start
Step. 2: initialize Data Segment
Step. 3: Initialize Variables
Step. 4: Call Procedure BCD_ADD
Step. 5: Add two BCD numbers
Step 6: Store result in AX Register
Step. 7: Return to the Main Program
Step.8:Stop
When 8086 executes a near CALL instruction, it decrements the stack pointer by 2 and copies the IP register
contents on to the stack. Then it copies address of first instruction of called procedure. SP <- SP-2
When 8086 executes a far call, it decrements the stack pointer by 2 and copies the contents of CS register to
the stack. It the decrements the stack pointer by 2 again and copies the content of IP register to the stack.
Finally, it loads s register with base address of segment having procedure and IP with address of first
instruction in procedure.
SP <- sp-2
SP <- sp-2
Operation for FAR procedure: IP register is replaced by address popped off from top of stack, then SP will
be incremented by 2. The CS register is replaced with an address popped off from top
SP <- SP+2
SP<SP+2
1. Firstly, we all gathered the information for BCD addition and Subtraction by using procedure
using microprocessor 8086.
2. Then we took the initiative to finalize the gathered information to perform the progam code
of calculatorof our project.
3. After performing the program we got the suitable output with the successful result.
4. Then we took initiiative of formatting and editing the content of our microprocessor.
5. After editing we took the reviews of our content and finalized the report.
6. Finally, we completedour micro-project by taking hardcopy of report.
Program of Procedure:
DATA SEGMENT
NUMI DB 06
NUM2 DB 05 SUM DW ?
DATA ENDS
CODE SEGMENT
MOV DS, AX
INT 21H
DAA
MOV SUM, AX
RET
CODE ENDS
END START
Algorithm
DATA SEGMENT
NUMI DB 06
NUM2 DB 05 SUB DW ?
DATA ENDS
CODE SEGMENT
MOV DS, AX
INT 21H
DAS
MOV SUB, AX
RET
CODE ENDS
END START
Thus,we have studied in brief the program code using microprocessor 8086 which helped us to
develop our skills and interaction with programming.