flat assembler
Message board for the users of flat assembler.

Index > DOS > Colored String Output

Author
Thread Post new topic Reply to topic
TDCNL



Joined: 25 Jan 2006
Posts: 56
TDCNL 08 Apr 2006, 19:13
Hey,

I've been searching around in the DOS stuff on this forum, and I've learned some basics of DOS now.

Now I searched for this too, but I didn't really find it, my question is:

How can I output a string with a specified color in DOS? (or with BIOS int)
Just like this:

Code:
mov ah,9 ;int service 9
mov dx,text ;offset to text
int 21h

;but then with colored string output?
    


Thnx Smile

_________________
:: The Dutch Cracker ::
Post 08 Apr 2006, 19:13
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8357
Location: Kraków, Poland
Tomasz Grysztar 08 Apr 2006, 19:18
These simple routines are from the "kelvar" example (you can find it in the "Examples" section of this website):
Code:
display_character:
; al = character
; bl = color
        xor     bh,bh
        mov     cx,1
        mov     ah,9
        int     10h
        mov     ah,0Eh
        int     10h
        ret
display_text:
; ds:si - text
; bl = color
        xor     bh,bh
        mov     cx,1
      .display:
        lodsb
        or      al,al
        jz      .end
        cmp     al,0Dh
        je      .type
        cmp     al,0Ah
        je      .type
        mov     ah,9
        int     10h
      .type:
        mov     ah,0Eh
        int     10h
        jmp     .display
      .end:
        ret    
Post 08 Apr 2006, 19:18
View user's profile Send private message Visit poster's website Reply with quote
TDCNL



Joined: 25 Jan 2006
Posts: 56
TDCNL 08 Apr 2006, 20:26
Yes I've looked at the kelvar with a bootup floppy, very nice engine you wrote Tomasz Smile

Thanks for the little code snippet, I'm going to experiment. (I'm new to DOS, before I only programmed in Win32) Smile

_________________
:: The Dutch Cracker ::
Post 08 Apr 2006, 20:26
View user's profile Send private message Reply with quote
TDCNL



Joined: 25 Jan 2006
Posts: 56
TDCNL 09 Apr 2006, 13:48
I've sorted the INT 10h out now with the Ralph Brown Interrupt list, now I completely understand the routine Smile

Thanks again Tomasz Very Happy

_________________
:: The Dutch Cracker ::
Post 09 Apr 2006, 13:48
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.