Does not output a few pixels, using double buffering, what's the matter ( in the debugger and the dev working)?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
7 views
Write a program in a boot loader running in real time. Try to deal with the graphics, namely 320х200 pixels, when working with sprites voznikaet twink, found that you need a second buffer did like everything right, and already 100 times were checked in emulyator, virtual reality works, and when run on hardware all the time, not only filled the screen in some color, if no fill, so a lot of weirdness.

org 7c00h use16 jmp start e: mov ax,cs mov ds,ax mov es,ax ret put_clear: mov ax,8000h mov ds,ax mov al,200 mov ah,al mov bx,0000h put_clear0: mov [bx],ax add bx,02h cmp bx,0FFFEh jz e jmp put_clear0 put_sprite: mov ax,8000h mov es,ax mov di,0 mov bx,sprite put_sprite0: mov al,[bx] cmp al,00h jz e stosb inc bx jmp put_sprite0 draw: mov ax,8000h mov ds,ax mov ax,0A000h mov es,ax mov bx,0000h mov di,0000h draw0: mov al,[bx] stosb cmp bx,0FFFFh jz e inc bx jmp draw0 start call e mov ax,0013h int 10h call put_clear ;; Fill in some color in the buffer call put_sprite ;; box sprite buffer call draw ;; display the buffer on screen mov ah,0 int 16h db 250 db 250 db 250 db 200 db 200 db 200 ;; so I checked the bug, made the distance between the code and the sprite :D sprite db 50,150,50,0


Code shortened as I could. To make it easier to understand that as a Yes but essentially still the same code, filling a buffer, a sprite buffer ( here very simplified ), and transfer buffer in А000:0000.

PS: Not very cool coder, ie not at all, just learning!
by | 7 views

1 Answer

0 like 0 dislike
just do a bunch of weirdness

In put_sprite draw and forgot to do cld before the beginning of the cycle to di stosb increased. Well, if it is decided to use string instructions, why not lodsb/stosb, movsb or not, or no rep movsb or rep movsw not even?
by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
2 answers
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
asked Apr 13, 2019 by vitalik04
0 like 0 dislike
1 answer
110,608 questions
257,186 answers
0 comments
35,406 users