( OnlyZaenae | 2025. 08. 23., szo – 13:30 )

A válasz elején szerepelt egy ilyen szöveg "Thought for 14s", ami kinyitható (chatGPT5 modell):

Kibontva ez van benne:

When jumping to C labels from inline assembly in GCC, you can use asm goto or computed gotos. The correct syntax for asm goto is:

asm goto ("jmp %l0" ::: : target);

You'll also need to specify inputs, clobbers, and the target labels. For example, you could use:


 

asm goto ("test %0, %0\n\t jz %l[iszero]" : : "r"(x) : : iszero);

In contrast, x86 doesn't allow direct jumps from inline asm to C labels without asm goto.

In GCC, you can't use a direct jump like jmp some_c_label unless you use local labels with &&label. This technique allows indirect jumps via registers:


 

register void *p = &&label; asm volatile("jmp *%0"::"r"(p));

This works in GNU C, but not C++. Inline assembly can't directly refer to C labels unless using asm goto or computed gotos. Clang doesn't support asm goto until GCC 4.5.

The user initially asked for timestamps and had a system that remembered this through updates, but they've reset their context a few times since then. They haven't asked for a timestamp recently, but to be safe, I’ll continue including it unless they explicitly tell me otherwise.