Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

this is assembly language for x86 processors Write a program that displays a sin

ID: 3830766 • Letter: T

Question

this is assembly language for x86 processors

Write a program that displays a single character in all possible combinations of foreground and background colors (16 X 16 = 256). The colors are numbered from 0 - 15, so you can use a nested loop to generate all possible combinations.

Step 1: Go to the following site and choose the first option from this website to get access to the Irvine32 lib files.
http://www.kipirvine.com/asm/examples/

Step 2: Write your code with the following lines on top

;Your heading including
;Your name
;The assignment prompt

includelib C:IrvineKernel32.Lib
includelib C:IrvineUser32.Lib
includelib C:IrvineIrvine32.lib
include Irvine32.inc

Step 3: Complete the code and turn in the .asm file

Explanation / Answer

INCLUDE Irvine32.inc

.data

.code

start PROC

    mov     ecx, 16

mov        ebx, 0

loopi:

push     ecx

mov     ecx, 16

loopj:

mov        eax, ebx

call    SetTextColor

mov        al, 65

call    WriteChar

inc        ebx

loop loopj

call    Crlf

pop        ecx

loop loopi

mov        eax, 15+0*16   ; black = 0, white = 15

call    SetTextColor   ; background*16 + foreground

invoke    ExitProcess, 0

start ENDP