-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
37ad3b3
commit e98d642
Showing
4 changed files
with
33 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ void _start(void) | |
{ | ||
asm ("law 04000"); | ||
asm ("dac 209"); | ||
asm ("law 03000"); | ||
asm ("dac 208"); | ||
|
||
int c; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
include ../common/common.mk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
static void putc(); | ||
|
||
static void foo(int); | ||
|
||
void _start(void) | ||
{ | ||
/* TODO: handle sp/fp init better -- separate crt0.S? */ | ||
asm ("law 03000"); | ||
asm ("dac 209"); | ||
asm ("law 04000"); | ||
asm ("dac 208"); | ||
|
||
foo(20); | ||
|
||
asm ("hlt"); | ||
__builtin_unreachable(); | ||
} | ||
|
||
static void putc() { | ||
asm ("lio %0" : : "r"(027) : "io"); | ||
asm ("tyo"); | ||
} | ||
|
||
static void foo(int n) | ||
{ | ||
if (n != 0) { | ||
putc(); | ||
foo(n - 1); | ||
} | ||
} |