You are on page 1of 41

1.

SUM OF SQUARES AND CUBES OF N NUMBERS

Aim: Write a program to find the sum of squares of the ‘n’ numbers.

Apparatus: 8086 trainer kit

Address Code Label Mnemonic Operand


8000 BA MOVW DX,0000
8001 00
8002 00
8003 B8 MOVW AX,0000
8004 00
8005 00
8006 BE MOVW SI,2000
8007 00
8008 20
8009 8A MOV CL,[SI]
800A 0C
800B 46 LP INC SI
800C 8A MOV AL,[SI]
800D 04
800E 8A MOV BL,AL
800F D8
8010 F6 MUL BL
8011 E3
8012 03 ADD DX,AX
8013 D0
8014 73 JNC LP1
8015 01
8016 42 INC DX
8017 FE LP1 DEC CL
8018 C9
8019 75 JNZ LP
801A F0
801B 8B MOV AX,DX
801C C2
801D CC INT 03
Procedure:
1.Enter the program in 8086 micro processors kit in .A mode at ------- location.
2.Enter the input in .S mode at ------ location.
3.Execute the program using .G enter, after that give program starting address.
4.note down the ouput.

Input: 2000 -05 Output: AX=C53A, DX=C53A


2001-FF
2002 –EE
2003-DD
2004 -CC
2005-BB
Aim: Write a program to find the sum of cubes of the ‘n’ numbers.

Apparatus: 8086 trainer kit

Address Code Label Mnemonic Operand


2000 BC MOVW SP,0000
2001 00
2002 00
2003 BD MOVW BP,0000
2004 00
2005 00
2006 B8 MOV AX,0000
2007 00
2008 00
2009 BA MOV DX,0000
200A 00
200B 00
200C BB MOV BX,0000
200D 00
200E 00
200F BE MOV SI,3000
2010 00
2011 30
2012 8A MOV CL,[SI]
2013 0C
2014 46 LP INC SI
2015 8A MOV AL,[SI]
2016 04
2017 8A MOV BL,AL
2018 D8
2019 F6 MUL BL
201A E3
201B F7 MUL BX
201C E3
201D 03 ADD BP,AX
201E E8
201F 03 ADD SP,DX
2020 E2
2021 73 JNC LP1
2022 01
2023 45 INC BP
2024 FE LP1 DEC CL
2025 C9
2026 75 JNZ LP
2027 EC
2028 8B MOV AX,BP
2029 C5
202A 8B MOV DX,SP
202B D4
202C CC INT 03

Procedure:
1.Enter the program in 8086 micro processors kit in .A mode at ------- location.
2.Enter the input in .S(MD or MP for micro controller) mode at ------ location.
3.Execute the program using .G enter, after that give program starting address.
4.note down the ouput.

RESULT:

INPUT: 3000- 02 OUTPUT: AX=B837 BP = B837


3001-FF DX=01CA SP=01CA
3002-EE

Viva questions:
1.Define Microprocessor?
2. What is the use of addressing modes?
3. Write the difference between 8085 and 8086.
4. What is INT0 instruction?
5.What is MOV,PUSH&POP instruction’s?
2. ARITHMETIC MEAN OF ‘N’ NUMBERS & PACKED BCD TO UNPACKED
BCD

Aim: Write a program to find the arithmetic mean of ‘n’ numbers.

Apparatus: 8086 trainer kit

Address Code Label Mnemonic Operand


6000 B8 MOV AX,0000
6001 00
6002 00
6003 BB MOV BX,0000
6004 00
6005 00
6006 B9 MOV CX,0000
6007 00
6008 00
6009 BA MOV DX,0000
600A 00
600B 00
600C BE MOV SI,4000
600D 00
600E 40
600F 8A MOV CL,[SI]
6010 0C
6011 8A MOV BL,CL
6012 D9
6013 46 LP INC SI
6014 8A MOV AL,[SI]
6015 04
6016 03 ADD DX,AX
6017 D0
6018 73 JNC NEXT
6019 01
601A 42 INC DX
601B FE NEXT DEC CL
601C C9
601D 75 JNZ LP
601E F4
601F 8B MOV AX,DX
6020 C2
6021 F6 DIV BL
6022 F3
6023 CC INT 03
Procedure :
1.Enter the program in 8086 micro processors kit in .A mode at ------- location.
2.Enter the input in .S mode at ------ location.
3.Execute the program using .G enter, after that give program starting address.
4.note down the ouput.

