
PID No. 18413B
3 of 3
/******************************************************************************/
/* This is where the processing should be placed that is to occur while */
/* awaiting user input. This program simply increments the variable "proc" to */
/* demonstrate that processing is not halted while awaiting input from */
/* standard input. */
/******************************************************************************/
proc++;
}
/* We have left the main loop. Clean up and exit. */
printf("\n\nYou have selected exit\n");
printf("The proc variable was incremented %d times.\n",proc);
printf("** Note**\n");
printf("The increments took place while you were interacting with the menu.\n");
printf("This demonstrates processing was not halted while waiting user input.\n");
}
In the above example, the statement to read the user
input from the standard input device (STDIN) is
placed within a “while” loop, followed by the code
that should not be suspended.
The
read
statement is placed in an "if" clause. The
return value from
read
determines what action takes
place. If there is valid input from STDIN, the
appropriate “case” statement is executed. If no
information is available, a –1 is returned and the
“proc++” statement is executed.
Conclusion
The number of times that the
proc
variable is
incremented in the example should be substantially
higher than the sum of the number of times that
options #1 and #2 are selected. This demonstrates
that the
proc
variable is incremented during the time
that the interactive menu is presented.
If the value of the
proc
variable displayed is equal to
the sum of the number of times that options #1 and #2
are selected, the most likely cause is that a version of
MiniMON29K prior to Release 3.0 is being used on
either the host or target system (see “Ordering
Information” below for how to order the current
release).
Suggested Reference
For more information, see the
Host Interface (HIF)
Specification, PID# 11539C
.
If You Need Assistance
Product support for the 29K Family processors is
available from our Embedded Processor Division
(EPD) Technical Support Hotlines located in the U.S.
and in the U.K.
Assistance is available in the U.S. from 9:00
A
.
M
. to
6:00
P
.
M
. central time, Monday through Friday
(except major holidays). In Europe assistance is
available during U.K. business hours. Contact us at
one of the following numbers.
To reach the U.S. hotline
From
U.S.
Japan
Any other location
=
Toll applies.
Call
1-800-2929-AMD
0031-11-1163
+1-512-602-4118
=
To reach the European hotline
From
U.K.
France
Germany
Italy
Any other location
=
Toll applies.
Call
(0)256-811101
0590-8621
0130-813875
1678-77224
+44-(0)256-811101
=
Ordering Information
To purchase the current release of the MiniMON29K
product, contact your local sales office. Portions of
the code for this product are available on the
Advanced Micro Devices (AMD) Embedded
Processor Division (EPD) Bulletin Board Service
(BBS). To call the AMD EPD BBS, set your modem
to dial
18002929263,,,,,,1
. Note that product support
and documentation are not included when using code
from the BBS.
AMD is a registered trademark, and 29K and MiniMON29K
are trademarks of Advanced Micro Devices, Inc.