ditto@cbmvax.UUCP (Michael "Ford" Ditto) (11/01/88)
In article <381@uncle.UUCP> jbm@uncle.UUCP (John B. Milton) writes: [ about nkbd ] >To get it to work, I changed (in ldkout): > if (!(*C_CMND_ADDR & 2)) { >to > if (!((ushort)*C_CMND_ADDR & 0x200)) { Yeah! That's it, all right! It was just a bug in the human decompiler. The cast isn't necessary, just change 2 to 0x200 (C_CMND_ADDR is already a pointer to ushort). > Hey Ford, how did this off by one error creap in? Like this: the assembly code looked like: btst &1,0e70000 which to my brain looks like (*C_CMND_ADDR & 2) since (C_CMND_ADDR == 0xe70000). It's actually looking at bit 1 of *byte 1* (i.e., actually bit 9), because the 680x0 counts bytes backwards. I usually catch these as I go along, but this one slipped by (especially since it worked anyway on my machine). I hate Motorola byte order! -- -=] Ford [=- "The number of Unix installations (In Real Life: Mike Ditto) has grown to 10, with more expected." ford@kenobi.cts.com - The Unix Programmer's Manual, ...!sdcsvax!crash!elgar!ford 2nd Edition, June, 1972. ditto@cbmvax.commodore.com