digitsl computer platforms lab
digitsl computer platforms lab
Name:_____________________________________________
H.T.No:____________________________________________
Year/Semester:______________________________________
PEO 1: To prepare the graduates to be able to plan, analyze and provide innovative ideas to
investigate complex engineering problems of industry in the field of Electronics and
Communication Engineering using contemporary design and simulation tools.
PEO-2: To provide students with solid fundamentals in core and multidisciplinary domain for
successful implementation of engineering products and also to pursue higher studies.
PEO-3: To inculcate learners with professional and ethical attitude, effective communication
skills, teamwork skills, and an ability to relate engineering issues to broader social context at
work place
Programme Outcomes(Pos)
CO Description BL
CO1 Write and Execute different programs 8086, 8051 & ARM Cortex M0 assembly level
02
languages using MASAM assembler.
CO2 Design and implement some specific real time applications 04
PART A:
LIST OF PROGRAMS USING MASAM/ALP:
1. Programs for 16 bit arithmetic operations for 8086 (using various addressing modes) .
2. Program for sorting an array for 8086.
3. Program for searching for a number or character in a string for 8086.
4. Program for String manipulations for 8086 .
PART A:
LIST OF PROGRAMS USING MASAM/ALP:
1.Programs for 16 bit arithmetic operations for 8086 (using various addressing modes) .
2.Program for sorting an array for 8086.
3.Program for searching for a number or character in a string for 8086.
4.Program for String manipulations for 8086 .
PART-B
1 Interfacing ADC and DAC to 8086
Parallel communication between two microprocessors using 8255.
2
DO’s
PART-I
A) ADDITION:
i) 16 BIT ADDITION (DIRECT ADDERESSING MODE):
AIM: - To write an assembly language program for Addition of two 16-bit numbers.
PROGRAM:
INPUT:
OUTPUT:
AIM: - To write an assembly language program for Addition of two 16-bit numbers.
PROGRAM:
ASSUME CS:CODE
CODE SEGMENT
START:
MOV BX,5678H
ADD AX,1234H
INT 03H
CODE ENDS
END START
OPCODE:
INPUT:
OUTPUT:
PROGRAM:
ASSUME CS:CODE,DS:DATADATA
SEGMENT
NUM DW 02H
DATA ENDS
CODE SEGMENT
START:
MOV AX,DATA
MOV DS,AX
MOV AX,4444H
MOV BX,OFFSET NUM
ADD AX,[BX]
INT 03H
CODE ENDS
END START
OPCODE:
INPUT:
OUTPUT:
VEMU Institute of Technology, Dept of E.C. E. Page 4
DIGITAL COMPUTER PLATFORMS LAB III B.Tech II SEMISTER
AIM: - To write an assembly language program for Addition of two 16-bit numbers.
CODE SEGMENT
START:
MOV BX,5678H
MOV AX,1234H
ADD AX,BX
INT 03H
CODE ENDS
END START
OPCODE:
INPUT:
OUTPUT:
B) SUBTRACTION:
i) 16 BIT SUBTRACTION (DIRECT ADDRESSING MODE):
AIM: - To write an assembly language program for subtraction of two 16-bitnumbers.
PROGRAM:
ASSUME CS:CODE,DS:DATA
DATA SEGMENT
NUM DW 1232H
DATA ENDS
CODE SEGMENT
START:
MOV AX,DATA
MOV DS,AX
MOV AX,4562H
SUB AX,NUM
INT 03H
CODE ENDS
END START
OPCODE:
INPUT:
OUTPUT:
AIM: - To write an assembly language program for subtraction of two 16-bit numbers.
PROGRAM:
ASSUME CS:CODE
CODE SEGMENT
START:
MOV AX,5678H
SUB AX,1234H
INT 03H
CODE ENDS
END START
OPCODE:
INPUT:
OUTPUT:
PROGRAM:
ASSUME CS:CODE,DS:DATA
DATA SEGMENT
NUM DW 02H
DATA ENDS
CODE SEGMENT
START:
MOV AX,DATA
MOV DS,AX
MOV AX,4444H
SUB AX,[BX]
INT 03H
CODE ENDS
END START
OPCODE:
INPUT:
OUTPUT:
AIM: - To write an assembly language program for subtraction of two 16-bit numbers.
PROGRAM:
ASSUME CS:CODE
CODE SEGMENT
START:
MOV BX,5678H
MOV AX,1234H
SUB AX,BX
INT 03H
CODE ENDS
END START
OPCODE:
MEMORY OP-CODE LABEL INSTRUCTION
LOCATION
INPUT:
OUTPUT:
C) MULTIPLICATION:
PROGRAM:
ASSUME CS:CODE,DS:DATA
DATA SEGMENT
X DB 02H
DATA ENDS
CODE SEGMENT
START:
MOV AX,DATA
MOV DS,AX
MOV AX,0002H
MUL X
INT 03H
CODE ENDS
END START
OPCODE:
INPUT:
OUTPUT:
C) MULTIPLICATION:
PROGRAM:
ASSUME CS:CODE
CODE SEGMENT
START:
MOV BX,1234H
MOV AX,1234H
MUL BX
INT 03H
CODE ENDS
END START
OPCODE:
INPUT:
OUTPUT:
D) DIVISION:
PROGRAM:
ASSUME CS:CODE,DS:DATA
DATA SEGMENT
NUM DW 02H
DATA ENDS
CODE SEGMENT
START:
MOV AX,DATA
MOV DS,AX
MOV AX,4444H
DIV NUM
INT 03H
CODE ENDS
END START
OPCODE:
INPUT:
OUTPUT:
D) DIVISION:
PROGRAM:
ASSUME CS:CODE
CODE SEGMENT
START:
MOV BX,0022H
MOV AX,4444H
DIV BX
INT 03H
CODE ENDS
END START
OPCODE:
MEMORY OP-CODE LABEL INSTRUCTION
LOCATION
INPUT:
OUTPUT:
RESULT:
Viva Question:
1) What is meant by microprocessor?
A) ASCENDING ORDER
PROGRAM:
ASSUME CS:CODE,DS:DATA
DATA SEGMENT
LIST DW 55H,67H,23H,45H
DATA ENDS
CODE SEGMENT
START:
MOV AX,DATA
MOV DS,AX
MOV DX,COUNT-1
L1:MOV CX,DX
L2:MOV AX,[SI]
CMP AX,[SI+2]
JL L3
XCHG [SI+2],AX
XCHG [SI],AX
L3:ADD SI,02
LOOP L2
DEC DX
JNZ L1
INT 03H
CODE ENDS
END START
OPCODE:
MEMORY OP-CODE LABEL INSTRUCTION
LOCATION
INPUT:
OUTPUT:
B) DECENDING ORDER
PROGRAM:
ASSUME CS:CODE,DS:DATA
DATA SEGMENT
LIST DW 55H,67H,23H,45H
DATA ENDS
CODE SEGMENT
START:
MOV AX,DATA
MOV DS,AX
MOV DX,COUNT-1
L1:MOV CX,DX
L2:MOV AX,[SI]
CMP AX,[SI+2]
JA L3
XCHG [SI+2],AX
XCHG [SI],AX
L3:ADD SI,02
LOOP L2
DEC DX
JNZ L1
INT 03H
CODE ENDS
END START
OPCODE:
MEMORY OP-CODE LABEL INSTRUCTION
LOCATION
INPUT:
OUTPUT:
RESULT:
Viva Questions:
1) What is the use of SI Register?
5)State the logic behind the Sorting an array of data in Descending order
OPCODE:(CASE:EQUAL)
INPUT:
OUTPUT:
OPCODE(CASE:NOT EQUAL)
INPUT:
OUTPUT:
B)SERCHING A CHARACTER
AIM: Write an alp program for to search a number or character from a string.
DATA SEGMENT
CHAR2 DB "Z"
ENDS
CODE SEGMENT
START:
MOV AX,DATA
LEA DI,[STG+0AH]
MOV AL,CHAR1
MOV CX,28
REPNZ SCASBJZ
FOUND LEA
FOUND:LEA DX,M1
21H
MOV AH,4CH
INT 21H
CODE ENDS
END START
OPCODE:
MEMORY OP-CODE LABEL INSTRUCTION
LOCATION
INPUT:
OUTPUT:
RESULT:
Viva Questions:
1) What is the use of SCASB Register?
AIM: To write an alp for transfer block of data from one memory location to another
memory location.
PROGRAM:
ASSUME CS:CODE,DS:DATA,ES:EXTRADATA
SEGMENT
STG1 DB "ELECTRONICS"
DATA ENDS
EXTRA SEGMENT
STG2 DB 11 DUP(?)
SEGMENT START:
MOV AX,DATA
AX,EXTRAMOV
ES,AX CLD
LEA SI,STG1
LEA DI,STG2
MOV CX,11
REP MOVSB
INT 03H
CODE ENDS
END START
OPCODE:
MEMORY OP-CODE LABEL INSTRUCTION
LOCATION
INPUT:
OUTPUT:
B) INSERT A STRING
PROGRAM
ASSUME CS:CODE,DS:DATA,ES:DATADATA
SEGMENT
S1 DB "ANURAGLEGE"S2
DB "COL"
S3 DB 0DH DUP(?)
SEGMENT START:
MOV AX,DATA
MOV DS,AX
LEA SI,[S1+09H]
LEA DI,[S3+0CH]
MOVSB LEA
SI,[S2+2]
MOV CX,3
REP MOVSB
LEA SI,[S1+5]
MOV CX,6
REP MOVSB
INT 03H
CODE ENDS
END START
OPCODE:
INPUT:
OUTPUT:
C)REVERSING A STRING
PROGRAM
ASSUME CS: CODE, DS: DATA ,ES: DATA
DATA SEGMENT
S1 DB "KNOWLEDGE"S2
ENDS
CODE SEGMENT
START:
MOV AX,DATA
MOV DS,AX
SI,[S1] LEA
DI,[S2+8] MOV
CX,9
BACK:CLD
LODSB
STD STOSB
DEC CX
JNZ BACK
INT 03H
CODE ENDS
END START
OPCODE:
INPUT:
OUTPUT:
ASSUME CS:CODE,DS:DATA,ES:DATA
DATA SEGMENT
S1 DB "UNIVERSITY"S2
ENDS
CODE SEGMENT
START:
MOV AX,DATA
MOV DS,AX
DI,S2 MOV
CX,04HREP
MOVSB
LEA SI,[S1+7]
MOV CX,03H
REP MOVSB
INT 03H
CODE ENDS
END START
OPCODE:
INPUT:
OUTPUT:
C) STRING LENGTH
PROGRAM
ASSUME CS:CODE,ES:DATA
DATA SEGMENT
STG DB "ANURAG#"
CHAR DB "#"
ENDS CODE
SEGMENTSTART:
MOV AX,DATA
AL,CHARMOV
CX,14
REPNE SCASB
MOV LEN,DI
INT 03H
CODE ENDS
END START
INPUT:
OUTPUT:
D) STRING COMPARISION
CASE: STRINGS ARE EQUAL
SEGMENT
S1 DB "ELECTRONICS $" S2
DB "ELECTRONICS $" S3 DB
"COMPUTER $"
CODE SEGMENT
START:
MOV AX,DATA
MOV DS,AX
SI,S1
LEA DI,S2
MOV CX,11
CLD
REP CMPSB
JNZ ABC
LEA DX,MSG1
LAST:MOV AH,09H
AH,4CHINT 21H
ABC:LEA DX,MSG2
JMP LAST
CODE ENDS
END START
;COMPARE STRINGS
SEGMENT
S1 DB "ELECTRONICS $" S2
DB "ELECTRONICS $" S3 DB
"COMPUTER $"
DATA ENDS
CODE SEGMENT
START:
MOV AX,DATA
MOV DS,AX
SI,S1
LEA DI,S3
MOV CX,11
CLD
REP CMPSB
JNZ ABC
LEA DX,MSG1
LAST:MOV AH,09H
INT 21H
MOV AH,4CH
INT 21H
ABC:LEA DX,MSG2
JMP LAST
CODE ENDS
END START
OPCODE:
MEMORY OP-CODE LABEL INSTRUCTION
LOCATION
INPUT:
OUTPUT:
RESULT:
Viva Questions:
1) What are the string manipulation instructions?
5)What is the relation between 8086 processor frequency & crystal Frequency
EXP.NO.:5 DATE:
INTERFACING ADC AND DAC TO 8086.
(A)PROGRAM FOR ANALOG TO DIGITAL CONVERTOR
AIM:
1. To write a program for conversion of analog data to digital output.
2. To write a program for conversion of digital data to analog output. The analog output
will be in the form of triangular wave, saw tooth wave, square wave/rectangular wave.
APPARATUS:
1. 8086 Trainer.
2. Power supply for trainer and interface module.
3. A/D, D/A interface module.
4. Power mate connector.
5. FRC connector.
6. Cathode ray oscilloscope.
PROGRAM:
ADC SEGMENT
ASSUME CS:ADC
ORG 100H
START:
MOV AX,0000H
MOV ES,AX
MOV SS,AX
MOV SP,AX
POP DS
AL,81H ;C(upper) as OP
MOV DX,PORTB
MOV AL,00H
OUT DX,AL
MOV DX,CR55
INT 0ACH
DX,AL
MOV AL,0CH
DX, PORTC
JNZ BACK
OUT DX, AL
AL, DX
MOV CL, AL
NOP
MOV DH,00H
INT 0AEH
MOV AH,0BH
AL,0FFH
ADC ENDS
END START
OPCODE:
INPUT:
OUTPUT:
PROGRAM:
CODE SEGMENT
START:
8000H
INC AL
JMP UP
RET
CODE ENDS
END START
OPCODE:
INPUT:
OUTPUT:
RESULT:
Viva Questions:
EXP.NO.:6 DATE:
PARALLEL COMMUNICATION BETWEEN TWOMICROPROCESSORS
USING 8255.
AIM: To write an alp for parallel communication between two microprocessors by using 8255.
PROCEDURE:
1) Connect 8255 card (Periware – 3) to your kit through 50 pin FRC.
2)Connect port A tags to GND, and Vcc through patch cords,
3)Make S1 towards you to enable Single Stepping.
4)Connect PC4 tag with patch cord to Vcc.
5)Connect PC3 tag to RST 5.5 tag through patch cord.
6)L18 (on MB) position should be 2-3 short & L3 on converter card position should be 1-2.
7)Enter the software code as given in list 3(A).
8)Execute the program by pressing G, CR, CR, SR_SEGM 145E, CR, ADDR 0100, CR &
observe
PROGRAM:
011E ISR055:
0124 BB 0140 R MOV BX,OFFSET MSG ;LXI H,00H 43H, Pointer for
;look up table.
;routine.
012B B9 00FF LOOP: MOV CX,00FFH ;LXI D,FFH FFH, Wait to stabilise
the display.
0130 26: A0 1000 MOV AL,ES:[1000H] ;Retrive port A received data for
;display purpose.
END STRT
OUTPUT:
Data CS RD WR A0 A1 Comments
Bus
port A - input.
Viva Questions:
1.Expand USART?
5. What is MODEM
EXP.NO.:7 DATE:
INTERFACING TO 8086 AND PROGRAMMING TOCONTROL STEPPER MOTOR
AIM: Write an Assembly Language Program to rotate the Stepper Motor in clockwise as wellas
anti-clockwise direction.
CODE SEGMENT
MOV AL,80H
OUT DX,AL
MOV DX,8000H
MOV AL,88H
BACK:OUT DX,AL
CALL DELAY
ROR AL,01H
JMP BACK
DELAY:MOV CX,0FFFH
L1:DEC CX
JNZ L1
RET
CODE ENDS
END START
CODE SEGMENT
START:
MOV DX,8006H
MOV AL,80H
OUT DX,AL
MOV DX,8000H
MOV AL,88H
BACK:OUT DX,AL
CALL DELAY
ROL AL,01H
L1:DEC CX
JNZ L1
RET
CODE ENDS
END START
OPCODE:
INPUT:
OUTPUT:
RESULT:
Viva Questions:
1) What is the difference between min mode and max mode of 8086?
AIM: To write an Assembly Language Program to perform Multibyte addition using 8051.
APPARATUS:
8051 Microcontroller kit
Keyboard
Power supply
ALGORITHM:
1 Start the program.
2 Assign the address 4200 to Data pointer & load the contents.
3 Move the content 00h into R3 register.
4 Move the contents of external data memory into A register.
5 Move the content of A register into R0.
6 Increment the content of data pointer.
7 Move the contents of external data memory into A register.
8 Perform addition operation with the content of A register to R0 content
and result is stored in A register.
9 Move the content of A register to R1 register.
10 Clear the content of A register.
11 Increment the content of data pointer.
12 Move the contents of external data memory into A register.
13 Move the contents of A register into R0 register.
14 Increment the content of data pointer.
15 Move the contents of external data memory into A register.
16 Perform addition operation with carry the content of A register to R0
content and result is stored in A register.
17 Jump if no carry to label loop
18 Increment R3 register.
19 Move the contents of A into R2 register.
20 Move the contents of R1 into A register.
21 Increment the content of data pointer.
VEMU Institute of Technology, Dept of E.C. E. Page 58
DIGITAL COMPUTER PLATFORMS LAB III B.Tech II SEMISTER
RESULT:
INPUT:
OUTPUT:
AIM: To write an Assembly Language Program to perform Multibyte subtraction using 8051.
APPARATUS:
8051 Microcontroller kit
Keyboard
Power supply
ALGORITHM:
1 Start the program.
2 Assign the address 4200 to Data pointer & load the contents.
3 Move the content 00h into R3 register.
4 Move the contents of external data memory into A register.
5 Move the content of A register into R0.
6 Increment the content of data pointer.
7 Move the contents of external data memory into A register.
8 Perform subtraction operation with borrow the content of A register to
R0 content and result is stored in A register.
9 Move the content of A register to R1 register.
10 Clear the content of A register.
11 Increment the content of data pointer.
12 Move the contents of external data memory into A register.
13 Move the contents of A register into R0 register.
14 Increment the content of data pointer.
15 Move the contents of external data memory into A register.
16 Perform subtraction operation with borrow the content of A register to R0
content and result is stored in A register.
17 Jump if no borrow to label loop
18 Increment R3 register.
19 Move the contents of A into R2 register.
20 Move the contents of R1 into A register.
21 Increment the content of data pointer.
VEMU Institute of Technology, Dept of E.C. E. Page 61
DIGITAL COMPUTER PLATFORMS LAB III B.Tech II SEMISTER
RESULT:
INPUT:
OUTPUT:
AIM: To write an Assembly Language Program to perform Multibyte multiplication using 8051.
APPARATUS:
8051 Microcontroller kit
Keyboard
Power supply
ALGORITHM:
1 Start the program.
2 Assign the address 4000 to Data pointer & load the contents.
3 Move the contents of external data memory into A register.
4 Move the content of A register into B register.
5 Increment the content of data pointer.
6 Move the contents of external data memory into A register.
7 Perform multiplication operation with the content of A register with B
register.
8 Assign the address 4200 to destination Data pointer.
9 Move the contents of A register into external data memory.
10 Increment the content of data pointer.
11 Move the contents of B into A register.
12 Move the contents of A register into external data memory.
13 Stop the program.
PROGRAM:
ADDRES OPCOD LABE
S E L MNEMONICS OPERANDS COMMENTS
MOV DPTR, #4000
MOVX A,@DPTR
MOV 0F0,A
INC DPTR
MOVX A,@DPTR
MUL AB
MOV DPTR,#4200
INC DPTR
MOV A,0F0
MOVX @DPTR,A
HLT SJMP HLT
RESULT:
INPUT:
OUTPUT:
AIM: To write an Assembly Language Program to perform Multibyte division using 8051.
APPARATUS:
8051 Microcontroller kit
Keyboard
Power supply
ALGORITHM:
1 Start the program.
2 Assign the address 4000 to Data pointer & load the contents.
3 Move the contents of external data memory into A register.
4 Move the content of A register into B register.
5 Increment the content of data pointer.
6 Move the contents of external data memory into A register.
7 Perform division operation with the content of A register by B content.
8 Assign the address 4200 to destination Data pointer.
9 Move the contents of A register into external data memory.
10 Increment the content of data pointer.
11 Move the contents of B into A register.
12 Move the contents of A register into external data memory.
13 Stop the program.
PROGRAM:
ADDRES OPCOD LABE
S E L MNEMONICS OPERANDS COMMENTS
MOV DPTR, #4000
MOVX A,@DPTR
MOV 0F0,A
INC DPTR
MOVX A,@DPTR
DIV AB
MOV DPTR,#4200
INC DPTR
MOV A,0F0
MOVX @DPTR,A
HLT SJMP HLT
RESULT:
INPUT:
OUTPUT:
VIVA QUESTIONS:
1. Define Micro Controller.
JNB TF0,AGAIN
AGAIN: CLR TR0
CLR TE0
RET
INPUT:
OUTPUT:
RESULT:
1. What is the reset address of 8086?
3.Explain all. 3. What is the difference between 08H and 01H functions of INT 21H?
4. Which is faster- Reading word size data whose starting address is at even or at odd address of
memory in 8086?
EXP.NO.:10 DATE:
PROGRAM AND VERIFY INTERRUPT HANDLING IN8051.
1. AIM: To write an Assembly Language Program to generate an interrupt using 8259 Programmable
Interrupt Controller with 8086 Microprocessor.
2. APPARATUS:
3. PROGRAM:
ORG 2000H; Set PC value to 2000H
MOV AX, 0000H; Initialize Segment Registers
MOV CS, AX
MOV ES, AX
MOV SS, AX
MOV SP, 3000H; Initialize Stack Pointer
; Interrupt Vector Initialization
MOV SI, 0120H; INT 0 Vector address 0120H is the base of Interrupt Vector Table.
MOV AX, 2200H
MOV [SI], AX
ADD SI, 02H
MOV AX, 0000H
MOV [SI], AX
ADD SI, 02H; Interrupt 1 Vector Address
MOV AX, 2210H
MOV [SI], AX
ADD SI, 02H
MOV AX, 0000H
MOV [SI], AX
ADD SI, 02H; Interrupt 2 Vector Address
MOV AX, 2220H
MOV [SI], AX
ADD SI, 02H
MOV AX, 0000H
MOV [SI], AX
ADD SI, 02H; Interrupt 3 Vector Address
MOV AX, 2230H
MOV [SI], AX
ADD SI, 02H
MOV AX, 0000H
MOV [SI], AX
ADD SI, 02H; Interrupt 4 Vector Address
MOV AX, 2240H
MOV [SI], AX
ADD SI, 02H
MOV AX, 0000H
MOV [SI], AX
ADD SI, 02H; Interrupt 5 Vector Address
MOV AX, 2250H
MOV [SI], AX
ADD SI, 02H
MOV AX, 0000H
MOV [SI], AX
ADD SI, 02H; Interrupt 6 Vector Address
MOV AX, 2260H
MOV [SI], AX
ADD SI, 02H
MOV AX, 0000H
MOV [SI], AX
ADD SI, 02H; Interrupt 7 Vector Address
MOV AX, 220H
MOV [SI], AX
CLI
LEA DX, MSG7
JMP DISP
INT 03H
ORG 2300H; COMMON DISPLAY ROUTINE FOR ALL ISRs
DISP: MOV SI, DX
MOV CX, 11H
L1: MOV AL, [SI]
CALL FAR 0FE00:0000H; CALL ROUTINE TO DISPLAY THE MSGS
INC SI
LOOP L1
STI
IRET
4. PROCEDURE:
1. Open win 86E window and initialize PC address as 20000H
2. Enter the instruction until entire program is completed and click on the disassembly icon.
3. Provide the connections between 8086 and 8259 as follows
JP1=23 JP6=23
JP2=23 JP7=23
JP3=23 JP8=23
JP4=23 JP9=12
JP5=23 JP10=12
4. Go to command prompt and give G 2000H.
5. Specific interrupt can be selected by 4 ways DIP switch selection for different interrupts are as
follows:
3 2 1 4 Ways
0 0 0 IR0
0 0 1 IR1
0 1 0 IR2
0 1 1 IR3
1 0 0 IR4
1 0 1 IR5
1 1 0 IR6
1 1 1 IR7
6. While Program is running press the PUSH button on the 8259 kit to provide service for specific
interrupt service routine.
INPUT:
OUTPUT:
RESULT:
Viva Question:
1)How many no. of interrupts available for 8051?
APPARATUS:
2. Talk with PC
3. RPS
4. RS – 232
5. FRC cables
6. UART Module
PROGRAM FOR MODE-0-TRANSMITTER:-
Org 9000h
MOV SCON,#00H (SCOON=98)
UP1:MOV R7,#8H
MOV A,#80H(SBUF=99)
Up:CLRTi(Ti=99)
MOV SBUF,A
XX:JNBTi,XX
CLR P1.0
SETB P1.0
LCALL DELAY RR A
DJNZ R7,UP
JMP UP1
Delay: MOV R0,#0FFH
Up3:MOV R1,#0FFH
Up2:DJNZ R1,UP2
DJNZ R0,UP3
RET
ORG 9000h
MOV SCON,#11H (SCOON=98)
Up1:CLR P1.(P1.0=90)
VEMU Institute of Technology, Dept of E.C. E. Page 77
DIGITAL COMPUTER PLATFORMS LAB III B.Tech II SEMISTER
CLR P3.(P3.1=B1)
SETB ri(Ri=99)
SETB P1.0
CLR Ri(SBUF=99)
XX: JNB Ri,XX
MOV A,SBUF
MOV R6,A
LCALL DELAY
SJMP UP
RESULT:
VIVA QUESTION:
1.What is macros?
APPARATUS:
1.8051 trainer kit with keyboard
2.Key board module
3. RPS
4.FRC cables
5. RS-232 cable
PROGRAM:
Org 9000h
MOV A,#90H
MOV DPTR,#CNTRL
MOVX @DPTR,A
MOV B,#20H
Blink 2: MOV DPTR,#PORTB
MOV A,#FFH
MOVX @DPTR,A
MOVDPTR,#PORTC
MOV A,#00H
MOVX @DPTR,A
MOVA,#F0H
MOVX @DPTR,AD
JNZ B,BLNK2
Back: MOV A,#FEH
MOV B,#21H
Blink1: MOV DPTR,#PORTB
MOVX @DPTR,A
MOV DPTR,#PORTC
MOVA,#00H
MOVX@DPTR,A
MOVA,#F0H
MOVX @DPTR,AL
CALL DELAY
RL A
DJNZ B BLNK1
SJMP BACK
Delay: MOV R0,#F7H O
loop: MOVR1,#FFH I
loop: DJNZ R1,ILOOP
DJNZ R0,OLOOP
RET
INPUT:
OUTPUT:
RESULT:
Viva Question:
5. While accepting no. from user why u need to subtract 30 from that?
ADVANCED
EXPERIMENTS
AIM: To write an Assembly Language Program to interfacing peripheral interface with 8086
microprocessor such that port A and port B of 8255 will acts as output ports.
APPARATUS:
ESA 86E trainer kit
Power supply
8255 study pad
keyboard
Serial data bus
ALGORITHM:
1 Start the program.
2 Initialize 8255 as output.
3 Move input data to AL.
4 Output the data at port A.
5 Invert the input data.
6 Insert and output the data at port B.
7 Introduce delay and repeat.
8 Stop the program.
PROGRAM:
INSTRUCTION COMMENT
ADDRESS
OPCODE
MOV DX,0FFC6 Initialize 8255 point as output
MOV AL,80
OUT DX,AL
MOV AL,90
MOV AL,55
MOV DX,0FFC0 Output data at port A
NOT AL
MOV DX,0FFC2 Insert data and output the value
of port B
OUT DX,AL
JMP 2006 Introduce delay & repeat
RESULT:
INPUT:
OUTPUT:
VIVA QUESTIONS:
1. Define Interrupt.
3.Define DMA.
1.AIM: To write an Assembly Language Program to display string ESA in the display field of the
study card using 8279 keyboard and display controller decode method with 8051 microcontroller.
2. APPARATUS:
8051 Microcontroller
Power supply
8279 Keyboard and Display controller
3. ALGORITHM:
1 Start the program.
2 Initialize the starting address .
3 Divide the clock frequency.
4 Initialize 8279 interfacing unit.
5 Enter the data with right entry instruction perform the decode operation for data.
6 Scan the keyboard.
7 Introduce the reading table to the 8051to read the value from I/O devices.
8 Initialize the input data at 9000 location.
9 Stop the program.
4. PROGRAM:
TABL
E:
5. RESULT:
INPUT:
OUTPUT:
Viva Questions: