include irvine16.inc .data snakestart dw ? forecolor byte 0ffh;;white backcolor byte 01010101b;;bluegreen Video equ 0b800h .code start proc mov ax, @data mov ds, ax mov ax, Video mov es, ax cld ;;;forward ;set to medium resolution mov ax, 4 int 10h background: mov di, 07D0h mov cx, 6000 mov al, backcolor rep stosb mov di, 27D0h mov cx, 6000 rep stosb mov snakestart, 1C20h mov ecx,30 top: movzx edi, snakestart mov al,forecolor ;;;white call draw_snake mov eax, 1000 call delay mov al,backcolor movzx edi, snakestart call draw_snake ; mov eax, 10000 ;call delay inc snakestart loop top mov ah, 1 int 21h mov ax, 2 int 10h mov ax, 4c00h int 21h start endp draw_snake proc uses ecx edi ;draw even lines (bottom) push edi mov ecx, 14 rep stosb pop edi push edi add edi,80 mov ecx, 14 rep stosb ;draw odd lines (bottom) pop edi add edi, 2000h push edi mov ecx, 14 rep stosb pop edi add edi,80 mov ecx, 14 rep stosb ret draw_snake endp end start