That's not the same error you were talking about, right. You last said it was just rebooting, not failing to link.Mikkel wrote:I've just tried to comment some of the lines out, and it's this that makes the error:
unsigned char kbdus[128] = { 0, 27, '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '=', '\b', '\t', 'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', '[', ']', '\n', 0, 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';', '\'', '`', 0, '\\', 'z', 'x', 'c', 'v', 'b', 'n', 'm', ',', '.', '/', 0, '*', 0, ' ', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '-', 0, 0, 0, '+', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
(same as the other kbdus, just made to a single line).
without it, there's no errors (except this ofcourse dosn't work: kar=kbdus[readkey()] but with it:
kb.o(.text+0x20): In function `scanf':
: undefined reference to `memcpy'
Anyway, it looks like your compiler is resorting to calling memcpy to initialize such a huge local array. I recommend making it static, so that it does not need to be reinitialized each time the function is run. This should avoid the call to memcpy that the compiler is doing, and it's probably better anyway. On the other hand, at some point it would probably be a good idea to implement the memcpy function, since it is really easy to implement and really useful.