You are on page 1of 4

Assignment:1

1. A given ARM chip has the following address assignments. Calculate the
space and the amount of memory given to each section.
a) Address range of 0x00100000 – 0x00100FFF for EEPROM
b) Address range of 0x40000000 – 0x40007FFF for SRAM
c) Address range of 0x00000000 – 0x0007FFFF for Flash
d) Address range of 0xFFFC0000 – 0xFFFFFFFF for peripherals
2. Find the address space range of each of the following memory of an ARM
chip:
a) 2 KB of EEPROM starting at address 0x80000000
b) 16 KB of SRAM starting at address 0x90000000
c) 64 KB of Flash ROM starting at address 0xF0000000
3. State the contents of RAM locations 0x92 to 0x96 after the following
program is executed:
4. State the contents of R2, R1, and memory location 0x20 after the following
program:

5. Show the status of the C and Z flags after the addition of


a) ) 0x0000009C and 0xFFFFFF64 in the following instruction:
;assume R1 = 0x0000009C and R2 = 0xFFFFFF64
ADDS R2,R1,R2
b) 0x0000009C and 0xFFFFFF69 in the following instruction: ;assume R1
= 0x0000009C and R2 = 0xFFFFFF69
ADDS R2,R1,R2
6. Show the status of the Z flag during the execution of the following

7. Simulate following code in software and compare the result of using


ALIGN in the following programs.

(a)AREA b) c)
E2_7A,READONLY,CODE AREA AREA
ENTRY E2_7B,READONLY,CODE E2_7C,READONLY,CODE
ADR R2,DTA ENTRY ENTRY
LDRB R0,[R2] ADR R2,DTA ADR R2,DTA
ADD R1,R1,R0 LDRB R0,[R2] LDRB R0,[R2]
H1 B H1 ADD R1,R1,R0 ADD R1,R1,R0
DTA DCB 0x55 H1 B H1 H1 B H1
DCB 0x22 DTA DCB 0x55 DTA DCB 0x55
END ALIGN 2 ALIGN 4
DCB 0x22 DCB 0x22
END END

8. Show how to represent decimal 20 in formats of (a) hex, (b) decimal,


and (c) binary in the ARM assembler.

Assignment-2

1. Simulate following code and verify status bits


a) LDR R2,=0xFFFFFFF5 ;R2=0xFFFFFFF5 (notice the = sign)
MOV R3,#0x0B
ADDS R1,R2,R3 ;R1=R2 + R3 and update the flags

b) LDR R2,=0xFFFFFFFF
ADDS R1,R2,#0x95

2. Simulate following code and verify status bits


LDR R2,=0xFFFFFFF1 ;R2 = 0xFFFFFFF1
MOV R3,#0x0F
ADDS R3,R3,R2 ;R3 = R3 + R2 and update the flags
ADD R3,R3,#0x7 ;R3 = R3 + 0x7 and flags unchanged
MOV R1,R3
3. Simulate following code and verify status bits also chance ADD by ADDS in
line 4 and verify the same.

1. LDR R2,=0xFFFFFFF1 ;R2 = 0xFFFFFFF1


2. MOV R3,#0x0F
3. ADDS R3,R3,R2 ;R3 = R3 + R2 and update the flags
4. ADD R3,R3,#0x7 ;R3 = R3 + 0x7 and flags unchanged
5. MOV R1,R3

4. Write a program to calculate the total sum of five words of data.


Each data value represents the mass of planet in integer. The
decimal data are as follow: 1000000000, 2000000000, 3000000000,
4000000000, and 4100000000
5. Write a program which adds 0x35F62562FA to 0x21F412963B.
6. Show the steps involved for the following cases:

a)
MOV R2,#0x4F ;R2 = 0x4F
MOV R3,#0x39 ;R3 = 0x39
SUBS R4,R2,R3 ;R4 = R2 – R3
b)
MOV R2,#0x4F ;R2 = 0x4F
SUBS R4,R2,#0x05 ;R4 = R2 – 0x05
7.

You might also like