How do you get the characters from the serial port buffer register? If you simply read them in a loop like
void main() {
char c;
while (1) {
c=SBUF;
do_something(c);
}
}
Then you will miss characters once the execution time of do_something() gets longer. Note that this includes time spend in intterrupts. The 8051 serial port has no hardware fifos, a character will be overwritten by the next one if it was not read in time.
Our solution was to read the characters into a Ringbuffer during the serial Intterupt, and to use the FIFO in the main loop. Works (with high priority interrupt) for 460800 Baud with 7,3728 MHz crystal on a Silabs 80C51FXXX.
Update
As we now see the source coude, the bug is now clear: You wait in the main loop for your character to be sent. But that means you wait a whole "character time" without being able to read your interrupt character buffer, and another few cyles to detect and read the next. This is too long if the sender sends characters fast, as a PC does.
Chances are that you outgrow the 8051 after your first project, so I'd rather invest in a more performant development board with a more modern microcontroller. You'll also find a more active community around them, which as far as support goes is worth at least several books.
In the 8-bit arena the PIC is very popular due to the wide offering by Microchip.
But the most popular these days is Arduino, based on a performant AVR. There's a handful of Arduino development boards, which can be extended with boards for specific functions. Arduino uses its own programming language.
If you want to be safe for a long time performance-wise, the 32-bit ARM is the way to go. There's a great many manufacturers offering ARM controllers, ranging from very basic to complete SoCs. NXP is just one of them.
Probably one of the easiest ways to get started with ARM is mbed.
Best Answer
In short, and in this context, the whole 11-bit address area that is accessible with the ACALL instruction is divided to eight areas called pages that are 256 bytes each.
As the ACALL opcode follows only a single byte which defines the 8 least significant bits of the address, there needs to be 8 different ACALL opcodes that define the high 3 bits - the page.