cr equ 13

lf equ 10

.model small

.code

                 public send_crlf

send_crlf proc

                 push ax

                 push dx

                 mov dl,cr ; send carrage return

                 mov ah,02h

                 int 21h

                 mov dl,lf ; send line feed

                 int 21h

                 pop dx

                 pop ax

                 ret

send_crlf endp

 

                public clear_screen

clear_screen proc

                push ax

                push bx

                push cx

                push dx

                xor al,al ; blank entire screen

                xor cx,cx ; top corner is (0,0) ch:row,cl:column

                mov dh,24 ; bottom column

                mov dl,79 ; bottom column

                mov bh,7

                mov ah,06h

                int 10h ; call video service

                pop dx

                pop cx

                pop bx

                pop ax

                ret

clear_screen endp

 

                public goto_xy

                ;on entry dh,dl contains the row,col to goto

goto_xy proc

                push ax

                push bx

                mov bh,00h ;display page 0

                mov ah,02h ; service number

                int 10h

                pop bx

                pop ax

                ret

goto_xy endp

 

                public cursor_right

cursor_right proc

                push ax

                push bx

                push cx

                push dx

                mov ah,3

                mov bh,0

                int 10h

                mov ah,2

                inc dl

                cmp dl,79

                jbe ok

                call send_crlf

                jmp done

ok:             int 10h

done:           pop dx

                pop cx

                pop bx

                pop ax

cursor_right endp

 

                end