RESULT: The arithmetic mean of N numbers is obtain.

INPUT: 4000-10
4001-01
4002-02
4003-03
4004-04
4005-05
4006-06
4007-07
4008-08
4009-09
400A-0A
400B-0B
400C-0C
400D-0D
400E-0E
400F-0F
4010-10

OUTPUT: AX= 0808 DX=0808 BX=0010 CX=0000


Aim: Write a program to convert packed BCD number to UNPACKED BCD number.

Apparatus: Computer with TASM

DATA SEGMENT
BCD DB 35H
UNBCD DB ‘00’
DATA ENDS

CODE SEGMENT
ASSUME CS:CODE,DS:DATA

START: MOV AX,DATA


MOV DS,AX
LEA SI,BCD
LEA DI,UNBCD
MOV AL,[SI]
MOV AH,00
MOV CL,04
SHL AX,CL
ROL AL,CL
MOV [DI],AH
INC DI
MOV [DI],AL
MOV AH,4CH
INT 21H
CODE ENDS
END START
Procedure:
1.Enter the program in Computer and save as file name.asm
2.for Execution, Press alt F, then quit. Then type
(a) TASM file name.asm, press enter
(b) TLINK file name.obj, press enter
(c) TD file name.exe,enter
3.After that directly press F9 for the results.
4.Note down the results.

Viva questions:
1. What is MASM?
2. What is the purpose of ASSUME directive?
3. What is the use of DS and ES registers of 8086.
4. What are the Arithmetic instructions?
5. What is CMP instruction What it performs?
3.LENGTH OF STRING, MOVING OF STRING ONE LOCATION TO
ANOTHER LOCATION, COMPARISION OF STRING

Aim: To find out the length of the given string.

Apparatus: Computer with TASM.

DATA SEGMENT
STR1 DB "THE KING","$"
DATA ENDS

CODE SEGMENT
ASSUME CS:CODE, DS:DATA

START: MOV AX,DATA


MOV DS,AX
MOV CL,00H
LEA SI,STR1

LOOP1: CMP [SI],24H


JE LABEL1
INC CL
INC SI
JMP LOOP1

LABEL1: INT 03H

CODE ENDS
END START
Procedure:
1.Enter the program in Computer and save as file name.asm
2.for Execution, Press alt F, then quit. Then type
(i) TASM file name.asm, press enter
(ii) TLINK file name.obj, press enter
(iii) TD file name.exe,enter
3.After that directly press F9 for the results.
4.Note down the results.
Aim: To move the string from one location to another location.

Apparatus: Computer with TASM

DATA SEGMENT
STR1 DB "RVRJC"
STR2 DB 05 DUP(0)
COUNT EQU 05
DATA ENDS

CODE SEGMENT
ASSUME CS:CODE, DS:DATA

START: MOV AX,DATA


MOV DS,AX
LEA SI,STR1
LEA DI,STR2
MOV CX,COUNT
CLD
LP1: MOV AL,[SI]
MOV [DI],AL
INC SI
INC DI
LOOP LP1
INT 03H
CODE ENDS
END START

Procedure:
1.Enter the program in Computer and save as file name.asm
2.for Execution, Press alt F, then quit. Then type
(i) TASM file name.asm, press enter
(ii) TLINK file name.obj, press enter
(iii) TD file name.exe,enter
3.After that directly press F9 for the results.
4.Note down the results.
Aim: To perform the comparison of two strings.

Apparatus: Computer with TASM

DATA SEGMENT
NAME1 DB "ASSEMBLERS"
NAME2 DB "ASSEMBLERS"
DATA ENDS

CODE SEGMENT
ASSUME CS:CODE,DS:DATA

START: MOV AX,DATA


MOV DS,AX
MOV BH,00
CLD
MOV CX,0AH
LEA SI,NAME1
LEA DI,NAME2

LP1: MOV AL,[SI]


CMP AL,[DI]
JNE LP
INC SI
INC DI
LOOP LP1
MOV BH,01

