汇编语言数据库问题 [英] Assembly Language DB Question
问题描述
最近,我一直在学习某种汇编语言,我对汇编应用程序.Data段上的DB声明有疑问.
直到现在,我总是这样声明一个字节:
Hi,
Lately I have been Studying some Assembly language, I have a question about the DB Decleration on the .Data Segment of an Assembly Application.
Till Now, I always declared a Byte by doing So:
Number db "Please enter a number : ",0
(名称)db(字符串),0
今天,我找到了一个具有如下字符串声明的示例:
(Name) db (String), 0
Today, I found an example which had the String Declaration as Follows:
Hello db "Hello World!",13,10, 0
我对13、10有疑问.
谁能指出这些意思.
谢谢
安德鲁·伯格(Andrew Borg)
I Have a Question Regarding the 13, 10.
Can anybody point out what these mean.
Thank You,
Andrew Borg
推荐答案
:笑:
它们是添加到字符串末尾的字节值,无法通过常规键入添加.在这种情况下,回车符,换行符和终止的空字符.
在C型语言中,这相当于写作:
:laugh:
They are bytes values added to the end of the string, that cannot be added by normal typing. In this case a carriage return, a line feed and a terminating null character.
In C-type languages, this would be the equivalent of writing:
char* Hello = "Hello World!\n";
不过,最好将它们声明为助记符,因此您可以使用可读的名称代替数字:
It is a good idea to declare these as mnemonics though, so you can use readable names instead of numbers:
Hello db "Hello World!", AS_CR, AS_LF, 0
(我可能不会将AS_NULL用作零,因为它很可能是字符串终止符,而不是一个要显示的字符)
(I probably wouldn''t use AS_NULL for the zero, as it would most likely be a string terminator, rather than a character to display)
它们表示CR LF,Carriage_Return(13),Line_Feed(10).对于Microsoft系统,这两个字节一起以ASCII(或每个字符一个字节)编码定义了标准的行尾定界符.
(通常,行尾定界符取决于平台;并且这一事实曾经是造成众多混乱的根源,这种混乱并不经常出现,但有时甚至是最近.)
—SA
They mean CR LF, Carriage_Return (13), Line_Feed (10). These two bytes together define standard end-of-line delimiter in ASCII (or any one-byte-per-character encodings) in case of Microsoft systems.
(Generally, the end-of-line delimiter is platform-dependent; and this fact used to be a source on numerous confusions, which appear not often, but from time to time even these days.)
—SA
这篇关于汇编语言数据库问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!