Display registers value - ARM assembly

Thread Starter

Ab Abrams

Joined Apr 27, 2017
25
Hi there,
I was wondering If anyone can help me with this. I want to print or write to a file and save the values of the registers running a simple Hello world program for example. Can somebody guide me what I need to know so I can do that? Or print to the monitor the values for example of the R0-R4?
Any help or thoughts? Can I do this combining C or C++?

Many thanks!!
 

Parth786

Joined Jun 19, 2017
642
Any help or thoughts? Can I do this combining C or C++?

Many thanks!!
Hello Ab Abrams,

Can you tell me, which ARM and compiler are you using ?

You can program microcontroller using embedded c and c++ programming. There are many program's available on internet. just look them and try to understand meaning of each line.

If you want to learn embedded programming then install one c compiler on your PC and just do practice by writing your own programs. When you feel comfortable with c programming then move toward embedded programming then install any embedded compiler that support your device and then test your device by writing your program.

Good Luck..!
 
Last edited:

MrChips

Joined Oct 2, 2009
34,806
If you are programming an ARM chip, or any MCU (microcontroller), you will need an IDE (integrated development environment) which will include the compiler.

When you download and run the program on the target MCU, you can stop program execution and you can read the hardware registers straight off your screen. Or you can use the debugger in simulator mode and don't actually need to run the code on a target hardware.
 

Thread Starter

Ab Abrams

Joined Apr 27, 2017
25
Hi guys! thanks for your reply.
Well for now I am using a Raspberry Pi 2 and I am writing and testing simple assembly codes.
I am using GNU Project assembler and compiler. When I am running GDB for debugging my assembly code
I can see through the "print, display and examine" commands the contents of the register, variables and memory.
But that I want to do is, how through a C code I can export those values to a file for example?
or through some printf display to the monitor just when I execute the ./executable file that I have produced from my .s assembly file?

I am not sure If you can understand me.
Inline Assembly can help me with that?
I dont know If that which I am thinking can be done to be honest. I am very new on this field.
Many thanks again!
 

Parth786

Joined Jun 19, 2017
642
I dont know If that which I am thinking can be done to be honest. I am very new on this field.
Many thanks again!
What is your experience in embedded system. Have you worked on any 8051 , PIC or ARM before. Which languages do you use to program micro-controller. Don't start work with advanced board like raspberry Pi
 
Last edited:

Thread Starter

Ab Abrams

Joined Apr 27, 2017
25
What is your experience in embedded system. Have you worked on any 8051 , PIC or ARM before. Which languages do you use to program micro-controller. Don't start work with advanced board like raspberry Pi
Hi Parth, well, to be honest I dont have any experience on that before, I started with Raspberry Pi. Do you think that I have to start programming with an ARM Cortex - M microcontroller at first? give me a guidance please because I dont have anyone to help me with that.
I want to learn on ARM and not on a x86 architecture.

Many thanks for your reply!
 

Parth786

Joined Jun 19, 2017
642
Hi Parth, well, to be honest I dont have any experience on that before give me a guidance please because I dont have anyone to help me with that.I want to learn on ARM and not on a x86 architecture.
I would like to help you. But may I know why don't you want to work on Micro-controller like PIC, 8051. I told you before, ARM is more advanced technology. you have to start with simple one. You didn't answer, which programming language do you know

If you really want to learn about embedded system. then you have to start with basic
 
Last edited:

Thread Starter

Ab Abrams

Joined Apr 27, 2017
25
I would like to help you. But may I know why don't you want to work on Micro-controller like PIC, 8051. I told you before, ARM is more advanced technology. you have to start with simple one. You didn't answer, which programming language do you know

If you really want to learn about embedded system. then you have to start with basic

Hi Parth,
Oh Ok, well I know Java most, C and know I am learning Assembly.
Well I need to work on ARM because I am working on a project. Is not that I dont like PIC 8051, but If its possible not to spend time on different
architecture and platforms its good for me to save time. If its not possible then yes I will start with another microcontroller.
I think that I have to combine C with assembly but call through C code the assembly part.
And my major task is to capture the CPU state at a specific time without change the content.
I am looking for some Bare-metal Programming language. Do you know anything about that?
I think that I need to configuer its Bare-metal application

Many thanks again!
 
Top