LP: INT 03
CODE ENDS
END START
Procedure:
1.Enter the program in Computer and save as file name.asm
2.for Execution, Press alt F, then quit. Then type
(i) TASM file name.asm, press enter
(ii) TLINK file name.obj, press enter
(iii) TD file name.exe,enter
3.After that directly press F9 for the results.
4.Note down the results.

Viva questions:
1. How do you calculate physical address in 8086?
2. List the string instructions 0f 8086?
3. Why memory segmentation required in 8086 micro processor?
4. Write the machine code of MOV AX,BX.
5. What is LOOP instruction?
4. ADDITION OF TWO NUMBERS USING PROCEDURES

Aim: To find out The addition of two numbers using procedures.

Apparatus: Computer with TASM.


FAR PROCEDURE
EXTRN SUM: FAR
DATA SEGMENT
A DB 02H
B DB 03H
C DB 00H
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE. DS:DATA
START: MOV AX,DATA
MOV DS,AX
MOV AL,A
MOV BL,B
CALL SUM
MOV C,AL
INT 03H
CODE ENDS
END START
SACET SEGMENT
ASSUME CS:SACET
PUBLIC SUM
SUM PROC FAR
ADD AL,BL
RET
SUM ENDP
SACET ENDS
END
NEAR PROCEDURE

DATA SEGMENT
A DB 09H
B DB 06H
C DB 00H
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA
START: MOV AX,DATA
MOV DS,AX
MOV AL,A
MOV BL,B
CALL SUM
SUM PROC NEAR
ADD AL,BL
MOV C,AL
SUM ENDP
INT 03H
CODE ENDS
END START

Procedure:
NEAR PROCEDURE
1.Enter the program in Computer and save as file name.asm
2.for Execution, Press alt F, then quit. Then type
(i)TASM file name.asm, press enter
(ii) TLINKfile name.obj, press enter
(iii) TD file name.exe,enter
3.After that directly press F9 for the results.
4.Note down the results.
Procedure:
FAR PROCEDURE

1.Enter the program in Computer in two separate files and save as file name1.asm
and file name2.asm
2.for Execution, Press alt F, then quit. Then type
(i) TASM file name1.asm, press enter
TASM filename2.asm press enter
(ii) TLINK file name1+file name2.obj, press enter
(iii) TD file name1.exe,enter
3.After that directly press F9 for the results.
4.Note down the results

Viva questions:
1. What is the difference between procedure and macro?
2. What is the difference between CALL and INT instruction?
3. What will be the context of stack pointer (SP) after a PUSH operation andafter a POP
operation?
4. What is the difference between near and far procedures.
5. What are the different types of call instruction used in this procedure?
5.SORTING OF NUMBERS IN ASENDING & DECENCING ORDER

Aim: Write a program to sort the ‘n’ numbers in ascending order

Apparatus: 8086 trainer kit


Address Code Label Mnemonic Operand
6000 BF MOV DI,4000
6001 00
6002 40
6003 8A MOV CL,[DI]
6004 0D
6005 FE DEC CL
6006 C9
6007 47 INC DI
6008 8A AGAIN MOV BL,CL
6009 D9
600A 8B MOV SI,DI
600B F7
600C 8B MOV BP,DI
600D EF
600E 8A NEXT MOV AL,[SI]
600F 04
6010 45 INC BP
6011 3A CMP AL,[BP]
6012 46
6013 00
6014 72 JC LP
6015 02
6016 8B MOV SI,BP
6017 F5
6018 FE LP DEC BL
6019 CB
601A 75 JNZ NEXT
601B F2
601C 8A MOV AL,[SI]
601D 04
601E 86 XCHG AL,[DI]
601F 05
6020 88 MOV [SI],AL
6021 04
6022 47 INC DI
6023 FE DEC CL
6024 C9

6025 75 JNZ AGAIN


6026 E1
6027 CC INT 03

Procedure :
1.Enter the program in 8086 micro processors kit in .A mode at ------- location.
2.Enter the input in .S mode at ------ location.
3.Execute the program using .G enter, after that give program starting address.
4.note down the ouput. In .s mode at location ----.

RESULT:

INPUT: 4000-05
4001-67
4002-78
4003-34
4004-45
4005-80

OUTPUT: 4000-05
4001-34
4002-45
4003-67
4004-78
4005-80
Aim: Write a program to sort the ‘n’ numbers in descending order

Apparatus: 8086 trainer kit

Address Code Label Mnemonic Operand


