65d ; Example of how to write directly to screen memory, instead of ; using the *slow* BIOS function calls jmp start scrmem dd 0B800:00000 str_1: db 'This is a test of writing directly to screen' length equ $-str_1 col db 0 row db 0 start: call clrscr ;Clear Screen mov cx,20 mov dx,0 by 10 again: push cx mov bl,1EH ;Attribute mov si,str_1 ;Address of string mov cx,length ;Length of string call write_str inc dh ;One row down pop cx loop again ;Next string mov ah,00H ;Wait for key int 16H call clrscr ;Clear screen int 20H ;Exit to DOS write_str: push dx push si push es les bp,scrmem sub ax,ax mov al,dh mov dh,160 ;Each row has 160 bytes... mul dh shl dl,1 add al,dl mov di,ax lp: movsb ;First the character... es mov b[bp+di],bl ;then the attribute byte inc di loop lp pop es pop si pop dx ret clrscr: push es les bp,scrmem mov di,0 mov cx,2000 clr: es mov b[bp+di],0 inc di es mov b[bp+di],07H inc di loop clr pop es ret . 0