CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Code for getch()

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
ac34856



Joined: 14 Dec 2009
Posts: 33
Location: Wales

View user's profile Send private message

Code for getch()
PostPosted: Tue Feb 23, 2010 12:56 pm     Reply with quote

I'd like to modify the code for getc() or getch() or getchar().
Is this defined somewhere, I cant find it ?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Feb 23, 2010 1:06 pm     Reply with quote

There is no C source code for it. To see the ASM code, make a test
program, compile it, and look at the .LST file. This thread has an
example of how to do that:
http://www.ccsinfo.com/forum/viewtopic.php?t=38623
Ttelmah
Guest







PostPosted: Tue Feb 23, 2010 3:49 pm     Reply with quote

You also, don't have to.
Just write your own. Call it something like 'my_getc', and use this. This is what you do for anything like buffered I/O. The standard code, is not loaded, unless used, so don't worry about it.....
On the latest compiler, you can tell the code to use separate routines, avoiding the need to use a different name.

Best Wishes
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Feb 23, 2010 3:58 pm     Reply with quote

This thread has an example of a my_getc() function:
http://www.ccsinfo.com/forum/viewtopic.php?t=26631
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group