View Single Post
Join Date: Dec 2008
Posts: 1
Reputation: Angelina01 is an unknown quantity at this point 
Solved Threads: 0
Angelina01 Angelina01 is offline Offline
Newbie Poster

I need help with matrix color

 
0
  #1
Dec 5th, 2008
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.

  1. INCLUDE Irvine32.inc
  2. .data
  3. text BYTE "Hello!"
  4. .code
  5. main PROC
  6.  
  7. ;mov ecx,17
  8. mov cx,17
  9. mov ch,1
  10. mov cl,4 ; right
  11. L1:
  12. mov ax,blue
  13. mov ax,cx
  14. call setTextColor
  15. mov ah,ch
  16. ;dec ah
  17. call setTextColor
  18. mov al,cl
  19. call setTextColor
  20. ;mov ax,cx + (blue*27)
  21. call setTextColor
  22. ;mov eax,ecx
  23. ;call setTextColor
  24. mov edx,offset text
  25. call writeString
  26. loop L1
  27. exit
  28. main ENDP
  29. END main
Last edited by cscgal; Dec 5th, 2008 at 1:36 pm. Reason: Added code tags
Attached Files
File Type: doc problem.doc (446.5 KB, 3 views)
Reply With Quote