6000 BF MOV DI,4000
6001 00
6002 40
6003 8A MOV CL,[DI]
6004 0D
6005 FE DEC CL
6006 C9
6007 47 INC DI
6008 8A AGAIN MOV BL,CL
6009 D9
600A 8B MOV SI,DI
600B F7
600C 8B MOV BP,DI
600D EF
600E 8A NEXT MOV AL,[SI]
600F 04
6010 45 INC BP
6011 3A CMP AL,[BP]
6012 46
6013 00
6014 73 JNC LP
6015 02
6016 8B MOV SI,BP
6017 F5
6018 FE LP DEC BL
6019 CB
601A 75 JNZ NEXT
601B F2
601C 8A MOV AL,[SI]
601D 04
601E 86 XCHG AL,[DI]
601F 05
6020 88 MOV [SI],AL
6021 04
6022 47 INC DI
6023 FE DEC CL
6024 C9
6025 75 JNZ AGAIN
6026 E1
6027 CC INT 03

Procedure :
1.Enter the program in 8086 micro processors kit in .A mode at ------- location.
2.Enter the input in .S mode at ------ location.
3.Execute the program using .G enter, after that give program starting address.
4.note down the ouput.in .s mode at location ------

RESULT:

INPUT: 4000-05
4001-67
4002-78
4003-34
4004-45
4005-80

OUTPUT: 4000-05
4001-80
4002-78
4003-67
4004-45
4005-34

Viva questions:
1. What is CLD instruction?
2. What is XCHG instruction?
3. What is the other instruction used for LEA instruction?
4. Write some of the conditional and unconditional JMP instruction’s?
5. What is the register used for count?
6 SEPERATION OF THE POSITIVE, NEGETIVE AND ZERO NUMBERS

Aim: To determine the number of positive, negative and zero numbers in a given array.

Apparatus: Computer with TASM

DATA SEGMENT
ARRAY DW 10H,20H,-05H,23H,00H,12H,-12H,-07H,20H
NP DB (?)
NN DB (?)
NZ DB (?)
DATA ENDS

CODE SEGMENT
ASSUME CS:CODE,DS:DATA

START: MOV AX,DATA


MOV DS,AX
MOV CL,0AH
MOV AX,00H
MOV BX,00H
MOV DX,00H
LEA SI,ARRAY

L1: CMP BX,[SI]


JZ L3
JL L2
INC AL
JMP END1

L2: INC AH
JMP END1

L3: INC DL

END1: ADD SI,02H


DEC CL
JNZ L1
MOV NP,AL
MOV NN,AH
MOV NZ,DL
INT 03
CODE ENDS
END START
Procedure:
1.Enter the program in Computer and save as file name.asm
2.for Execution, Press alt F, then quit. Then type
(i) file name.asm, press enter
(ii) file name.obj, press enter
(iii) file name.exe,enter
3.After that directly press F9 for the results.
4.Note down the results.

Viva questions:
1. Define Interrupt.
2. What are the priorities of various 8086 Interrupts?
3. What is an Interrupt vector table?
4. When interrupt is executed what about the stack pointer and trap flag?
5. What are the different types of interrupts.
7. KEYBOARD INTERFACING USING 8086 MICRO PROCESSOR

Aim: To interface the keyboard with 8086 micro processor.

Apparatus: 8086 Trainer kit, keyboard, 8255PPI.

ADDRESS OPCODE LABEL MNEMONIC COMMENTS


