Calculator
Calculator
Group Members
MUHAMMAD ZIA-UD-DIN FA17-BEE-060
DATE: 16 -DEC-2019
Wah CAMPUS
CIRCUIT DIAGRAM:
INTERFACING
27C128
16X2
27C128
FLOW CHART:
COMPONENTS:
1. Microprocessor (8086)
2. 74LS273
3. 27C128
4. 8255A
5. LCD
6. Calculator
7. Gates
PURPOSE OF USING:
Microprocessor is the basic building block. Which contain code in which
instruction/commands are given cross ponding to certain address which send to further
components to perform action through address or data bus.
27C128 memory which performs action very rapidly. It also give data at give input address.
8255A is a general purpose programmable I/O device designed to transfer the data from I/O
to interrupt I/O under certain conditions as required. It can be used with almost any
microprocessor. It consists of three 8-bit bidirectional I/O ports (24I/O lines) which can be
configured as per the requirement.
ALTERNATIVES:
Logic gates.
STR1 DB “CALCULATOR: $”
STR5 DB “RESULT: $”
ENDS
STACK SEGMENT
DW 128 DUP<0>
ENDS
CODE SEGMENT
START:
MOV AX, 089H; (BINARY OF 89) SET PORT A, B (OUTPUT) & PORT C (INPUT)//MODE
CALCULATOR:
CALL LCD_INT
CALL LCD_PRINTSTR
CALL DELAY
CALL LCD_PRINTSTR
CALL DELAY
; 1ST INTEGER
CALL DELAY
CALL LCD_PRINTSTR
CALL DELAY
; 2ND INTEGER
CALL LCD_PRINTSTR
CALL DELAY
CALL DELAY
CHECK:
JNE ADD
JNE SUB
JNE MUL
CMP CL, 81H
JNE DIV
ADD:
CALL DELAY
CALL DELAY
CALL CALCULATOR
SUB:
CALL DELAY
CALL DELAY
CALL CALCULATOR
DIV:
CALL DELAY
CALL DELAY
CALL CALCULATOR
MUL:
CALL DELAY
CALL DELAY
CALL CALCULATOR
PROC DELAY:
D1:
LOOP D1
RET
ENDP
PROC LCD_INT
CALL LCD_CMD
RET
ENDP
PROC LCD_CMD
CALL DELAY
RET
ENDP
PROC LCD_CLEAR
CALL LCD_CMD
RET
ENDP
PROC LCD_PRINTSTR
PUSH SI
PUSH AX;
ABC:
LODSB
CMP AL,’$’
JE EXIT
MOV AH, AL
CALL LCD_WRITE
JMP ABC
EXIT:
POP AX
POP SI
RET
ENDP
PROC LCR_WRITE
CALL DELAY
CALL DELAY
RET
ENDP
PROTEUS SIMULATION: