accessing peripherals in assembler

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

accessing peripherals in assembler

448 Views
ianbenton
Senior Contributor I

In C the header file chip.h which include such things as adc15xx.h sets up the addresses for all the peripheral registers.

When writing a function in assembler, is there a way of accessing this information?

example: C knows that ADC->CTRL refers to the control register of the ADC converter and compiles the correct value for the address of this register, but can I access that information from assember, by writing something similar to LDR R3,=ADC->CTRL instead of first having to look up its address in the manual and define ADC_CTRL again  as .equ ADC_CTRL, 0x40000000 ?

Labels (3)
0 Kudos
1 Reply

361 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Ian Benton,
Thank you for your interest in NXP Semiconductor products and the opportunity to serve you.
When debugging the demo, you can see assemble codes which seems like the interpretation of C codes.
I'd highly recommend you refer to these assemble codes for details.
Have a great day,
TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos