2020-10-13 21:18:46 +00:00
|
|
|
/**************************************
|
|
|
|
* SIOTEST - Test/Demo module stdio.h *
|
|
|
|
**************************************/
|
2020-10-13 16:42:03 +00:00
|
|
|
|
|
|
|
//Specify System Header using -H option
|
|
|
|
#include <stddef.h02>
|
|
|
|
#include <stdio.h02>
|
2020-10-13 21:18:46 +00:00
|
|
|
#include <keydef.h02>
|
2020-10-13 16:42:03 +00:00
|
|
|
|
|
|
|
char key; //Key read from keyboard
|
|
|
|
char len; //Length of input output string
|
|
|
|
char str[128]; //String to read/write
|
|
|
|
|
|
|
|
main:
|
|
|
|
putsub(17, "ERROR IN PUTSUB! PRESS ANY KEY");
|
|
|
|
newlin();
|
|
|
|
key = getc(); //Wait for key press
|
|
|
|
newlin(); //Advance cursor to next line
|
|
|
|
|
2020-10-13 21:18:46 +00:00
|
|
|
puts("TYPE LINES, END WITH "); putln(knames.return);
|
|
|
|
puts("PRESS "); puts(knames.delete); puts(" TO DELETE, ");
|
|
|
|
puts(knames.escape); putln(" TO END");
|
2020-10-13 16:42:03 +00:00
|
|
|
|
|
|
|
while () {
|
|
|
|
putc('>');
|
|
|
|
len = gets(&str); //Read string from keybaord
|
|
|
|
if (len == $FF) //If entry was aborted
|
|
|
|
break ; // return to monitor
|
|
|
|
puts("YOU TYPED: "); //Print without newline
|
|
|
|
putln(str); //print with newline
|
|
|
|
}
|
|
|
|
|
|
|
|
putln("TEST COMPLETE");
|
|
|
|
|
|
|
|
done:
|
|
|
|
goto exit;
|