2000 B8 00 00 MOV AX,0000H
2003 8E C0 MOV ES,AX
2005 BA E6 FF MOV DX,0FFE6H ;Configure 8255
2008 B0 92 MOV AL,92 in mode 0
200A EE OUT DX,AL ;PortA as i/p
;Port C as o/p
200B EB 0F JMP START
200D 4B 45 59 20 50 MES:
52 DB ‘KEY
2013 45 53 53 45 44 PRESSED=’,0H
20
2019 3D 20 00
201C 9A 31 00 00 START: CALLS 0FE00:0031 ; new line
FE
2021 2E CS
2022 8D 16 0D 20 LEA DX, @MES
2026 8B C2 MOV AX,DX
2028 9A 13 00 00 CALLS 0FE00:0013 ;call for
FE displaying the
message
202D E8 05 00 CALL KSCAN
2030 E8 3D 00 CALL DELAY
2033 EB E7 JMP START
2035 B1 01 KSCAN: MOV CL,01
2037 8A C1 NEXT: MOV AL,CL ;make one of
scan lines high
2039 BA E4 FF MOV DX,0FFE4
203C EE OUT DX,AL
203D BA E0 FF MOV DX,0FFE0
2040 EC IN AL,DX
2041 8A E0 MOV AH,AL ;check for key
2043 0A 0C OR AL,AL ;pressed?
2045 75 0A JNZ KEYCODE ;if yes,detect
2047 D0 C1 CONT: ROL CL,1
2049 80 F9 08 CMP CL,08
204C 74 E7 JE KSCAN
204E E9 E6 FF JMP NEXT
2051 B3 00 KEYCODE: MOV BL,0H ;detect coloumn
2053 8A C4 MOV AL,AH
2055 D0 E8 SHIFT: SHR AL,1
2057 3C 00 CMP AL,00
2059 74 05 JZ ROW
205B FE C3 INC BL ;increment
coloumn
205D E9 F5 FF JMP SHIFT ;count and
repeat
2060 8A C1 ROW: MOV AL,CL ;detect rpw
2062 B1 02 MOV CL,02
2064 D2 C0 ROL AL,CL
2066 24 FB AND AL,0FB
2068 0A C3 OR AL,BL
206A 9A 52 00 00 CALLS 0FE00:0052
FE
206F C3 RET
2070 51 DELAY: PUCH CX
2071 B9 00 00 MOV CX,00 ; delay routine
2074 E2 FE DLY: LOOP DLY
2076 59 POP CX
2077 C3 RET
Procedure :
1.Enter the program in 8086 micro processors kit in .A mode at ------- location.
2.Enter the input in .S mode at ------ location.
3.Execute the program using .G enter, after that give program starting address.
4.note down the ouput.

Viva questions:
1. Explain any three assembler directives.
2. Explain the control word format of 8255
3. Explain about IN instruction.
4. Explain about OUT instruction.
5. What are the methods of interfacing I/o devices.
8. DUAL DAC INTERFACE USING 8086 MICRO PROCESSOR

Aim: To interface the dual digital to analog converter with 8086 micro processor.

Apparatus: 8086 Trainer kit, dual DAC kit, 8255PPI.

ADDRESS OPCODE LABEL MNEMONIC COMMENTS

2000 B8 00 00 MOV AX,0000H


