Repository navigation
Expand file tree
/
Copy pathescape-sequences.s
More file actions
42 lines (38 loc) · 1.57 KB
/
Copy pathescape-sequences.s
File metadata and controls
42 lines (38 loc) · 1.57 KB
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
/*
* This program demonstrates how HyperCPU can handle ANSI escape sequences [1].
* They can be used for displaying a colorful text or moving a cursor.
* String literals are used — see hello-world.s for details.
*
* Written by Ivan Movchan <ivan.movchan.07@gmail.com> in 2025.
*
* [1] https://en.wikipedia.org/wiki/ANSI_escape_code
*/
data:
.b8 "\e[1;37m";
.b8 "# # ####### ######## # #\n";
.b8 "# # # # # # # #\n";
.b8 "# # # # ######## ####### # ###### # # # # #\n";
.b8 "# # # # # # # # ## # # # # # #\n";
.b8 "######### # # # # # # # # ######## # #\n";
.b8 "# # # # # # ######## # # # # #\n";
.b8 "# # # # # # # # # # # #\n";
.b8 "# # # # # # # # # # # # # #\n";
.b8 "# # ######## ######## ####### # ####### # ####### \n";
.b8 " # #\n";
.b8 " # #\n";
.b8 " # # #\n";
.b8 " ####### #\n\n";
.b8 " https://hypercpu-project.github.io/ \n";
.b8 "\e[0m";
.b8 0u0;
.attr(entry) main:
mov x1, data;
print:
mov xlll2, [x1];
cmp xlll2, 0u0;
jme print_end;
write xlll0, xlll2;
inc x1;
jmp print;
print_end:
halt;