RSS Forums RSS

I need help with matrix color

Please support our Assembly advertiser: Programming Forums
Reply
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

  #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 12:36 pm. Reason: Added code tags
Attached Files
File Type: doc problem.doc (446.5 KB, 1 views)
AddThis Social Bookmark Button
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.



Views: 358 | Replies: 0 | Currently Viewing: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 2:56 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC