The ShowAllColors Procedure. Make a procedure to show all of the text color combinations. Use EAX for
Question:
The ShowAllColors Procedure. Make a procedure to show all of the text color combinations. Use EAX for this. Choose a message to print (it can be anything: your name, your favourite food, etc.) You do not need to input the string from the user at this point. Set ECX to 256, and EAX to zero. Preserve all General-Purpose registers and the flags. Loop on the following:
(a) Set the text color (using SetTextColor)
(b) Print your message
(c) Carriage Return, Line Feed (using CrLf, or add 0Dh, 0Ah to your string)
(d) Increment EAX (using INC) ADD EAX, 1
(e) Exchange EAX and EBX, or push EAX to the stack
(f) Set the text color to black (set EAX = 0 and CALL SetTextColor)
(g) Delay for 50 msec (0.05 seconds, using Delay)
(h) Exchange EAX and EBX again, or pop EAX from the stack
(i) Loop At the end of your function before returning, set the colour to grey text on black (value 07h).
Be sure to push and pop EAX, EBX, ECX and the flags to preserve their values! Your procedure should assume that the string offset is in the EDX register before it begins
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill