1
0
mirror of https://github.com/RevCurtisP/C02.git synced 2024-11-17 15:06:29 +00:00
C02/apple1/testio.c02

35 lines
1020 B
Plaintext
Raw Normal View History

2018-01-28 19:52:58 +00:00
/*********************************************
* STRTEST - Test Library stdio.h for Apple *
*********************************************/
#include <apple1.h02>
#include <stdio.h02>
char key; //Key read from keyboard
char len; //Length of input output string
char str[128]; //String to read/write
char anykey = "Press any key to continue";
char tlines = "Type lines followed by carriage-return";
char escend = "press Escape key to end";
char utyped = "You typed: ";
main:
putstr(&anykey); //Display "Press any key" message
key = getchr(); //Wait for key press
newlin(); //Advance cursor to next line
putstr(&tlines); //Display "Type lines" message
putstr(&utyped); //Display "press Escape" message
loop:
newlin();
len = getstr(&str); //Read string from keybaord
if (len == $FF) //If entry was aborted
goto done;
prbyte(len); //Display length of entered string
putstr(&str); //Display entered string
goto loop;
done:
goto exit;