.model small .586 .stack 100h .data row db 0 ;;initially at row 0 col db 0 ;;initially at col 0 attr db 0 ;; initial attribute .code extern Clrscr:proc ;program will use BIOS 10h, function 9 to display ;the letter 'A' with all possible attributes. main proc mov ax,@data mov ds,ax call Clrscr ;clear screen lp1: xor al,al mov col,al lp2: call setcur ; set cursor at row/col mov al,'A' mov bl,attr call wchar inc attr ; increment the attribute inc col cmp col,16 ; at column 16? jne lp2 inc row cmp row, 16 ; at row 16? jne lp1 call setcur Mov ax, 4c00h ;exit Int 21h Main endp setcur proc mov ah,2 ;use BIOS 10h to set cursor mov dh,row ; row position mov dl,col ; column position mov bh,0 int 10h ret setcur endp ;BIOS write character to page 0. Attribute in BL, char in AL wchar proc mov ah,9 mov bh,0 mov cx,1 ;write only 1 time int 10h ret wchar endp end main