when i run code screen goes black why?
i thing this func set bkcolor and border in graphic mode then why
screen goes black,anything wrong in this code

.model small
.stack 64
.code
           
           
start:     

   
    mov ah,00  ;320x200x4
    mov al,04h
    int 10h
   
    mov ah,0bh ;
    mov bh,00  ;bk/border color
    mov bl,04h  ;red
    int 10h 

    and ah,0    ;wait
    int 16h
   
    mov ax,4c00h  ;exit
    int 21h

end start

Posted on 2006-06-03 03:49:05 by sihotaamarpal
Look at THIS ASM SOURCE for guidance.

In my opinion, if you want to set a "background color" in graphics mode, just create a function to write out the same color to all pixels on the screen.
Posted on 2006-06-03 05:19:52 by SpooK
hi spook
i try to use the func 0Bh in graphic mode,i try in text mode & got the good result means,it sets border color i specify but when i try in graphic mode as  specify it sets backcolor and border by using mention code ,the screen got black,i don;t know i specify red color.
  according to u i have to first fill the whole screen with pixels and then use this func
Posted on 2006-06-03 11:18:01 by sihotaamarpal
My first guess was the fact that you were setting the background color to "red" (04h), on a graphics mode that only has 4 colors (00h - 03h)... but I tested your program myself on DOSBox and I couldn't get the background mechanism to work with any color. I looked up the corresponding interrupt function, and it tends to favor actual CGA graphics cards... so here is a basic loop to fill all the pixels on the screen to a specified color instead...


;Set the background color
    xor dx,dx  ;Set Row to 0
row:
    xor cx,cx  ;Set Column to 0

column:
    mov ah,0ch ;Write Pixel
    mov bh,00  ;Page 0
    mov al,01h ;Color
    int 10h

    inc cx    ;Increment the Column

    cmp cx,320 ;Are we at the Column Max?
    jl column  ;If not, keep writing on this Row

    inc dx    ;Increment the Row

    cmp dx,200 ;Are we at the Row Max?
    jl row    ;If not, start writing on the next row


Hope this gives you an idea of what to do.

READ THIS in order to understand what the characteristics are of the mode you are trying to use.
Posted on 2006-06-03 16:47:56 by SpooK