Skip to content

Input Output

Joachim Stolberg edited this page Jan 4, 2023 · 7 revisions

putchar

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;
}

putstr

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;
}

putnum

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"

puthex

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"