DATE: 27/03/2023 Program: Name: Ashwin Raj Registration Number: 21bec0400
DATE: 27/03/2023 Program: Name: Ashwin Raj Registration Number: 21bec0400
DATE: 27/03/2023 Program: Name: Ashwin Raj Registration Number: 21bec0400
DATE: 27/03/2023
QUESTION 1:
Add the contents of Registers R1,R2 and save the result in to R3.Use Step execution in keil, write down the contents of various flags of
ARM7
PROGRAM
AREA PROG_2_1, CODE, READONLY
ENTRY
MOV R1, #0X25 ;R1 = 0X25
MOV R2, #0X34 ;R2 = 0X34
ADD R3, R2,R1 ;R3 = R2 + R1
HERE B HERE ;STAY HERE FOREVER
END
SIMULATION RESULT
OBSERVATION
MOV command move data into register R1 and R2 and ADD command add data in R2 and R1 and store it in R3
1
NAME: ASHWIN RAJ
REGISTRATION NUMBER: 21BEC0400
DATE: 27/03/2023
QUESTION 2:
Perform Multiplication operations in ARM7
PROGRAM
AREA EXP2, CODE, READONLY
ENTRY
START MOV R0,#0XFFFFFFFF
MOV R1,#0X80000000
MULS R2,R0,R1
END
SIMULATION RESULT
OBSERVATION
MOV command move data in register R0 and R1. MULS command multiply R0 and R1 and store result in R2
2
NAME: ASHWIN RAJ
REGISTRATION NUMBER: 21BEC0400
DATE: 27/03/2023
QUESTION 3:
Load R1 register with F631024C and R0 register with 17539ABD.Swap the contents using a logic gate function
PROGRAM
AREA EXP3, CODE, READONLY
ENTRY
START LDR R1,=0xF631024C
LDR R0,=0x17539ABD
EOR R0,R0,R1
EOR R1,R0,R1
EOR R0,R0,R1
END
SIMULATION RESULT
OBSERVATION
LDR command Loads data in register R1 and R0. EXOR operator perform EXOR operation on registers and store it in leftmost registers
EXOR R0,R0,R1 perform EXOR in R0 and R1 and store value in R0
3
NAME: ASHWIN RAJ
REGISTRATION NUMBER: 21BEC0400
DATE: 27/03/2023
QUESTION 4:
Let the register content of r5 and r7 are 5 and 8 respectively. Without using MUL instruction make r5 content as 14h(20d)
PROGRAM
AREA EXP3, CODE, READONLY
ENTRY
START MOV R5,#5
MOV R7,#8
MOV R7,R5,LSL#2
END
SIMULATION RESULT
OBSERVATION
4
NAME: ASHWIN RAJ
REGISTRATION NUMBER: 21BEC0400
DATE: 28/03/2023
QUESTION 5:
What is the inference of the following code? Execute and observe
PROGRAM
AREA EXP3, CODE, READONLY
ENTRY
START MOV R1,#0X77
MOV R0,#0
RSB R0,R1,#2
END
SIMULATION RESULT
OBSERVATION
5
NAME: ASHWIN RAJ
REGISTRATION NUMBER: 21BEC0400
DATE: 28/03/2023
QUESTION 6:
What is the inference of the following code? Execute and observe
PROGRAM
AREA EXP10, CODE, READONLY
ENTRY
START MOV R0,#5
MOV R3,R0
MOV R1,#1
LOOP
MUL R2,R0,R1
MOV R0,R2
ADD R1,#1
CMP R1,R3
BLT LOOP
MOV R5,R0
HLT
B HLT
END
SIMULATION RESULT
OBSERVATION
CMP perform compare operation between R1&R3 and BLT (Branch less than) command Branches to LOOP if R1<R3 otherwise MOV
moves data in R5
6
NAME: ASHWIN RAJ
REGISTRATION NUMBER: 21BEC0400
DATE: 28/03/2023
QUESTION 7:
What is the inference of the following code? execute and observe
PROGRAM
AREA EXP4, CODE, READONLY
ENTRY
START MOV R0,#-4
LDR R2,=0X80000000
AND R3,R2,R0
CMP R3,R2
MVNEQ R1,R0
ADDEQ R1,#1
MOVNE R1,R0
HLT
B HLT
END
SIMULATION RESULT
OBSERVATION
AND perform bitwise and operation between R0 and R2 and stores it in R3. CMP compare R3 and R2 .MVNEQ invert data of R1 and
move it to R1 when they are equal data . ADDEQ add R1 and #1 if they are equal. MOVNE move R0 into R1 if they are not equal
7
NAME: ASHWIN RAJ
REGISTRATION NUMBER: 21BEC0400
DATE: 20/03/2023
QUESTION 8:
Write a assembly level program to display Vit University in LCD in two different lines.
CIRCUIT
PROGRAM
ORG 200H
DB 'VIT'
CHECK: SJMP CHECK
ORG 250H
DB 'UNIVERSITY'
CHECK2: SJMP CHECK2
ORG 0H
MOV DPTR,#200H
MOV R1,#03H
MOV R2,#0AH
8
NAME: ASHWIN RAJ
REGISTRATION NUMBER: 21BEC0400
MOV A,#38H
ACALL CMDWRT
ACALL DELAY
MOV A,#0EH
ACALL CMDWRT
ACALL DELAY
MOV A,#01H
ACALL CMDWRT
ACALL DELAY
MOV A,#06H
ACALL CMDWRT
ACALL DELAY
MOV A,#084H
ACALL CMDWRT
ACALL DELAY
LOOP: CLR A
MOVC A,@A+DPTR
ACALL DATAWRT
INC DPTR
ACALL DELAY
DJNZ R1,LOOP
MOV DPTR,#250H
MOV A,#0C4H
ACALL CMDWRT
ACALL DELAY
LOOP2: CLR A
MOVC A,@A+DPTR
ACALL DATAWRT
INC DPTR
ACALL DELAY
DJNZ R2,LOOP2
AGAIN: SJMP AGAIN
CMDWRT:MOV P1,A
CLR P2.0
CLR P2.1
SETB P2.2
ACALL DELAY
CLR P2.2
RET
DATAWRT:MOV P1,A
SETB P2.0
CLR P2.1
SETB P2.2
ACALL DELAY
CLR P2.2
RET
DELAY:MOV R3,#255
HERE2: MOV R4,#255
HERE:DJNZ R4,HERE
DJNZ R3,HERE2
RET
END
SIMULATION RESULT:
9
NAME: ASHWIN RAJ
REGISTRATION NUMBER: 21BEC0400
OBSERVATION:
The code displays "VIT" and "UNIVERSITY" on an LCD screen. It initializes registers and defines subroutines to control the LCD display.
It loops through the characters of each string and sends commands and data to the LCD display using the subroutines.
The LCD was setup was first and then data was transmitted
RS=1 for data
RS=0 for command
10
NAME: ASHWIN RAJ
REGISTRATION NUMBER: 21BEC0400
DATE:20 /03/2023
QUESTION 9:
Connect the LCD to your 8051 Kit. Then write and run a program to display your name on line 1 of the LCD (first name followed by last
name with a space in between).
Note: If you are not monitoring the busy flag of the LCD, put a few milliseconds delay in your program.
CIRCUIT
PROGRAM
ORG 0000H
MOV A,#38H
ACALL CMNWRT
ACALL DELAY
MOV A,#0EH
ACALL CMNWRT
ACALL DELAY
MOV A,#01H
ACALL CMNWRT
ACALL DELAY
11
NAME: ASHWIN RAJ
REGISTRATION NUMBER: 21BEC0400
MOV A,#06H
ACALL CMNWRT
ACALL DELAY
MOV A,#80H
ACALL CMNWRT
ACALL DELAY
MOV A,#'V'
ACALL DATWRT
ACALL DELAY
MOV A,#'I'
ACALL DATWRT
ACALL DELAY
MOV A,#'T'
ACALL DATWRT
ACALL DELAY
AGAIN: SJMP AGAIN
CMNWRT:
MOV P1,A
CLR P2.0
CLR P2.1
SETB P2.2
CLR P2.2
RET
DATWRT:
MOV P1,A
SETB P2.0
CLR P2.1
SETB P2.2
CLR P2.2
RET
DELAY: MOV R3,#0FFH
MOV R4,#0FFH
MOV R5,#55H
HERE: DJNZ R5,HERE
HERE1: DJNZ R4, HERE1
HERE2: DJNZ R3,HERE2
RET
END
12
NAME: ASHWIN RAJ
REGISTRATION NUMBER: 21BEC0400
SIMULATION RESULT:
OBSERVATION:
The code controls an LCD screen using an 8051 microcontroller. It initializes the LCD screen by sending various commands
and delays using subroutines. It then sends the characters "VIT" to the LCD screen using another subroutine.
.
The LCD was setup was first and then data was transmitted
RS=1 for data
RS=0 for command
13