Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does GAS support string literals as numeric constants like NASM does? [duplicate]

In NASM (Intel), I can write this:

mov rax, `Hello!\n`

And it's equivalent to this:

mov rax, 0xa216f6c6c6548

Does GAS (AT&T) support any equivalent shorthand for that, or am I stuck writing this?

movabsq $0xa216f6c6c6548, %rax
like image 811
Joseph Sible-Reinstate Monica Avatar asked Nov 21 '25 05:11

Joseph Sible-Reinstate Monica


1 Answers

Unfortunately GAS doesn't have such a feature. Given that GAS was really designed for assembly language output by compilers, my best guess is this feature was probably never seen as something that added much value. Had GAS originally been designed for humans to generate assembly code then such a feature likely would have been added.

like image 178
Michael Petch Avatar answered Nov 24 '25 06:11

Michael Petch