* * inkey12.lib library file for 9s12c SBasic INKEY() function * * This file contains the support code for a SCI-based INKEY() function. * This version of INKEY() behaves a little differently from the * usual Basic INKEY() function. * * This routine returns a 0 if no character is waiting in the SCI * receive buffer. This routine returns a character, if there is one * waiting. Additionally, bit 8 is returned as 1 if a character is * returned. * * This means you can test for reception of a character by testing if * the returned value is greater than $ff. Or, you can use a returned * value of 0 to show that no character was available. In this case, you * will have to AND the returned value with $ff to recover the returned * character. * * This function ignores any value in the D-register upon entry. It * returns its result in the D-register. * * Like the normal INKEY() function, this routine does NOT echo the * received character. * _inkey brclr $cc,#$20 _norcv branch if no char ldaa #$01 get the marker ldab $cf get the char bra _inkeyx and leave _norcv clra nothing here, show it clrb _inkeyx rts and leave