The loader works in virtual reality and on real hardware no what to do where is the error?

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
Write to real time ( such as he called )

So from the source:
#make_boot# org 7c00h use16 jmp start e: mov ax,cs mov ds,ax mov es,ax ret put_pix: push ax push dx mov ax,8000h mov es, ax mov ax,320 mul cx pop dx add ax,dx mov di,ax pop ax stosb ret fill_disp: push ax mov ax,8000h mov ds,ax pop ax mov ah,al mov bx,0000h mov [bx],ax p0: add bx,2 mov [bx],ax cmp bx,0FFFEh jz e jmp p0 e_draw: pop dx pop bx mov [x],dx mov [y],bx ret draw_sprite_nexline: inc si mov al,00h cmp al,[bx+si] jz e_draw dec si add [y],01h mov ax,[x_ret] mov [x],ax inc si jmp draw_sprite_1 draw_sprite: mov ax,bx mov dx,[x] mov bx,[y] push bx push dx mov bx,ax mov ax,[x] mov [x_ret],ax mov si,0000h draw_sprite_1: mov ax,8000h mov es, ax mov ax,320 mov cx,[y] mul cx mov dx,[x] add ax,dx mov di,ax mov al,[bx+si] cmp al,255 jz draw_sprite_2 stosb draw_sprite_2: inc si mov al,00h cmp al,[bx+si] jz draw_sprite_nexline add [x],1 jmp draw_sprite_1 draw_display: mov di,0000h mov bx,0000h mov si,0000h mov ax,8000h mov ds,ax mov ax,0A000h mov es,ax draw_display_1: cmp bx,0FFFFh jz draw_display_2 mov al,[bx] stosb inc bx jmp draw_display_1 draw_display_2: jz e left_sprite: sub [x],01h jmp p3 right_sprite: add [x],01h jmp p3 start mov ah, 0 mov al, 13h int 10h mov al,40 ;call fill_disp mov di,0000h mov si,0000h mov bx,sprite ;call draw_sprite p4: mov ah,01h int 16h jz p7 mov ah,00h int 16h cmp al,'a' jz left_sprite cmp al,'d' jz right_sprite p7: p3: mov di,0000h mov si,0000h mov al,60 call fill_disp mov di,0000h mov si,0000h mov bx,sprite call draw_sprite call draw_display jmp p4 x_ret dw 0 x dw 5 y dw 5 sprite db 30,30,30,30,30,0,30,30,30,30,30,0,30,30,30,30,30,0,30,30,30,30,30,0,30,30,30,30,30,0,30,30,30,30,30,0,0,0

In fact it is implemented, fill screen, create sprites, and that is not flickered created a second buffer through which it already displayed on the screen, And Yes it is a miracle works in virtual reality and I was able to write the piece of code and everything I thought.. Launched without emulatie in the gland, and there began then a black screen, then a bunch of different pixels, as the Bhutto climbed on some used piece of code.. And I don't really know where to find Pamyat for the second video buffer, I thought that his vobshe not, but I answered.

320x200 is 64 KB, not 64 MB as you wrote above.
if you use real mode you available 1MB - no need to write about 64 MB.
half of 1 MB is about 500 KB. I can fit 7-8 buffers at 64 KB.

I already changed a couple of times finding the buffer and nothing happens. Tell me what and how?
by | 10 views

1 Answer

0 like 0 dislike
without calling into question the appropriateness of the training (there are people and useless Hobbies), I can not mention the stupidity of the methodology.

to teach myself assembler, learn to write the bootloader and learn how to draw graphics - three different things. why do you all complicate, mix everything together and trying to understand again?

booth sector does not have anything to draw, his task is to load and initialize the primary boot loader and pass control.

to write ASM in real mode (addressing, not the time) the easiest way of collecting the DOS com-files running in the virtual DOS machine, some old Windows (like winXP), and when debugging some kind of a DOS debugger (like turbo debugger). walk step by step once your code and immediately understand what is wrong.

if the difficulty is at the same time and not knowing the architecture (such as the question about memory), and ignorance of the assembler, it is possible to first deal with memory allocation and the basic techniques of working with graphics (like the same double-buffering), the slightly higher-level language like C without using standard library. having formed an idea of what you need to do to rewrite it in Assembly language will be much easier. moreover, it can be done in parts - a separate function to replace the assembler inserts that will give the opportunity to compare the results of the work small areas sichnego and asmolovo code.

then, when you write your graphic piece, we will make a simple loader for it, and you will be happy.

Related questions

0 like 0 dislike
1 answer
asked Apr 13, 2019 by vitalik04
0 like 0 dislike
2 answers
0 like 0 dislike
1 answer
asked May 20, 2019 by isawillbenice
0 like 0 dislike
1 answer
asked May 23, 2019 by pepl213
110,608 questions
257,187 answers
40,796 users