aboutsummaryrefslogtreecommitdiffstats
path: root/core/hello.c
blob: a1591111dcd9dfe91c8990270be1295cb02afad0 (plain)
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
#include <stddef.h>
#include <com32.h>
#include <stdio.h>
#include <string.h>


void myputchar(int c)
{
    static com32sys_t ireg;

    if (c == '\n')
	myputchar('\r');

    ireg.eax.b[1] = 0x02;
    ireg.edx.b[0] = c;
    __intcall(0x21, &ireg, NULL);
}

void myputs(const char *str)
{
    while (*str)
	myputchar(*str++);
}

void hello(void)
{
    static char hello_str[] = "Hello, World!";

    printf("%s from (%s)\n", hello_str, __FILE__);  /* testing */
}