DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   Assembly (http://www.daniweb.com/forums/forum125.html)
-   -   I need help with matrix color (http://www.daniweb.com/forums/thread160876.html)

Angelina01 Dec 5th, 2008 9:24 am
I need help with matrix color
 
1 Attachment(s)
Problem: Write a program that displays a single character in all possible combinations of foreground and background colors (16x16 = 256). The colors are numbered from 0 to 15, so you can use a nested loop to generate all possible combinations.

Here is what I tried, but it doesnot come out right. Could anyone help me, please?. I am a newbie at this language. :(

INCLUDE Irvine32.inc
.data
text BYTE "Hello!"
.code
main PROC
       
        ;mov ecx,17
        mov cx,17
        mov ch,1
        mov cl,4 ; right
L1:
        mov ax,blue
        mov ax,cx
        call setTextColor
        mov ah,ch
        ;dec ah
        call setTextColor
        mov al,cl
        call setTextColor
        ;mov ax,cx + (blue*27)
        call setTextColor
        ;mov eax,ecx
        ;call setTextColor
        mov edx,offset text
        call writeString
        loop L1
        exit
main ENDP
END main


All times are GMT -4. The time now is 10:10 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC