screen = 2000 ;the number of blocks on the screen delay = 100 ;the amount of delay, used in Wait1 .model small .stack 100h .data .code ;*********************MAIN initialize: mov ax,@data ;program initialization: set @data, set mode text screen mov ds,ax mov ax,0b800h mov es,ax mov ax,3 int 10h main: mov al,11h ;will cause ColorScreen to fill the screen with ASCII call ColorScreen call Wait1 ;wait 100 mov al,20h ;will cause ColorScreen to fill the screen with attribute 20h call ColorScreen call Wait1 ;wait 100 mov al,0 ;will cause ColorScreen to clear out the screen of value and attribute call ColorScreen call Wait1 ;wait 100 mov al,11h ;will cause ColorScreen to fill the screen with ASCII call ColorScreen finish: mov ah,4ch ;program termination - return control to OS int 21h ;********************** Wait1: mov cx,delay ;this function waits for the amount of time delay has been set to waitAgain: loop waitAgain ret ColorScreen:cmp al,0 ;checks value of al to activate specific commands je zeroScreen ;al = 0: calls zeroScreen cmp al,11h je fullScreen ;al = 11h: calls fullScreen normalScreen: ;colors the entire screen with the given al attribute mov bx,1 mov cx,screen NSLoop: mov es:[bx],al add bx,2 loop NSLoop ret fullScreen: mov bx,0 ;fills the entire screen with ASCII mov cx,screen mov ah,0 FSLoop: mov es:[bx],ah add ah,1 add bx,2 loop FSLoop ret zeroScreen: mov bx,0 ;clears the entire screen of value and attribute mov cx,screen ZSLoop: mov es:[bx],al mov es:[bx+1],7 add bx,2 loop ZSLoop ret end