+ -
当前位置:首页 → 问答吧 → 把东西写入显存中,是不是显存中的东西马上就会显示,然后该内存中就马上变成别的东西?

把东西写入显存中,是不是显存中的东西马上就会显示,然后该内存中就马上变成别的东西?

时间:2011-09-23

来源:互联网

把东西写入显存中,是不是显存中的东西马上就会显示,然后没了?
比如我向显存b800:7c0之后的32个字节写入红底闪烁高亮绿色的"welcome to masm!"
代码是:
assume cs :codesg, ds:datasg

datasg segment
db 'welcome to masm!'
db 10101100b
datasg ends

codesg segment

start: mov ax,datasg
mov ds,ax

mov ax,0b800h
mov es,ax

mov bx,0
mov si,0
mov cx,16

s0: mov al,[si+16]
mov es:[bx+7c0h+1],al

add bx,2
loop s0

mov bx,0
mov cx,16
s: mov al,[bx]
mov es:[si+7c0h],al

add si,2
inc bx
loop s

mov ax,4c00h
int 21h
codesg ends
end start
可以达到效果,可是我用debug 中的d命令查看b800:7c0中的内容却不是welcome to masm!,这是为什么?

作者: qhdandxb   发布时间: 2011-09-23

应该是它执行完以后,退出程序后显示DUBUG里面的东西了。

作者: Silent_hi   发布时间: 2011-09-24

DEBUG也会修改显存的,毕竟DEBUG也要现实结果。

作者: MHBBCRCPJ   发布时间: 2011-09-24