Skip to content

Commit

Permalink
more
Browse files Browse the repository at this point in the history
  • Loading branch information
joncampbell123 committed Jul 31, 2018
1 parent 4da62e7 commit 824fa47
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
3 changes: 3 additions & 0 deletions tool/linker/ex7/drvc.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@ static void dos_puts(const char *p) {
dos_putc(c);
}

void entry2(void);

unsigned int near entry_c(void) {
dos_puts(hello_world);
dos_puts(hellostr2);
entry2();
return 0;
}

11 changes: 8 additions & 3 deletions tool/linker/ex7/drvc2.c
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@

extern const char hellostr2[];

const char hello_world[] = "Hello world. This is code without a C runtime.\r\n";
static const char hello_world[] = "Hello world. This is code without a C runtime take 2.\r\n";

void dos_putc(const char c);
static void dos_putc(const char c);
#pragma aux dos_putc = \
"mov ah,0x02" \
"int 21h" \
modify [ah] \
parm [dl]

void dos_puts(const char *p) {
static void dos_puts(const char *p) {
char c;

while ((c = *p++) != 0)
dos_putc(c);
}

void entry2(void) {
dos_puts(hello_world);
dos_puts(hellostr2);
}

0 comments on commit 824fa47

Please sign in to comment.