汇编中0AH,0DH是什么意思
A DB 'PLEASE INPUT(A~Z)','$'
B DB 0AH,0DH,'S' 展开
具体来说,0DH是回车符(CR),它的 ASCII 码值为十进制13,表示将光标移到本行的开头位置。而0AH则是换行符(LF),它的 ASCII 码值为十进制10,表示将光标移到下一行的开头位置。
在DATASEGMENT中,B0AH, 0DH, 'S' 这一行代码的含义是:将字母 S 存储在数据段中,并在该字符前添加回车和换行控制字符,以便将光标移动到下一行并从行首开始输出提示信息 "PLEASE INPUT(A~Z):"。
2018-09-20 广告
Both 0ah and 0dh are hexadecimal values. Hex values can be specified in two ways in assembly - append a h after the hex value or append the value to 0x.
As Pravasi explained, 0ah is equivalent to 10 in decimal and to linefeed ('\n') in ASCII which moves the cursor to the next row of the screen but maintaining the same column. 0dh is quivalent to 13 in decimal and to carriage return ('\r') in ASCII which moves the cursor to the beginning of the current row. A combination of the two thus moves the cursor to the beginning of the next row of the screen.
from: