Crossware

Table of Contents        Previous topic       Next topic       

COMPILER LIBRARY FUNCTIONS->Detailed Descriptions->getch()

Summary

#include "conio.h"
int getch();    Read a character from console


Description

This function gets a character from the console.  The routine is implementation specific and will need to be created to suit your target system.  The example version included in the library consists of the following assembler code:

 xdef _getch
_getch
 trap #11
 dc.w 13    Monitor command 'getch'
 ext.w     D0    Character is placed in D0.B by monitor
 ext.l     D0    Need to extend to int
 rts


Return Value

The return value is an integer formed by signed extending the ASCII byte, with bit 7 forced to zero, received at the input.  If the character was break then program execution is aborted.