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


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

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

row_loop:
    mov ch, 22

unpack_next_byte:
    mov al, ds:[bx+si]
    inc si
    mov ah, al
    
    shr al, 4
    cmp al, 0
    je color_white
    cmp al, 1
    je color_black
    cmp al, 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:
    and ah, 0fh
    mov cl, ah
    inc cl

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

    dec ch
    dec cl
    jnz draw_run

    cmp ch, 0
    jnz unpack_next_byte

    add di, 116
    dec dh
    jnz row_loop

hlt