banner

Saturday, February 13, 2021

Arm Cortex M0+ simulation codes

**************************************************************************

 ARM Cortex M0 +

 **************************************************************************

########################################################
Codes

########################################################

Part 1 - Primitive set codes

**************************************************************************

Instruction set type-1: data transfer 

**************************************************************************

 Instruction set (register to register)

* Data transfer instructions with in the processor of ARM cortex M0+

Assembly language and embedded C code 

# Write KL25Z ARM cortex M0 code to transfer data with in the processor (register to register)  **************************************************************************

 Instruction set (Register to Memory vice versa)

* Data transfer instructions of ARM cortex M0/M0+ to memory access through registers.

Assembly language code

 # Write assembly language code to program KL25Z (ARM cortex M0+) transfer the data with memory. 

Embedded C code

# Write embedded C code for KL25Z to transfer data from memory to variable and variable to memory.

**************************************************************************

Instruction set type-2: Arithmetic and logical

# Write assembly code to perform Arithmetic operations

#Write assembly code to perform logical operations

Assembly language Problems

# Write Embedded C code to perform the arithmetic and logical operations for integer data type. 

************************************************************************** 

Instruction set type-3: Program flow control

# Write assembly language code for all type of the conditional and unconditional program flow control instructions.

1) Write assembly language code for all type of unconditional program flow control instructions.

2) Write assembly language code for all type of the conditional for value comparison operations 

3) Write assembly language code for all type of the conditional overgflow and signed program flow control instructions

# Write embedded C and assembly code for if_else to understand program flow instructions.

# Write embedded C and assembly code to understand program flow instructions for "for loop".

 **************************************************************************

 

**************************************************************************

 _________________________________________________________

Part 2 Algorithm Set codes

**************************************************************************

Memory to memory data trasnsfer

# write code to transfer block of data from 1FFFF104 to 1FFFF164 and block size is stores on 1FFFF100. 

**************************************************************************

Find the maximum and minimum number from given list

**************************************************************************

Steps to realize code

 *Write assembly and embedded C code to find the maximum and minimum from 32 bit data stored from memory location 0x1FFFF104, No. of data elements is stored on memory location 0x1FFFF100.  

Assembly language code

# solution of assembly code to find the maximum and minimum from block of 32 bit data stored from memory location 0x1FFFF104, No. of data elements is stored on memory location 0x1FFFF100.  

Solution-1                                                        Solution-2

Embedded C code

Solution


**************************************************************************

Arrange list of data in ascending and descending order

**************************************************************************

Steps to realize code

*Write assembly and embedded C code to arrange set of 32 bit data stored from memory location 0x1FFFF104 in ascending and descending order, No. of data elements is stored on memory location 0x1FFFF100. 

Assembly code of ascending order

Solution-1

Assembly code descending order

Solution-1  

 **************************************************************************

Generate Fibonacci series 

**************************************************************************

Write assembly and embedded C code to generate Fibonacci series of 32 bit data size and store the element starting from the memory location 0x1FFF104. Number of maximum elements is stored on memory location 0x1FFF100.

Elements  0, 1, 1, 2, 3, 5, 8, 13, 21, 34 .......

Image result for fibonacci series 

Assembly code                                             Embedded C code

______________________________________________________



 

No comments:

PULP RISC-V important links

1) Understanding and working with PULP - all the details of the architectures https://pulp-platform.org/docs/riscv_workshop_zurich/schiavone...