port more apps

This commit is contained in:
Yanyan Jiang 2020-08-12 05:35:19 +00:00 committed by Zihao Yu
parent 673f8605ce
commit a317d8cce1
23 changed files with 5097 additions and 4 deletions

3
hello/Makefile Normal file
View file

@ -0,0 +1,3 @@
NAME = hello-am
SRCS = hello.c
include $(AM_HOME)/Makefile

13
hello/hello.c Normal file
View file

@ -0,0 +1,13 @@
#include <am.h>
#include <klib-macros.h>
int main(const char *args) {
const char *fmt =
"Hello, AbstractMachine!\n"
"mainargs = '%'.\n";
for (const char *p = fmt; *p; p++) {
(*p == '%') ? putstr(args) : putch(*p);
}
return 0;
}