??? 09/24/04 13:15 Read: times |
#78065 - RE: now my ACALL is working.why? Responding to: ???'s previous message |
because t he linker happened to locate the module all in one page. I don't think that could be the reason. Once I experienced that my program crashed after a little change, and I was, of course concentrated on that change to find the error. There was no error at all. At last, I found what caused the crash. By adding few instructions, all following code is moved higher. Among them (on quite a different place) there was an ACALL. It was now divided (opcode is 2 bytes) so that the first byte of opcode was the last in the 2kb page, and the second was first in the next page ! The assembler could not notice that the routine was out of range, because it was still in the same page where ACALL began. As the consequence, instead of return to the code after ACALL (in the higher page) it returned to the lower page - the second byte in it ! So, a seldom, but possible error, which can not be discovered by assembler, takes place when the first opcode byte of ACALL (it's 11h) happens to be the last in the 2kb page, on addresses: xxxx x111 1111 1111b. Regards, Slobodan |