What's wrong with the line drawing program

This error is
This is my 800*600*24 mode
It is expected to be from to 200 place to draw a straight line
But the painting is a bunch of zero zero odd point
Do not know where is the wrong


org 0100h

mov ax,4f02h
mov bx,4115h
int 10h
mov ax,0a000h
mov es,ax
mov ax,0002h
mov ds,ax

mov ax,0
mov [ds:0004h],ah
mov [ds:0005h],al
mov ax,100
mov [ds:0006h],ah
mov [ds:0007h],al

mov ax,0
mov [ds:0009h],ah
mov [ds:000Ah],al

loop1:
mov ah,[ds:0009h]
mov al,[ds:000Ah]
add ax,1
mov [ds:0009h],ah
mov [ds:000Ah],al

mov [ds:0004h],ah
mov [ds:0005h],al

mov cl,0
mov [ds:0008h],cl

loop2:
mov ah,[ds:0004h]
mov al,[ds:0005h]
mov bx,2400d
mul bx
mov [ds:0000h],dh
mov [ds:0001h],dl
mov [ds:0002h],ah
mov [ds:0003h],al

mov cx,ax
mov ax,dx
mov cl,4
shl eax,cl
mov ax,cx
mov ecx,0
mov ch,[ds:0006h]
mov cl,[ds:0007h]
add eax,ecx
add eax,ecx
add eax,ecx

add eax,[ds:0008h]

mov bx,ax
mov [ds:0002h],bh
mov [ds:0003h],bl
mov cl,4
shr eax,cl
mov bx,ax
mov [ds:0000h],bh
mov [ds:0001h],bl
mov ax,4f05h
mov bh,bl
int 10h

mov bh,[ds:0002h]
mov bl,[ds:0003h]
mov di,bx

mov word [es:di],255d

mov bh,[ds:0008h]
add bh,1
mov [ds:0008h],bh

cmp bh,3
jnz loop2

mov bh,[ds:0009h]
mov bl,[ds:000Ah]
cmp bx,200
jnz loop1

jmp $

Started by Mercedes at January 06, 2017 - 3:19 PM

In addition, as follows:

{Memory layout, the sum of 00020000-00020003: 00020004-00020005: row 00020006-00020007: column 00020008: color number 00020009-0002000A: loop variables}

Adjust the display mode
Set the initial line, column
Initial set of loop variables
[Circulating markers 1
The loop variable +1
The number of rows = loop variables
Initial set of color number
[Circulating markers 2
Sum = sum + *2400
Sum = sum + column *3
Sum = sum + color number
Take 00020001 as a memory block label
Take 00020002-00020003 as the offset address
Write the color value 255
The number of color = color number +1
Judged by the color if the value is 3
]Not for three JMP back loop markers 2
To determine whether a variable is 200 cycle
]Not for 200 JMP back loop markers 1
Into the death cycle$

Posted by Mercedes at January 12, 2017 - 3:47 PM