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


start:
    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

    xor si, si
    mov cx, 69
    
    mov ax, 0a000h
    mov es, ax
    xor di, di
    
    xor bp, bp
    cld

decode_loop:
    push cx
    
    mov al, ds:[bx+si]
    inc si
    mov ah, al

    mov dl, al
    shr dl, 4
    
    cmp dl, 0
    je color_white
    cmp dl, 1
    je color_black
    cmp dl, 2
    je color_red
    mov dl, 14
    jmp get_count

color_white:
    mov dl, 15
    jmp get_count
color_black:
    mov dl, 0
    jmp get_count
color_red:
    mov dl, 4

get_count:
    and ah, 0fh
    xor ch, ch
    mov cl, ah
    inc cl

    mov al, dl
    mov ah, dl

draw_pixel_loop:
    stosw
    mov es:[di+318], ax
    
    inc bp
    cmp bp, 22
    jne skip_newline
    
    xor bp, bp
    add di, 276
    add di, 320

skip_newline:
    loop draw_pixel_loop

    pop cx
    loop decode_loop

    hlt