const k320 : word = 320; var d, k, dc, x0, x1, y0, y1 : word; rezim : byte; screen : byte absolute $A000:$0000; label bressenham, bres_next, bres_loop, bres_abs; begin fillchar (screen, 64000, 0); asm mov AX, 0A000h mov ES, AX mov AH, 0Fh int 10h mov [rezim], AL mov AX, 13h int 10h mov [x0], 200 mov [y0], 0 mov [x1], 0 mov [y1], 200 mov BL, 15 call bressenham mov AH, 8 int 21h mov AX, 04C00h int 21h bressenham: mov CX, [y1] sub CX, [y0] push CX neg CX mov [dc], CX neg CX shl CX, 1 mov [d], CX mov SI, 1 mov DX, [x1] sub DX, [x0] jnc bres_abs neg DX neg SI bres_abs: shl DX, 1 mov [k], DX mov AX, [y0] mul [k320] add AX, [x0] pop CX bres_next: mov DI, AX mov [ES:DI], BL add AX, 320 mov DX, [k] add [dc], DX jnc bres_loop mov DX, [d] sub [dc], DX add AX, SI bres_loop: loop bres_next ret end; end.