; stdio.h -- Standard interface definitons for the Hawk monitor I/O support. ; Linkage conventions: ; R1 -- used for linkage by all support routines. ; R2 -- typically used internally as an activation record pointer. ; R3 -- typically the first parameter and function return value ; R4 -- typically the second parameter, if there is one. ;------------------------------- ; linkage to monitor display management routines EXT PUTAT ; set display text coordinates ; takes R3=column/X R4=row/Y (origin in top left) ; wipes out R3-7 ; uses 3 words of stack ; C equivalent: none EXT PUTCHAR ; output one character ; takes R3=character ; wipes out R4-5 ; uses 1-3 words of stack ; C equivalent: putchar(ch) EXT PUTS ; output one null terminated string (std C, adds LF) ; takes R3=string pointer ; wipes out R3-7 ; calls PUTCHAR (which uses 1-3 words of stack) ; C equivalent: puts(string) EXT PUTSTR ; output one null terminated string (without LF) ; takes R3=string pointer ; wipes out R3-7 ; calls PUTCHAR (which uses 1-3 words of stack) ; C equivalent: fputs(string,stdout) EXT PUTHEX ; output integer in hexadecimal ; takes R3=integer to print ; takes R4=field width ; wipes out R3-7 ; uses 3 words of stack ; calls PUTCHAR (which uses 1-3 words of stack) ; C equivalent: printf("%*X",width,integer) EXT PUTDEC ; output signed integer in decimal EXT PUTDECU ; output unsigned integer in decimal ; takes R3=integer to print ; takes R4=field width ; wipes out R3-6 ; uses up to 11 words of stack (recursively) ; calls PUTCHAR (which uses 3 words of stack) ; C equivalent: printf("%*d",width,integer) ; C equivalent: printf("%*u",width,integer) ;------------------------------- ; linkage to monitor keyboard interface EXT GETCHAR ; get a character from the keyboard (std C) ; returns R3=character ; wipes out R4 EXT GETS ; get null-terminated string from keyboard (std C) ; takes R3=pointer to string buffer ; wipes out R3-7 ; calls PUTCHAR (which uses 3 words of stack) ; calls GETCHAR (which uses 3 words of stack) ;------------------------------- ; linkage to monitor terminal description EXT TERMINFO; a global structure with two fields TERMROWS= 0 ; the number of rows on the screen (height) TERMCOLS= 4 ; the number of columns on the screen (height) ;------------------------------- ; strange accident that NULL is defined here NULL = 0