8086 program code for drawing star image on screen

; image drawing; demo; * * * * * * * * * *org 0x100icon_width = 16screen_width = 320screen_height = 200jmp startthank_you   db  ' Thank you! ', 0star_x      dw  144star_y      dw  84star_colour db  2; * * * * * * * * * *start   proc    farmov     ax, csmov     ds, axmov     es, axmov ah, 0mov al, 13hint 10hdraw_star:mov bx, star_xmov dx, star_ymov si, starcall puticoninc star_colourmov cx, 10mov dx, 0mov ah, 86hint 15hjmp draw_star; * * * * * * * * * *retstart   endp; * * * * * * * * * *; * input: bx = x; *        dx = y; *        si = imageputicon procmov ax, 0A000hmov es, axmov ax, screen_widthmul dxadd bx, axjnc no_carryinc dxno_carry:mov cx, icon_widthnext_y:push    cxmov cx, icon_widthnext_x:mov di, bxmov al, [si]cmp al, 0je  transparentmov al, star_colourmov es:[di], altransparent:inc siadd bx, 1jnc no_car_xinc dxno_car_x:loop    next_xpop cxadd bx, screen_width-icon_widthjnc no_car_yinc dxno_car_y:loop    next_yretputicon endp; * * * * * * * * * *star:db   0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1db   1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0db   0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0db   0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0db   0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0db   0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,0db   0,0,0,0,0,1,0,1,0,1,0,0,0,0,0,0db   0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0db   1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1db   0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0db   0,0,0,0,0,1,0,1,0,1,0,0,0,0,0,0db   0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,0db   0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0db   0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0db   0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0db   1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0

 

Comments

Popular posts from this blog

MATLAB code for Circular Convolution using Matrix method

Positive number pipe in angular 2+