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


;!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 byte ptr ds:[bx]+69,000h
mov byte ptr ds:[bx]+70,000h
mov byte ptr ds:[bx]+71,013h
mov byte ptr ds:[bx]+72,000h
mov byte ptr ds:[bx]+73,020h
mov byte ptr ds:[bx]+74,016h
mov byte ptr ds:[bx]+75,020h
mov byte ptr ds:[bx]+76,000h
mov byte ptr ds:[bx]+77,013h
mov byte ptr ds:[bx]+78,000h
mov byte ptr ds:[bx]+79,000h
mov byte ptr ds:[bx]+80,012h
mov byte ptr ds:[bx]+81,001h
mov byte ptr ds:[bx]+82,021h
mov byte ptr ds:[bx]+83,016h
mov byte ptr ds:[bx]+84,021h
mov byte ptr ds:[bx]+85,001h
mov byte ptr ds:[bx]+86,012h
mov byte ptr ds:[bx]+87,000h
mov byte ptr ds:[bx]+88,001h
mov byte ptr ds:[bx]+89,002h
mov byte ptr ds:[bx]+90,020h
mov byte ptr ds:[bx]+91,000h
mov byte ptr ds:[bx]+92,015h
mov byte ptr ds:[bx]+93,020h
mov byte ptr ds:[bx]+94,002h
mov byte ptr ds:[bx]+95,002h
mov byte ptr ds:[bx]+96,005h
mov byte ptr ds:[bx]+97,020h
mov byte ptr ds:[bx]+98,001h
mov byte ptr ds:[bx]+99,013h
mov byte ptr ds:[bx]+100,020h
mov byte ptr ds:[bx]+101,005h
mov byte ptr ds:[bx]+102,004h
mov byte ptr ds:[bx]+103,022h
mov byte ptr ds:[bx]+104,001h
mov byte ptr ds:[bx]+105,011h
mov byte ptr ds:[bx]+106,022h
mov byte ptr ds:[bx]+107,004h
mov byte ptr ds:[bx]+108,005h
mov byte ptr ds:[bx]+109,00fh

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
    mov ds:[di+2], ax
    add di, 4
    pop ax

    dec ch
    dec cl
    jnz draw_run

    cmp ch, 0
    jnz unpack_next_byte

    add di, 72
    dec dh
    jnz row_loop

hlt