Friday, January 25, 2013

Assembly Code Using 10h for Graphical Display (American Flag)


'just copy the code and paste it on your notepad or command prompt editor (must be inside the directory wherein tasm and tlink IDE located then type this command --->  edit <filename>.asm ) . You can modify it because I think the number of stars on the flag was wrong.

+----------------SAMPLE OUTPUT----------------+

+------------------------------------------------------+


.model small
.stack 100h
.data
        newl db,0ah,0dh,"$"
        line1 db " * * * * * * * * $"
        color1 db "                                       $"
        line2 db " * * * * * * * * $"
        color2 db "                                       $"
        line3 db " * * * * * * * * $"
        color3 db "                                       $"
        line4 db " * * * * * * * * $"
        color4 db "                                       $"
        line5 db " * * * * * * * * $"
        color5 db "                                       $"
        line6 db " * * * * * * * * $"
        color6 db "                                       $"
        line7 db " * * * * * * * * $"
        color7 db "                                       $"
        line8 db " * * * * * * * * $"
        color8 db "                                       $"
        stripes1 db "                                                                        $"
        stripes2 db "                                                                        $"
       

.code
        mov ax,@data
        mov ds,ax

mov ah,9

mov bl,00011111b
mov cx,30
int 10h
mov dx,offset line1
int 21h
mov bl,11110000b
mov cx,40
int 10h
mov dx,offset color1
int 21h
mov dx,offset newl
int 21h

mov bl,00011111b
mov cx,30
int 10h
mov dx,offset line2
int 21h
mov bl,41h
mov cx,40
int 10h
mov dx,offset color2
int 21h
mov dx,offset newl
int 21h

mov bl,00011111b
mov cx,30
int 10h
mov dx,offset line3
int 21h
mov bl,11110000b
mov cx,40
int 10h
mov dx,offset color3
int 21h
mov dx,offset newl
int 21h

mov bl,00011111b
mov cx,30
int 10h
mov dx,offset line4
int 21h
mov bl,41h
mov cx,40
int 10h
mov dx,offset color4
int 21h
mov dx,offset newl
int 21h

mov bl,00011111b
mov cx,30
int 10h
mov dx,offset line5
int 21h
mov bl,11110000b
mov cx,40
int 10h
mov dx,offset color5
int 21h
mov dx,offset newl
int 21h

mov bl,00011111b
mov cx,30
int 10h
mov dx,offset line6
int 21h
mov bl,41h
mov cx,40
int 10h
mov dx,offset color6
int 21h
mov dx,offset newl
int 21h

mov bl,00011111b
mov cx,30
int 10h
mov dx,offset line7
int 21h
mov bl,11110000b
mov cx,40
int 10h
mov dx,offset color7
int 21h
mov dx,offset newl
int 21h

mov bl,00011111b
mov cx,30
int 10h
mov dx,offset line8
int 21h
mov bl,41h
mov cx,40
int 10h
mov dx,offset color8
int 21h
mov dx,offset newl
int 21h

mov cx,8

meme:
push cx
mov bl,11110000b
mov cx,57
int 10h
mov dx,offset stripes1
int 21h
mov dx,offset newl
int 21h
mov bl,41h
mov cx,57
int 10h
mov dx,offset stripes2
int 21h
mov dx,offset newl
int 21h
pop cx
dec cx
cmp cx,0
je exit
loop meme

exit:
mov ax,4c00h
int 21h
end

6 comments:

  1. may iba kapang ganyan kuya ? please pingi po
    .

    ReplyDelete
    Replies
    1. Hello po wala na po eh hehehe sorry

      Delete
    2. ok lang po nakagawa naman ako xd dali lang pala ^_^

      Delete
    3. kuya paturo naman po pano gumawa gaya nitong website nyopo please

      Delete
    4. Hello! blogspot lang po sir :) ...

      Delete
  2. Guys may sample kayo ng afghanistan flag?

    ReplyDelete