2003 8E C8 MOV CS,AX
2005 8E C0 MOV ES,AX
2007 BA E6 FF MOV INITIALISE ALL
DX,0FFE6H 8255
200A B0 80 MOV AL,80H PORTS AS O/P
PORTS
200C EE OUT DX,AL
200D 9A ED 01 00 CALLS NEW LINE
FE 0FE00:01EDH ROUTINE
2012 EB 3B JMP START DISPLAY
MESSAGE
2014 0A 0D 44 55 MES: DB 0AH, 0DH DUAL DAC
41 4C INTERFACE
201A 20 44 41 43
20 49
2020 4E 54 45 52
46 41
2026 43 45 20
2029 0A OD 53 20 DB 0AH, 0DH ‘S-SQUARE
2D 20 WAVE’
202F 53 51 55 41
52 45
2035 20 57 41 56
45
203A 0A 0D 54 20 DB 0AH, 0DH ‘T-TRIANGULAR
2D 20 WAVE’
2040 54 52 49 41
47 4C
2046 55 41 52 20
57 41
204C 56 45 00
204F 2E START: CS
2050 8D 16 14 20 LEA DX,MES DISPLAY
MESSAGE ON
2054 8B C2 MOV AX,DX OR CONSOLE
2056 9A 13 00 00 CALLS
FE 0FE00:0013H
205B 9A A9 00 00 GETKEY: CALLS WAIT FOR USER
FE 0FE00:00A9H ENTRY
2060 3C 53 CMP AL,53H IF S,JUMP TO
SQUARE
2062 74 2F JE SQUARE WAVE ROUTINE
IF T
2064 3C 54 CMP AL,54H JUMP TO
TRIANGLE
2066 74 02 JE TRIANGLE WAVE ROUTINE
2068 EB F1 JMP GETKEY WAIT FOR
VALID KEY
TRIANGULAR WAVE GENERATION ROUTINE
206A 9A 31 00 00 TRIANGLE CALLS 0FE00:
FE 0031H
206F B9 FF 00 RPT1: MOV CX,0FFH SET COUNT
2072 B0 00 MOV AL,00H START FROM 0
2074 FE C0 UP: INC AL INCREMENT
DAT FOR
2076 BA E0 FF MOV +IVE GOING
DX,0FFE0H SLOPE&
2079 EE OUT DX,AL OUT PUT AT
PORT A&B
207A BA E2 FF MOV
DX,0FFE2H
207D EE OUT DX,AL
207E E2 F4 LOOP UP
2080 B9 FF 00 MOV CX,0FFH SET COUNT
2083 8B C1 MOV AX,CX START FROM
FFH
2085 FE C8 DOWN: DEC AL DECREMENT
DATA FOR
2087 BA E0 FF MOV -IVE GOING
DX,0FFE0H SLOPE AT
208A EE OUT DX,AL PORT A&B
208B BA E2 FF MOV
DX,0FFE2H
208E EE OUT DX,AL
208F E2 F4 LOOP DOWN
2091 EB DC JMP SHORT RPT1 REPEAT
CONTINUOUSLY
SQUARE WAVE GENERATION ROUTINE
2093 9A 31 00 00 SQUARE: CALLS
FE 0FE00:0031H
2098 B0 FF RPT2 MOV AL,0FFH O/P FFH AT
PORTS
209A BA E0 FF MOV
DX,0FFE0H
209D EE OUT DX,AL
209E BA E2 FF MOV
DX,0FFE2H
20A1 EE OUT DX,AL
20A2 B9 FF 00 MOV CX,FFH DELAY
20A5 E2 FE DLY1: LOOP DLY1
20A7 B0 00 MOV AL,00H O/P 0 AT PORTS
20A9 BA E0 FF MOV DX,0FFE0H
20AC EE OUT DX,AL
20AD BA E2 FF MOV
DX,0FFE2H
20B0 EE OUT DX,AL
20B1 B9 FF 00 MOV CX,FFH
20B4 E2 FE DLY2: LOOP DLY2 DELAY
20B6 EB E0 JMP SHORT REPEAT
RPT2 CONTINUOUSLY
Procedure :
1.Enter the program in 8086 micro processors kit in .A mode at ------- location.
2.Enter the input in .S mode at ------ location.
3.Execute the program using .G enter, after that give program starting address.
4.note down the ouput.

Viva questions:
1. Define the term resolution w.r.t to D/A converters.
2. Mention different types of A/D converters.
3. What is interfacing?
4. Explain about the i/o mapped interfacing.
5. What is the use of MRDC and MRTC signals.
9. STEPPER MOTOR INTERFACE USING 8086 MICRO PROCESSOR

Aim: To interface the stepper motor with 8086 micro processor.

Apparatus: 8086 Trainer kit, stepper motor interfacing kit, 8255PPI.

ADDRESS OPCODE LABEL MNEMONIC COMMENTS


2000 B8 00 00 MOV INITIALISE
AX,0000H SEGMENT
2003 8E C0 MOV ES,AX REGISTERS
2005 BA E6 FF MOV INITIALISE
DX,0FFE6H
2008 B0 80 MOV AL,80H ALL PORTS AS
O/P
200A EE OUT DX,AL
200B 9A ED 01 CALLS
00 FE 0FE00:01ED
2010 EB 33 JMP SHORT
START
DISPLAY MESSAGE STRING
2012 0A 0D 45 MES1: DB 0AH,0DH ENTER
4E 54 45 DIRECTION
2018 52 20 44 49
52 45
201E 43 54 49 4F
4E
2023 0A 0D 41 DB 0AH,0DH A-
2D 41 4E ANTICLOCKWISE
B-
CLOCKWISE,00H
2029 54 49 43 4C
4F 43
202F 4B 57 49 53
45 20
2035 20 20 20 20
43 2D
203B 43 4C 4F 43
4B 57
2041 49 53 45 00
2045 2E START: CS
2046 8D 16 12 20 LEA DISPLAY
DX,MES1 MESSAGE
204A 8B C2 MOV AX,DX ON LCD OR
CONSOLE
204C 9A 13 00 00 CALLS
FE 0FE00:0013H

