I had a PS/2 KB emulator running a few weeks ago. I don't have the code right in front of me, but I wrote it all in PBP.

You can use the SHIFTOUT command with no problems - just tell shiftout to only send 9 bits instead of 16.

Don't forget to calculate the parity bit (odd) and tack it on at the end.

Clock and data both idle high, so make sure you use pullup resistors.

I'll dig around and see if I can find the code later this afternoon.

John