'this progam controls the I/O controller 'including a FIFO buffer for the keyboard input with '1 character buffer 'TODO: translate keyin to ASCII '0x0 = status, 1=ready, 0=empty '0x1 = latest key value startup: setfreq m8 put 0,0 hi2csetup i2cslave,%11100000 pause 10000 kbled %10000101 'disable LED blinking (enable capslock and scroll lock, disable numlock) main: pause 300 'sertxd("getting key") kbin b0 'grab one character 'sertxd("got key") get 0,b1 if b1=1 then main 'if status=ready, discard character put 1,b0 'if status <> ready, store character put 0,1 'update status=ready pause 400 goto main