2051 9A A9 00 GET: CALLS WAIT FOR USER


00 FE 0FE00:00A9H ENTRY
2056 3C 41 CMP AL,41H IF KEY=’A’
2058 74 11 JE ANTI ROTATE ANTI
CLOCK WISE
205A 3C 43 CMP AL,43H IF KEY=’C’
205C 74 02 JE CLO ROTATE CLOCK
WISE
205E EB F1 JMP SHORT ACCEPT VALID
GET KEY ONLY
ROUTINE FOR CLOCK WISE ROTATION OF MOTOR
2060 EB 13 00 CLO: CALL
COMMON
2063 EE R1: OUT DX,AL
2064 E8 1F 00 CALL DELAY INTRODUCE
DELAY
2067 D0 D8 RCR AL,1 ROTATE BITS IN
2069 EB F8 JMP SHORT DATA BYTE
R1 RIGHT & REPEAT
ROUTINE FOR ANTI CLOCKWISE ROTATION OF MOTOR
206B E8 08 00 ANTI: CALL
COMMON
206E EE R2: OUT DX,AL
206F E8 14 00 CALL DELAY
2072 D0 D0 RCL AL,1 ROTATE BITS
2074 EB F8 JMP SHORT LEFT& REPEAT
R2
2076 9A 31 00 00 COMMON: CALLS
FE 0FE00:0031H
207B 9A 00 00 00 CALLS
FE 0FE00:00H
2080 B0 11 MOV AL,11H OUTPUT VALUE
2082 BA E0 FF MOV TO PORT A
DX,0FFE0H
2085 C3 RET
2086 B9 00 08 DELAY: MOV DELAY ROUTINE
CX,8OOH
2089 E2 FE SS: LOOP SS
208B C3 RET
Procedure :
1.Enter the program in 8086 micro processors kit in .A mode at ------- location.
2.Enter the input in .S mode at ------ location.
3.Execute the program using .G enter, after that give program starting address.
4.note down the ouput.

Viva questions:
1. Explain the steps in interfacing an i/o device.
2. What is the use of RESET pin in case of interfacing.
3. In 8255 what is the another name for mode1.
4. Explain the salient features of mode 2 of 8255.
5. what is IBF.
10. MULTIPLICATION OF TWO NUMBERS USING 8051 MICRO
CONTROLLER

Aim: To perform the multiplication of two numbers using 8051 micro processor.
Apparatus: 8051 Micro controller trainer.

ADDRESS OPCODE LABEL MNEMONIC OPERAND COMMENTS


8000 90 90 01 MOV DPTR, #9001 ;Keep data in
8003 E0 MOVX A,@DPTR 9000h and
8004 F5 F0 MOV 0F0,A 9001h data
8006 90 90 00 MOV DPTR,#9000 memory
8009 E0 MOVX A,@DPTR location
800A A4 MUL AB Multiplication
operation
800B 90 90 02 MOV DPTR,#9002 Store the
800E F0 MOVX @DPTR,A result in
800F A3 INC DPTR 9002h and
8010 E5 F0 MOV A,0F0 9003h of data
8012 F0 MOVX @DPTR,A memory.
8013 02 00 00 LJMP 0
Procedure :
1.Enter the program in 8086 micro processors kit in >A mode at ------- location.
2.Enter the input in MD mode at ------ location.
3.Execute the program using >G enter, after that give program starting address.
4.note down the ouput.

Result:
9000 – 02
9001 – 03
9002 – 00
9003 – 06

Viva questions:
1. What are the interrupts of 8051 micro controller.
2. Explain the Programme status word of 8051 micro controller.
3. What is the use of B register in 8051 micro controller.
4. What is DPTR in 8051 micro controller.
5. Explain the addressing modes in 8051 micro controller.
Procedure for Kit:
1.Enter the program in 8086 micro processors kit in .A mode at ------- location.
2.Enter the input in .S(MD or MP for micro controller) mode at ------ location.
3.Execute the program using .G enter, after that give program starting address.
4.note down the ouput.

Result:

Procedure for System:


1.Enter the program in Computer and save as file name.asm
2.for Execution, Press alt F, then quit. Then type
a. file name.asm, press enter
b. file name.obj, press enter
c. file name.exe,enter
3.After that directly press F9 for the results.
4.Note down the results.

You might also like