db:byte 只能存储单字节
dw: word 双字节
字符串存储必须用db(单字节顺序存放),
不能用dw(双字节顺序存放,且要分开编辑。按低到低字节、高到高位字节对应)
code segment assume cs:code org 100h start: jmp bbb nop msg1 dw 'he' , 'll' , 'o ' , 'wo' , 'rl' , 'd ' , ' $' bbb: push cs pop ds lea dx,msg1 mov ah, 9 int 21h mov ah,4ch int 21h code ends end start |
上例输出的是“ehll oowlr d”,而不是“hello world”
db定义字节类型变量,一个字节数据占1个字节单元,读完一个,偏移量加1 dw定义字类型变量,一个字数据占2个字节单元,读完一个,偏移量加2 dd定义双字类型变量,一个双字数据占4个字节单元,读完一个,偏移量加4