"fh"是什么?后缀表示类似"38fh"的数字.在英特尔大会上 [英] What does the "fh" suffix mean on a number like "38fh" in Intel assembly
问题描述
我已经在网上搜索了所有内容,但是在以下说明和eax 38fh
中找不到"fh"的含义.我知道"h"代表十六进制,"d"代表十进制,但是我从未见过fh.
I've searched all over the web, but I couldn't find what the "fh" means in the following instruction and eax, 38fh
. I know that "h" stands for hexadecimal and "d" for decimal, but I've never seen fh before.
推荐答案
如果Intel汇编程序(即 MASM )令牌以数字(0到9)开头,则假定为整个令牌是一个值.如果该值以 h
结尾,则汇编程序会认为它是 H 十进制.
If an Intel assembler (ie. MASM) token starts with a number (0 to 9) then it is assumed to be that the entire token is a value. If the value ends with an h
the assembler assumes it is Hexadecimal.
在您的情况下, 38fh
以数字开头,因此假定它是一个值.在您的情况下,令牌的末尾是 h
(或 H
),因此将其视为十六进制数.因此 38f
被视为十六进制值. f
恰好是一个有效的十六进制数字. 38f
的十进制为911,二进制的为1110001111.
In your case 38fh
starts with a number so it is assumed to be a value. The end of the token in your case is h
(or H
) so it is treated as hexadecimal number. So 38f
is treated as a hexadecimal value. The f
just happens to be a valid hexadecimal digit. 38f
is 911 in decimal and 1110001111 in binary.
如果您有像 f8h
这样的令牌,则确实会出现问题.由于它以字母(不是0到9的数字)开头,因此将被视为标识符或符号.如果它以和eax,f8h
出现,则可能会导致某种形式的语法错误.一个人可能会遇到的问题-如果十六进制值以 A 到 F 的字母开头,如何使用后缀 h
表示它?很简单,只需在前面放置一个0.这将有效和eax,0f8h
.
A problem does arise if you have a token like f8h
. Because it starts with a letter (not a digit 0 to 9) it will be treated as an identifier or symbol. This will likely lead to some form of syntax error if it appeared as and eax, f8h
. The question one may have - if a hexadecimal value starts with a letter A to F how can I represent it using an h
suffix? Simple, just place a 0 on the front. This would work and eax, 0f8h
.
正如Fifoernik指出的,一个窍门是使用另一种大写字母使后缀突出: 38Fh .对于新手来说,汇编程序很容易看到 f
是十六进制数字,如果将其改成大写的 F
,而将后缀字符'h'保留为小写
As Fifoernik pointed out One trick would be to use a different capitalization to make the suffix stand out: 38Fh . It might have been easier for a human new to assembler to see that f
was a hexadecimal digit had it been made upper case F
while leaving the suffix character 'h' lower case.
这篇关于"fh"是什么?后缀表示类似"38fh"的数字.在英特尔大会上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!