36 lines
446 B
Fortran
36 lines
446 B
Fortran
/**
|
|
* Constants
|
|
*/
|
|
const str nl = "\n";
|
|
|
|
plex Terminal {
|
|
nat handle;
|
|
|
|
init() {
|
|
handle = open("/dev/term/0", 0);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Main function
|
|
*/
|
|
function main() {
|
|
pln(add(1, 1).str);
|
|
}
|
|
|
|
/**
|
|
* Add two numbers together
|
|
*/
|
|
function add(int a, int b) int {
|
|
return a + b;
|
|
}
|
|
|
|
/**
|
|
* Print with a newline
|
|
*/
|
|
function pln(str message) {
|
|
Terminal term();
|
|
write(term, message, message.length);
|
|
write(term, nl, nl.length);
|
|
}
|