atmegaatmega32

What does this #asm #endasm mean?


I'm looking for code to make an automatic light sensor. then I found the code like below. so what does the code mean?

#asm
in r30,mcucr
cbr r30,__sm_mask
sbr r30,__se_bit | __sm_adc_noise_red
out mcucr,r30
sleep
cbr r30, __se_bit
out mcucr,r30
#endasm

Solution

  • Different languages (or compilers) have different ways to start and end it.

    But generally, that is just how Assembly-language can be mixed with other languages (allowing direct use of CPU instructions).

    See also Beginners Introduction to the Assembly Language of ATMEL