fastest way to put a string on the screen?

Hello,
I am writing an assembly proc to put a text string on the screen without using int 21h and I'm looking for the fastest way to do it.
These two procedures are doing the job, but I want to know which one is faster, and maybe there is a faster way? The only specification is that it needs to run using BIOS commands, no DOS interrupts.
textOut1 proc
mov ax,@data
mov es,ax
mov bp,offset msg
mov ah,13h
mov al,1
mov bx,5
mov cx,12
mov dl,0
mov dx,0
int 10h
ret
textOut1 endp

textOut2 proc
mov ax,0b800h
mov es,ax
mov ax,@data
mov ds,ax
mov ah,3
mov cx,12
mov si,offset msg
xor di,di
;xor si,si ;shouldnt be here
WriteChar:
lodsb
stosw
loop WriteChar
ret
textOut2 endp
[852 byte] By [someuser77] at [2007-11-20 11:07:43]
# 1 Re: fastest way to put a string on the screen?
Hi Someuser77,

As far as I know, writing directly to memory is the fastest way to print text on the screen. This is because only one MOV|STOSx opcode is needed, while routine called through INT 10h contains a higher number of opcodes (simply by stack operations of pushing address, return code and the like).

There might be something wrong in the code for textOut2: three lines before label WriteChar you have mov si,offset msg and two lines below, the program resets "si" register before starting loop. You may want to remove line xor si,si

Best regards,

Iaki Viggers
iviggers at 2007-11-10 3:55:11 >
# 2 Re: fastest way to put a string on the screen?
oops. my bad. thanks iviggers!
I guess I'll use 0b800h.
someuser77 at 2007-11-10 3:56:04 >