Page 2 of 2

Posted: Fri Feb 02, 2007 4:24 am
by pcmattman
Um... The code you gave me doesn't work in my system. I am not using VESA, I'm using Mode 13 (which is 320x200x1bpp). Your character output functions don't work, unless I have them seperate of my OS and unusable :( .

Posted: Fri Feb 02, 2007 5:35 am
by Combuster
well, first of all, its 320x200x8bpp (bpp = BITS per pixel). And i think you have enough information by now to write your own routines for the job.

Still, you can try this (untested)

Code: Select all

; SI -> address of font in DS (8 bytes of data)
; DI -> address in video memory (in ES) to start writing
; destroyed: ax, cx, dx, si, di

printchar:    
    mov cl, 8         ; 8 character rows
loop1:
    lodsb             ; load font data
    mov dl, al        ; move data

      mov ch, 8       ; second counter in ch
loop2:
      shr dx, 1       ; pop a bit into CF
      sbb al, al      ; load al with 0 on background, ff on foreground
      and al, 15      ; use color #15 for foreground
      stosb           ; poke a byte to video memory
      dec ch          ; decrement second counter
      jnz loop2       ; loop if more      

    add di, (320 - 8) ; go to the next scanline
    dec cl            ; decrement first counter
    jnz loop1         ; continue with next scanline if not done
    ret

Posted: Fri Feb 02, 2007 12:16 pm
by Dex
You can also do it like this :

Code: Select all

	   org	100h ; com file

	   mov	ax,0013h ;set graphic mode 13h
	   int	10h

	   mov	ah,13h ; request display string
	   mov	al,00 ; set sub function
	   mov	bx,0x0064 ; set attribute and page number
	   mov	cx,12 ; number of letters
	   mov	dl,1 ; screen colum
	   mov	dh,2 ; screen row
	   mov	bp,string ; address vof string es:bp
	   int	10h ; call int

	   xor	ax,ax ; wait for keypress
	   int	16h

	   mov	ax,0003h ; set text mode
	   int	10h
	   ret ; return


string: db "Hello world!"  ;string
But you may not like the look ;).

Posted: Fri Feb 02, 2007 5:51 pm
by pcmattman
I'll give it a go and post whether or not it worked.