Что %c означает в коде встроенного ассемблерного кода GCC?

Даже у самых опытных программистов есть проблемы с неявным преобразованием в логическое значение. Я, например, ценю эту маленькую особенность.

7
задан sigjuice 4 November 2009 в 10:32
поделиться

2 ответа

From the GCC internals documentation:

`%cdigit' can be used to substitute an operand that is a constant value without the syntax that normally indicates an immediate operand.

13
ответ дан 6 December 2019 в 14:05
поделиться

Check the assembly output (with gcc -S, or maybe disassemble the object file) and it may be clearer.

My guess is that it stands for constant. hypercall_page looks like a table of instructions that each do a syscall. Maybe this will generate a call hypercall_page + {constant based on the expression given}, essentially having computed the address of this offset at compile time.

As an aside, this __HYPERVISOR##name stuff really reminds me of the __NR_name_of_syscall type convention you see for syscalls in Linux's and similar places.

2
ответ дан 6 December 2019 в 14:05
поделиться
Другие вопросы по тегам:

Похожие вопросы: