Помогите с кодом
USE16
org 7C00h
CHNG_VIDEO_MODE:
mov ax, 13h
int 10h
mov ax, 0A000h
mov es, ax
BACKGROUND:
xor ax, ax
xor bx, bx
mov dl, 7h
DRAW_BACK:
call DRAW_PIX
inc ax
cmp ax, 0FA00h
jne DRAW_BACK
OLOLO:
push di
mov dl, 9h
mov di, FREE_SECTOR
mov word [cs:di], 1h
mov word [cs:di+2], 1h
mov word [cs:di+4], 140h
mov word [cs:di+6], 140h
call DRAW_LINE
xor ax, ax
int 16h
pop di
DRAW_LINE:
pusha
mov di, FREE_SECTOR ; offset of free space where all data stored
INIT_DIFFER: ; initialization
mov ax, [cs:di+4] ; ax = x2
mov bx, [cs:di] ; bx = x1
sub ax, bx ; ax -= bx
push ax ; pushing ax to stack
mov ax, [cs:di+6] ; ax = y2
mov bx, [cs:di+2] ; bx = y1
sub ax, bx ; ax -= bx
pop bx ; bx = last stack entry(prev ax)
push bx ; pushing it back again because we will need it later
shl ax, 4h ; multiply ax by 16
div bx ; to define k we need to divide y by x
mov [cs:di+8], ax ; saving K (ax) to free space
pop cx ; cx = difference between two xs
;
;
DRAWIT: ; begin to draw line by pixels
pusha ; save all registers
mov ax, cx ; ax = cx
mul word [cs:di+8] ; multiply by k to get y axis
shr ax, 4h ; delete 1/16 part of y axis
add word ax, [cs:di+2] ; getting real y by adding y we counted to y offset
mov bx, [cs:di] ; ax = x1(x offset)
add bx, cx ; bx - final x
call COUNT_REAL_COORDS ; and finaly draw point
popa ; restore registers after procedure calling
loop DRAWIT ; loop to DRAWIT while cx = 0
popa ; return to the program
ret
COUNT_REAL_COORDS: ;IN (ax - Y axis, bx - X axis) OUT (ax - number of pixel)
push ax
push bx
push dx
mov dx, 140h
mul dx ; multiply AX by 320 (cx value)
add ax , bx ; and add X ;
call DRAW_PIX ; calling draw pixel procedure
pop dx
pop bx
pop ax
ret
DRAW_PIX: ; IN (ax - number of pixel, dl - pixel color)
mov di, ax ; load Destination Index register with ax value (the coords to put the pixel)
mov [es:di], dl ; And we put the pixel
ret
FREE_SECTOR:
times 362 nop
db 55h, 0AAh
компилятор ФАСМ
коментарии на английском писал (лень язык переключать было)))
вот тут еще файлы - текст с предыдущими неудачными попытками процедуры DRAW_LINE и прочими...
малопонятная , не структурированная белиберда .