Results 1 to 3 of 3

Thread: Printing string

  1. #1
    ChimpFace9000
    Guest

    Post Printing string

    How do i print a string with a bright white forground and bright blue background? Also, how do i print a string without moving the cursor?

  2. #2
    Junior Member
    Join Date
    Jun 2000
    Posts
    28
    the best way to do both of those things is to put the string into memory yourself
    it starts at b800:0000 - even bytes are chars and odd bytes are attributes
    so, for instance, to put the char '$' in the top left with bright white on blue:
    Code:
    ; es:di = location of string
    mov al,'$'
    mov ah,01Fh
    ; the 1 means blue, the F means bright white
    ; bits 0-3 = foreground, 4-7 = background
    stosw

  3. #3
    Fanatic Member
    Join Date
    Jan 2003
    Posts
    1,004
    You should use the REP statement in conjunction with the STOSW for the length of the string to quickly display the string to the screen if the string is more than one character.

    NOTE: Make sure you multiply the length by 2 before you "machine gun" it to the screen.
    "Can't" and "shouldn't" are two totally separate things.

    All questions should be answered. All answers should be true. That is why I post.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width