如何在MASM代码中编写启动的十六进制数字?

发布于 2025-02-07 22:39:03 字数 535 浏览 3 评论 0原文

我目前正在编辑几个由MASM代码组成的宏。 它们看起来都与此相似:

Primary MACRO
Key 0Bh,'0'
Key 29h,15h
Key 03h,'2'
Key 06h,'5'
Key 0Ch,'+'
Key 0Dh,'´'
Key 1Bh,'¨'
Key 2Bh,27h
Key 35h,'-'
Key 34h,'.'
Key 33h,','
Key 56h,'<'
ENDM

我注意到我可以编写以下格式(以)字符0-9启动的十六进制数字:02H12H5AH,等。 但是,如果我尝试以相同的方式编写字母启动的十六进制数字(也就是说,例如abhcahdfh,等等。 ),我有一个错误。我尝试了格式0xba0xfe等,但它也不起作用。

在这种情况下,谁能告诉我正确的格式用于编写登录启动的十六进制数字?

I am currently editing several macros consisting of MASM code.
They all look similar to this:

Primary MACRO
Key 0Bh,'0'
Key 29h,15h
Key 03h,'2'
Key 06h,'5'
Key 0Ch,'+'
Key 0Dh,'´'
Key 1Bh,'¨'
Key 2Bh,27h
Key 35h,'-'
Key 34h,'.'
Key 33h,','
Key 56h,'<'
ENDM

I have noticed that I can write hexadecimal numbers which are initiated by (begin with) character 0-9 in the following format: 02h, 12h, 5Ah, etc.
However, if I try to write letter-initiated hexadecimal numbers in the same way (that is, like ABh, CAh, DFh, etc.), I get an error. I have tried the format 0xBA, 0xFE, etc., but it doesn't work either.

Can anyone tell me the correct format to use for writing letter-initiated hexadecimal numbers in this case?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

折戟 2025-02-14 22:39:03

HEX AB的正确格式是0ABH

您需要使用数字启动它的原因是,汇编器可以轻松地将其与标签或符号(例如abh)区分开。

不用担心它有三位数的事实。因此,它不会神奇地变成十二位数字,因此所使用的位数将取决于您使用的地址模式。

The correct format for hex AB is 0ABh.

The reason you need to start it with a digit is so the assembler can easily distinguish it from a label or symbol such as ABh.

And don't worry about the fact it has three digits. It doesn't magically turn into a twelve-bit number because of that, the number of bits used will depend on the addressing modes you're using.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文