What does "= w" mean in the GCC Inline Assembly?

I found a built-in asm assembly that works, and I can't figure it out ( link ):

// busy wait
__asm__ __volatile__ (
    "1: sbiw %0,1" "\n\t" // 2 cycles
    "brne 1b" : "=w" (us) : "0" (us) // 2 cycles
);

I found several gas manuals such as this , but I could not find an explanation. In any case, the file can be compiled by avr-gcc:

/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avr-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mmcu = atmega328p -DF_CPU = 16000000L -MMD -DUSB_VID = null -DUSB_PID = null -DARDUINO = 105 -I / Applications / Arduino.app / Contents / Resources / Java / hardware / arduino / core / arduino -I / Applications / Arduino.app / Content / Resources / Java / hardware /arduino/variant/standard/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/wiring.c -o / var / folders / 64 / fwfkm1k51zbd4_c5lwpsbljh0000gn / T / build5450310618632679.. w /.

So what does "= w" mean in the GCC Inline Assembly?

+4
source share
2 answers

. , " ". w AVR " r24 r31". , .

, ( - , sbiw). , gcc sbiw, ..

+6

"=" . "w" . GCC GCC 2012 .

6.43.3.1 :

- . 'D,' a 'f 68000/68020 , .

, : [Patch, AVR]: "w" , addhi3. :

"w" * addhi3 addhi3_clobber "w" . orgiginal addhi3 insn 4,6. "l" addhi3_clobber, "r".
, ADIW SBIW.

, "w" AVR .

+5

Source: https://habr.com/ru/post/1569021/


All Articles