[Coco] Re: [Color Computer] Inkey for Microware C Compiler

Gene Heskett gene.heskett at verizon.net
Sun Dec 7 08:30:00 EST 2003


On Saturday 06 December 2003 23:03, Mannequin* wrote:
>On Sat, 06 Dec 2003 22:03:31 -0500
>
>jdaggett-vLP2nKBMwiY at public.gmane.org wrote:
>> Correct
>>
>> basically you bracket your assembly code with
>> c code
>>
>> #asm
>>
>> assembly code
>>
>> #endasm
>>
>> more c code
>>
>> The compiler recognizes the #asm and #endasm and passes that
>> code throught to the rma.
>>
>> Be sure to use "endsect" after variables. The compiler assumes
>> assembly code as psect code.
>>
>> james
>
>I'm afraid I know absolutely nothing about assembly language or how
> to implement it in to a C program. (Although, while I was playing
> around here with the source for InKey, I did manage to learn a
> little, but not enough to help this problem in any way.)
>
>Anyway, I was hoping there was someway you could call the inkey that
>came with Basic09, OS-9 LII. But so far, all of my attempts have
> been in vain.
>
>As for Gene's reply, if I could get an example to study the
>implementation of how he used getc (*path, buf) and ungetc (*path,
> buf) in order to emulate inkey, I would appreciate it. :)

To be fair, what I gave there as an example is blocking if there isn't 
a character to read, one really should make use of the _os9 i$getstt 
call as mentioned in a previous message this morning to acertain that 
there is indeed a character or more to read, thereby giving you the 
opportunity to do something else if the buffer is empty.  If yopu 
don't have anything else for it to do, then make sleep calls, thereby 
unloading the cpu for other stuff, in a loop that wakes up to see if 
anythings been typed while napping.

>If anyone has played with the old Microsoft C and Borland compilers,
>they had a function that was declared in the conio.h header. (I
> think Borland still might support the old 'getch ()' function, but
> I think Microsoft has long forgot terminal support.) Anyway, 'getch
> ()' is more of what I'm looking for.
>
>Thanks again.
>-Mannequin*
>
>------------------------ Yahoo! Groups Sponsor
> ---------------------~--> Buy Ink Cartridges or Refill Kits for
> your HP, Epson, Canon or Lexmark Printer at MyInks.com. Free s/h on
> orders $50 or more to the US & Canada.
> http://www.c1tracking.com/l.asp?cid=5511
>http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/CFFolB/TM
>--------------------------------------------------------------------
>-~->
>
>Brought to you by the 6809, the 6803 and their cousins!
>
>Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/

-- 
Cheers, Gene
AMD K6-III at 500mhz 320M
Athlon1600XP at 1400mhz  512M
99.22% setiathome rank, not too shabby for a WV hillbilly
Yahoo.com attornies please note, additions to this message
by Gene Heskett are:
Copyright 2003 by Maurice Eugene Heskett, all rights reserved.




More information about the Coco mailing list