/*FILE: test9a.c
 *
 *DESCRIPTION:
 * This is a demonstration of how to perform block memory transfers between
 * cooperating programs running on the ARM and on the PC.
 *
 *COMPILER:  Norcroft ARM C 1.31 Feb 17 1987
 *
 */


#include <stdio>
#include <ctype>

/* Compiler feature: norcrosys is a system header file but it cannot be found
 * using <> */
#include "$.arm.clib.h.nonansi.norcrosy"

          

main()
    {

    /* Space to recieve string from PC into. */
#   define BUFFLEN 8000
    unsigned char buff[BUFFLEN];
#   define DONTCARE_INT 0
    int i;


    /* Recieve data from the PC. */
    _osfile(255, "PCMEM:", (unsigned int)buff, DONTCARE_INT, BUFFLEN,
			DONTCARE_INT);


    /* Change string to upper case. */
    for (i = 0; ( (buff[i] != '\0') && (i < BUFFLEN) ); i++)
		buff[i] = toupper(buff[i]);


    /* Send string back to PC. */
    _osfile(0, "PCMEM:", DONTCARE_INT, DONTCARE_INT, (unsigned int)buff,
            (unsigned int)(buff+strlen(buff)+1));

    }
