-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhello.c
65 lines (50 loc) · 1.21 KB
/
hello.c
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
62
63
64
#include <stdio.h>
#pragma output nostreams
#pragma output nofileio
#pragma output noprotectmsdos
#pragma output noredir
#pragma output nogfxglobals
char locate_buffer[]="\033Y__";
locate(char x, char y) {
locate_buffer[2] = y+31;
locate_buffer[3] = x+31;
bdos(9, locate_buffer);
}
home() { bdos(9, "\033H"); }
clear_screen() { bdos(9, "\033H\033J"); }
delete_line() { bdos(9, "\033M"); }
insert_line() { bdos(9, "\033L"); }
clear_eol() { bdos(9, "\033K"); }
cursor_up() { bdos(9, "\033A"); }
cursor_down() { bdos(9, "\033B"); }
cursor_left() { bdos(9, "\033D"); }
cursor_right() { bdos(9, "\033C"); }
reverse_on() { bdos(9, "\033p"); }
reverse_off() { bdos(9, "\033q"); }
underline_on() { bdos(9, "\033r"); }
underline_off() { bdos(9, "\033u"); }
chain(char *string) {
char *pointer;
pointer = 0x80;
while(*string != 0) {
*pointer = *string;
pointer++;
string++;
}
*pointer = 0;
bdos(47, 0);
}
main() {
bdos(110, 0);
clear_screen();
locate(38, 16);
reverse_on();
bdos(9, "Hello, World!");
reverse_off();
locate(38, 18);
underline_on();
bdos(9, "Hello, World!");
underline_off();
locate(0, 30);
return 0;
}