我正在尝试在汇编程序中制作双缓冲视频,但在这种情况下我有一个问题,我不知道如何解决它,按下一个键后它无法关闭。显然问题出在inc di:
(我正在尝试使用缓冲区用白色绘制所有 320*200 像素)
.model small
.386
.stack 400h
.data
modovideo db ?
vram dw 0
xVal dw ?
yVal dw ?
.code
main proc
mov ax,@data
mov ds,ax
mov ah,0fh
int 10h
mov modovideo,al
mov ah,0
mov al,13h
int 10h
; Segmento de memoria =====================================
mov ah,48h
mov bx,4000 ; 64000/16
int 21h
mov vram,ax
; Escribir en el segmento de memoria =======================================
mov es,vram
;offset = 320*y + x
;mov xVal,160
;mov yVal,100
;mov ax,320
;mul yVal
;add ax,xVal
mov di,0
mov al,7
mov cx,640
paso1:
mov es:[di],al
inc di ; <-----------
loop paso1
; Volcar sobre pantalla ======================================================
mov ds,vram
xor si,si
mov dx,0A000h
mov es,dx
xor di,di
mov cx,64000
rep movsb
mov ah,1
int 21h
salir:
mov al,modovideo
mov ah,0
int 10h
mov ah,4ch
int 21h
main endp