mov ax,0xb800 ;指向文本模式的显示缓冲区 mov es,ax mov byte [es:0x00],'W' mov byte [es:0x01],0x07 mov byte [es:0x02],'a' mov byte [es:0x03],0x07 mov byte [es:0x04],'n' mov byte [es:0x05],0x07 mov byte [es:0x06],'g' mov byte [es:0x07],0x07 mov byte [es:0x08],'S' mov byte [es:0x09],0x07 mov byte [es:0x0a],'h' mov byte [es:0x0b],0x07 mov byte [es:0x0c],"e" mov byte [es:0x0d],0x07 mov byte [es:0x0e],'n' mov byte [es:0x0f],0x07 mov byte [es:0x10],'g' mov byte [es:0x11],0x07 mov byte [es:0x12],'z' mov byte [es:0x13],0x07 mov byte [es:0x14],'e' mov byte [es:0x15],0x07 mov byte [es:0x16],'2' mov byte [es:0x17],0x07 mov byte [es:0x18],'1' mov byte [es:0x19],0x07 mov byte [es:0x1A],'2' mov byte [es:0x1B],0x07 mov byte [es:0x1C],'1' mov byte [es:0x1D],0x07 mov byte [es:0x1E],'0' mov byte [es:0x1F],0x07 mov byte [es:0x20],'2' mov byte [es:0x21],0x07 mov byte [es:0x22],'1' mov byte [es:0x23],0x07 mov byte [es:0x24],'8' mov byte [es:0x25],0x07 ;xor dx,dx ;add dx,es:0x25; ;mov byte [es:0x26],dx; ;mov byte [es:0x27],0x07; infi: jmp near infi ;无限循环 number db 0,0,0,0,0 times 510-($-$$) db 0 db 0x55,0xaa
时间: 2024-03-18 20:44:33 浏览: 46
传送指令MOV的学习程序-综合文档
这段代码是用汇编语言写的,它实现了在文本模式下向屏幕上写入一段字符串“WangShengze218210218”。具体来说,它将显示缓冲区的地址存入寄存器ax和es中,然后通过mov指令将每个字符的ASCII码和颜色信息存入缓冲区中相应的位置。最后,通过一个无限循环使屏幕一直显示这段字符串。其中,times指令和db指令用来填充剩余的空间,以保证整个程序的长度为512字节,可以被计算机正确地加载和执行。
阅读全文