-
Notifications
You must be signed in to change notification settings - Fork 2
Input Output
Joachim Stolberg edited this page Jan 4, 2023
·
7 revisions
Output a character to the programmer status line.
putchar(char)
char
is the character to be output. Due to the fact that all variables are 16 bit wide, two characters can be stored in one variable.
Examples:
import "sys/stdio.asm"
func foo() {
var char = 'AB';
putchar(char);
putchar('CD');
putchar('e');
return;
}
Output a string to the programmer status line.
putstr(str)
str
is the string to be output.
Examples:
import "sys/stdio.asm"
var str1 = "Hello1";
func foo() {
var str2 = "Hello2";
putstr(str1);
putstr(" ");
putstr(str2);
return;
}
Output a number in decimal representation to the programmer status line.
putnum(val)
val
is the number to be output.
Examples:
putnum(123) ==> "123"
putnum(0x20) ==> "32"
Output a number in hexadecimal representation to the programmer status line.
puthex(val)
val
is the number to be output.
Examples:
puthex(123) ==> "007B"
puthex(0x20) ==> "0020"