943,627 Members | Top Members by Rank

Ad:
  • Assembly Discussion Thread
  • Unsolved
  • Views: 884
  • Assembly RSS
Dec 5th, 2008
0

I need help with matrix color

Expand Post »
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.

asm Syntax (Toggle Plain Text)
  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
Attached Files
File Type: doc problem.doc (446.5 KB, 28 views)
Last edited by cscgal; Dec 5th, 2008 at 1:36 pm. Reason: Added code tags
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Angelina01 is offline Offline
1 posts
since Dec 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Assembly Forum Timeline: Need help in LC# code
Next Thread in Assembly Forum Timeline: NEED HELP! (hex to decimal output)





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC