Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I Wrote an assembly program that displays the same string in four different colors, using a loop. Call the Set- TextColor procedure from the books

I Wrote an assembly program that displays the same string in four different colors, using a loop. Call the Set- TextColor procedure from the books link library. Any colors may be chosen, but you may find it easiest to change the foreground color, but I don't get correct output. Please help me. this is my code;

INCLUDE Irvine32.inc INCLUDELIB Irvine32.lib

; these two lines are only necessary if you're not using Visual Studio INCLUDELIB kernel32.lib INCLUDELIB user32.lib

.data message BYTE "Hello World!",0 colorArray DWORD 0x01, 0x02, 0x04, 0x0E ; change foreground color

.code main PROC mov ecx, 4 ; loop counter mov esi, 0 ; index for color array

loopStart: call SetTextColor ; set text color mov eax, colorArray[esi] ; get current color call SetTextColor ; set current color

; display message mov edx, OFFSET message call WriteString

add esi, 4 ; increment color array index loop loopStart ; repeat loop

exit main ENDP

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advanced Database Systems For Integration Of Media And User Environments 98

Authors: Yahiko Kambayashi, Akifumi Makinouchi, Shunsuke Uemura, Katsumi Tanaka, Yoshifumi Masunaga

1st Edition

9810234368, 978-9810234362

More Books

Students also viewed these Databases questions

Question

2. Show the trainees how to do it without saying anything.

Answered: 1 week ago