0% found this document useful (0 votes)
96 views2 pages

ARM Cortex M3 Instruction Overview

This document contains an assignment on embedded systems for a cortex M3 course. It includes 16 questions covering various ARM cortex M3 instruction sets like shift, rotate, data processing and branch instructions. It also covers memory mapping, CMSIS organization, assembly directives and interfacing. Students are asked to explain instructions, write assembly/C programs and analyze sample codes. They are requested to submit their responses by July 23rd, 2021.

Uploaded by

chaitanya
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
96 views2 pages

ARM Cortex M3 Instruction Overview

This document contains an assignment on embedded systems for a cortex M3 course. It includes 16 questions covering various ARM cortex M3 instruction sets like shift, rotate, data processing and branch instructions. It also covers memory mapping, CMSIS organization, assembly directives and interfacing. Students are asked to explain instructions, write assembly/C programs and analyze sample codes. They are requested to submit their responses by July 23rd, 2021.

Uploaded by

chaitanya
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Jain College of Engineering & Research Belagavi

(Approved by AICTE, New Delhi, Affiliated to VTU Belagavi & Recognized by Govt. of Karnataka)

Department of Electronics & Communication Engineering


Assignment on Module - 2

Subject: Embedded System Subject Code: 18EC62

Faculty Incharge: Prof. Chaitanya K J Date: 18/07/2021

1) Explain shift & rotate instructions available in ARM cortex M3 instruction set. Why
is there rotate right instruction nut no rotate left instruction in cortex M3?

2) Explain the following instructions with suitable example:

a) BFC b) SXTH c) UBFX d) RBIT

3) Write the memory map and explain memory access attributes/bit band
operations in cortex M3

4) Analyse the following instruction & write the contents of the registers after the
execution of each instruction:

Assume R8 = 0X00000088, R9 = 0X00000006 and R3 = 0X00001111


i) RSB.W R8, R9, #0X10
ii) ADD R8, R9, R3
iii) BIC.W R6, R8, #0X06
iv) ORR R8, R9

5) Explain the following 16 bit instructions in CORTEX M3: ADC, RSB, TST, BL,
LDR, MOV, SVC, PUSH

6) Explain the following 32 bit instructions in CORTEX M3: AND, CMN, MLA,
SDIV, STR, MRS, MSR, POP

7) With neat diagram explain the organization of CMSIS

8) Explain the following instruction with example: ASR, LSL, ROR, REV, LDMIA,
SXTB

9) List and explain the function of any four data processing and branch instructions in
cortex M3 with example.

10) Write a note on barrier instruction in CORTEX M3

11) Explain the following assembler directives: AREA, ENTRY, DCB, ALIGN

12) Explain different bus interfaces supported by CORTEX M3.


Jain College of Engineering & Research Belagavi
(Approved by AICTE, New Delhi, Affiliated to VTU Belagavi & Recognized by Govt. of Karnataka)

Department of Electronics & Communication Engineering

13) Explain any two methods of accessing memory mapped registers in C.

*Basic assembly / C Programs repeated in previous year QP*

14) Write a Assembly level program to find sum of first 10 integer numbers.

15) Write an assembly program to add two 64 bit numbers

16) Write a C language program to toggle an LED with a small delay in cortex M3.

Note: The questions which are been made as bold, indicate most repeated questions from

VTU previous year question papers (15EC62, 17EC62)

SUBMISSION DEADLINE: 23/07/2021

Common questions

Powered by AI

BFC, or Bit Field Clear, is an instruction used to clear a specified range of bits within a register in the ARM Cortex M3. The instruction sets the specified range of bits to zero while leaving other bits unchanged. For example, if you have a register R0 with value 0xFFFF, and you execute BFC R0, #4, #4, bits 4 to 7 will be cleared, resulting in 0xFF0F. This allows selective clearing of bits without affecting other data .

Barrier instructions in ARM Cortex M3, such as DSB (Data Synchronization Barrier), ensure memory operations are completed as intended before any subsequent instructions are executed. They are crucial in multi-threaded applications to ensure memory consistency and predictability, preventing access reordering that could potentially lead to inconsistencies in data across threads. This is especially important in systems that rely on specific sequences of memory operations for correct functionality .

Inline assembly in C can provide direct access to memory-mapped registers in ARM Cortex M3 by embedding assembly code within C programs. For example, using the `__asm__` keyword, developers can load a specific memory-mapped register value directly into a variable. This integration allows programmers to optimize certain operations and utilise processor features not accessible from C alone, thus combining high-level programming ease with low-level hardware control .

The BIC (Bit Clear) instruction in ARM Cortex M3 performs bitwise clearing of selected bits in a register by ANDing the first operand with the complement of the second operand. This results in clearing specific bits in the destination register specified by the second operand while leaving others unchanged. Common applications include clearing flag bits or hardware interrupt signals in registers, especially useful for system control and configuration tasks in embedded systems .

The shift instructions in the ARM Cortex M3 instruction set move bits left or right within a register, effectively multiplying or dividing by powers of two, respectively. There are LSL (Logical Shift Left), LSR (Logical Shift Right), and ASR (Arithmetic Shift Right). Rotate instructions, however, circulate the bits around, where the end bits wrap around to the other side. The Cortex M3 includes ROR (Rotate Right), but lacks a Rotate Left (ROL) because any rotate left operation can be achieved using a combination of a Rotate Right and shift instructions, optimizing instruction set space by minimizing redundancy .

Assembler directives are crucial in defining and controlling how machine code is generated in ARM Cortex M3 assembly programming. AREA defines a section of code or data, ENTRY marks the starting point of execution, DCB (Define Constant Byte) initializes memory with constant data, and ALIGN ensures data aligns to specific memory boundaries. These directives enable structured, efficient, and error-free program development, providing control over memory layout, initialization, and execution flow .

Memory mapped I/O in Cortex M3 facilitates embedded system design by allowing peripherals to be accessed as if they were regular memory locations. This provides a uniform interface for both data and I/O operations, simplifying the programming model. It also enables more efficient use of the processor's data handling instructions, optimizing performance with direct bitwise manipulations. Such a feature is critical in real-time systems where peripheral interaction needs to be as fast and efficient as possible .

The CMSIS (Cortex Microcontroller Software Interface Standard) framework provides a standardized hardware abstraction layer for ARM Cortex M3, aiming to simplify porting and development of reusable software components. It includes a consistent API for device-peripheral access, which promotes interoperability and reduces development time. CMSIS is vital in ensuring efficient and reliable software development across various ARM Cortex M3 microcontrollers by providing a foundation that developers can build upon without being burdened by underlying hardware differences .

LDR (Load Register) and STR (Store Register) are data transfer instructions in ARM Cortex M3. LDR loads data from a memory address into a register, whereas STR stores data from a register into a memory address. Typical use cases for LDR include reading input data from a sensor into a register for processing, while STR might be used to output processed data to an actuator, saving state or results from processing to memory for later use or analysis .

Shift and rotate operations are efficient in embedded systems, including ARM Cortex M3 applications, because they allow bit-level manipulation of data, providing quick computation for multiply, divide, and optimization of algorithms without the overhead of complex arithmetic calculations. These operations are integral in tasks like encryption, checksum calculations, and data packaging, critical in resource-constrained environments typical of embedded systems .

You might also like