-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathColors.asm
executable file
·61 lines (42 loc) · 1.12 KB
/
Colors.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
TITLE SetColor and WriteColorChar
INCLUDE Irvine32.inc
SetColor PROTO forecolor:BYTE, backcolor:BYTE
WriteColorChar PROTO char:BYTE,forecolor:BYTE, backcolor:BYTE
.data
.code
main PROC
INVOKE WriteColorChar, 'A', white, blue
INVOKE WriteColorChar, 'B', blue, white
INVOKE WriteColorChar, 'C', green, black
INVOKE WriteColorChar, 'D', yellow, gray
INVOKE SetColor, lightGray, black
call Crlf
exit
main ENDP
WriteColorChar PROC
pop ebp
pop ecx
pop ebx
pop eax
push eax
push ebx
push ecx ;
call SetColor
call WriteChar
ret
WriteColorChar ENDP
SetColor PROC
push ebp
mov ebp, esp
mov ecx, [ebp + 16]
mov eax, [ebp + 12]
mov ebx, 16
mul ebx
add ecx, eax
mov eax, ecx
call SetTextColor
mov eax, [ ebp + 8 ]
pop ebp
ret
SetColor ENDP
END main