Загрузка данных


;!SaveMemory = True
mov byte ptr ds:[bx]+0,00fh
mov byte ptr ds:[bx]+1,005h
mov byte ptr ds:[bx]+2,004h
mov byte ptr ds:[bx]+3,010h
mov byte ptr ds:[bx]+4,00fh
mov byte ptr ds:[bx]+5,010h
mov byte ptr ds:[bx]+6,004h
mov byte ptr ds:[bx]+7,004h
mov byte ptr ds:[bx]+8,011h
mov byte ptr ds:[bx]+9,009h
mov byte ptr ds:[bx]+10,004h
mov byte ptr ds:[bx]+11,011h
mov byte ptr ds:[bx]+12,004h
mov byte ptr ds:[bx]+13,004h
mov byte ptr ds:[bx]+14,012h
mov byte ptr ds:[bx]+15,00eh
mov byte ptr ds:[bx]+16,012h
mov byte ptr ds:[bx]+17,004h
mov byte ptr ds:[bx]+18,004h
mov byte ptr ds:[bx]+19,01fh
mov byte ptr ds:[bx]+20,002h
mov byte ptr ds:[bx]+21,004h
mov byte ptr ds:[bx]+22,010h
mov byte ptr ds:[bx]+23,032h
mov byte ptr ds:[bx]+24,000h
mov byte ptr ds:[bx]+25,011h
mov byte ptr ds:[bx]+26,032h
mov byte ptr ds:[bx]+27,000h
mov byte ptr ds:[bx]+28,010h
mov byte ptr ds:[bx]+29,004h
mov byte ptr ds:[bx]+30,010h
mov byte ptr ds:[bx]+31,030h
mov byte ptr ds:[bx]+32,010h
mov byte ptr ds:[bx]+33,000h
mov byte ptr ds:[bx]+34,030h
mov byte ptr ds:[bx]+35,010h
mov byte ptr ds:[bx]+36,004h
mov byte ptr ds:[bx]+37,004h
mov byte ptr ds:[bx]+38,010h
mov byte ptr ds:[bx]+39,030h
mov byte ptr ds:[bx]+40,011h
mov byte ptr ds:[bx]+41,030h
mov byte ptr ds:[bx]+42,010h
mov byte ptr ds:[bx]+43,004h
mov byte ptr ds:[bx]+44,003h
mov byte ptr ds:[bx]+45,011h
mov byte ptr ds:[bx]+46,033h
mov byte ptr ds:[bx]+47,011h
mov byte ptr ds:[bx]+48,033h
mov byte ptr ds:[bx]+49,011h
mov byte ptr ds:[bx]+50,003h
mov byte ptr ds:[bx]+51,002h
mov byte ptr ds:[bx]+52,01fh
mov byte ptr ds:[bx]+53,002h
mov byte ptr ds:[bx]+54,001h
mov byte ptr ds:[bx]+55,01fh
mov byte ptr ds:[bx]+56,001h
mov byte ptr ds:[bx]+57,000h
mov byte ptr ds:[bx]+58,01fh
mov byte ptr ds:[bx]+59,000h
mov byte ptr ds:[bx]+60,000h
mov byte ptr ds:[bx]+61,01fh
mov byte ptr ds:[bx]+62,000h
mov byte ptr ds:[bx]+63,000h
mov byte ptr ds:[bx]+64,014h
mov byte ptr ds:[bx]+65,000h
mov byte ptr ds:[bx]+66,016h
mov byte ptr ds:[bx]+67,000h
mov byte ptr ds:[bx]+68,014h

mov si, 0
mov di, 0f600h
mov dh, 20

row_loop:
    cmp dh, 0
    je done
    mov ch, 22

run_loop:
    mov bh, ds:[si]
    inc si
    
    mov ah, bh
    shr ah, 1
    shr ah, 1
    shr ah, 1
    shr ah, 1
    
    cmp ah, 0
    je color_white
    cmp ah, 1
    je color_black
    cmp ah, 2
    je color_red
    mov dl, 0eh
    jmp get_count

color_white:
    mov dl, 0fh
    jmp get_count
color_black:
    mov dl, 00h
    jmp get_count
color_red:
    mov dl, 04h

get_count:
    mov cl, bh
    and cl, 0fh
    inc cl

draw_run:
    push ax
    mov al, 20h
    mov ah, dl
    mov ds:[di], ax
    add di, 2
    mov ds:[di], ax
    add di, 2
    pop ax
    
    dec ch
    dec cl
    jnz draw_run

    cmp ch, 0
    jnz run_loop

    add di, 72
    dec dh
    jmp row_loop

done:
    hlt