x86 for the linear language

This commit is contained in:
Dmitry Boulytchev 2018-03-04 23:13:08 +03:00
parent 4ff1bf9858
commit 64172f66d3
9 changed files with 57 additions and 18 deletions

22
runtime/runtime.c Normal file
View file

@ -0,0 +1,22 @@
/* Runtime library */
# include <stdio.h>
/* Lread is an implementation of the "read" construct */
extern int Lread () {
int result;
printf ("> ");
fflush (stdout);
scanf ("%d", &result);
return result;
}
/* Lwrite is an implementation of the "write" construct */
extern int Lwrite (int n) {
printf ("%d\n", n);
fflush (stdout);
return 0;
}