Cir*_*四事件 1 assembly gnu-assembler
例如,我想写一些类似的东西,'a'而不是0x61像我在C语言中那样。
该手册在以下位置提到了它们:https : //sourceware.org/binutils/docs/as/Chars.html,但如果没有示例,我不确定我是否理解。
/* Immediate. Without the `$`, does a memory access, and segfaults! */
mov $'a, %al
/* al == 0x61 */
/* Memory. */
mov c, %al
/* al == 0x62 */
c: .byte 'b
/* Space character works. */
mov $' , %al
/* al == 0x20 */
/* Backslash escapes work. */
mov $'\n , %al
/* al == 0x0A */
Run Code Online (Sandbox Code Playgroud)
实际上有一个示例:https : //sourceware.org/binutils/docs-2.25/as/Characters.html:
.byte 74, 0112, 092, 0x4A, 0X4a, 'J, '\J # All the same value.
Run Code Online (Sandbox Code Playgroud)
我不喜欢此语法的原因如下:
MACRO($'a)失败,因为cpp '像char文字一样对待。$',这很难观察