“000000q”是什么意思?
What does `000000q` mean?
我正在学习 x86_64
汇编程序 (yasm
) this 教科书。在那里我遇到了以下定义文件访问标志的行:
O_RDONLY equ 000000q
O_WRONLY equ 000001q
O_RDWR equ 000002q
问题是他们的价值观是什么意思? q
代表什么?
在NASM/YASM中是一个后缀,表示数字是八进制的。来自documentation
3.5.1. Numeric Constants
A numeric constant is simply a number. NASM allows you to specify numbers in a variety of number bases, in a variety of ways: you can suffix H, Q or O, and B for hex, octal, and binary, or you can prefix 0x for hex in the style of C, or you can prefix $ for hex in the style of Borland Pascal. Note, though, that the $ prefix does double duty as a prefix on identifiers (see Section 3.1), so a hex number prefixed with a $ sign must have a digit after the $ rather than a letter.
Some examples:
mov ax,100 ; decimal
mov ax,0a2h ; hex
mov ax,[=10=]a2 ; hex again: the 0 is required
mov ax,0xa2 ; hex yet again
mov ax,777q ; octal
mov ax,777o ; octal again
mov ax,10010011b ; binary
我正在学习 x86_64
汇编程序 (yasm
) this 教科书。在那里我遇到了以下定义文件访问标志的行:
O_RDONLY equ 000000q
O_WRONLY equ 000001q
O_RDWR equ 000002q
问题是他们的价值观是什么意思? q
代表什么?
在NASM/YASM中是一个后缀,表示数字是八进制的。来自documentation
3.5.1. Numeric Constants
A numeric constant is simply a number. NASM allows you to specify numbers in a variety of number bases, in a variety of ways: you can suffix H, Q or O, and B for hex, octal, and binary, or you can prefix 0x for hex in the style of C, or you can prefix $ for hex in the style of Borland Pascal. Note, though, that the $ prefix does double duty as a prefix on identifiers (see Section 3.1), so a hex number prefixed with a $ sign must have a digit after the $ rather than a letter.
Some examples:
mov ax,100 ; decimal mov ax,0a2h ; hex mov ax,[=10=]a2 ; hex again: the 0 is required mov ax,0xa2 ; hex yet again mov ax,777q ; octal mov ax,777o ; octal again mov ax,10010011b ; binary