What's this patching of that gizmo worth to you? If you know nothing about 8051 it may be a long and difficult task. Disassembling the code will give you a listing of tens of pages where only the instructions are readable, at least for someone who knows 8051. Labels and variables are just hollow numbers, and of course it's not commented either. If the source was C instead of assembler it may even look more abstract.
The datasheet is not a great help re the programming. It mentions ISP (In System Programming) and IAP (In Application Programming), but the ISP procedure seems to include setting SFRs, so it looks like that's actually IAP as well.
ISP means that you have outside access to a microcontroller which is mounted on your product's PCB, to program it. Everything is controlled through external pins.
IAP also means programming the microcontroller inside your product, but here the microcontroller has to execute a software procedure to talk to the external programming equipment and program the Flash.
So the controller seems to need programming code to reprogram the device. It will probably use the UART for this, but the programming facility has to be programmed in the device in the first place, and most low-cost commercial devices are not made to be reprogrammed.
The datasheet doesn't say anything about programming the device on a programmer, but since it's 8051 compatible the programming may be compatible with that as well, and any legacy universal programmer may be able to program it.
You'll have to carefully remove it from the PCB, so that you can resolder it later.
Pault's AVR alternative may be a good idea. I've never used them to replace 8051's, so check the datasheet carefully, pin for pin. Pault mentions the ATMega162, and it seems the ATMega8515 is also 8051 pin-compatible. Note, however, that neither datasheets mentions anything about this.
There are sockets available for both DIP packages and SMD packages. No matter which direction you take, I would suggest using a socket. That way, if you let the smoke out, replacing the chip doesn't require desoldering and resoldering.
The choice between DIP and SMD is all about what you are more comfortable with. There is typically a larger variety of microcontrollers available in SMD. But they are also more fragile. Especially when used with a socket. If you're taking the chip in and out a lot, you will most likely bend or break some pins. The pins on a DIP are much more forgiving in this respect.
It's rare that you'll find someone taking a chip out of circuit and placing it in an off-board programmer these days. I had to do it with old school PROMs in college. But I haven't done it since. You are much better off having the JTAG on the board itself. @i.amniels mentioned in-circuit debugging being a huge advantage. I will echo that sentiment as it cannot be said enough.
There are many different JTAG connector configurations. The AVR one uses 10 pins. And you really don't have a lot of say in the footprint of the header you can choose. You have to match the pin size and pitch to your JTAGICE. Atmel has a recommendation for the part number to use to interface to the JTAGICE. I would just stick with that.
http://support.atmel.com/bin/customer.exe?=&action=viewKbEntry&id=2
Best Answer
It depends on the microcontroller of course, but in general from all commercial products you can expect that the microcontrollers are read-protected.
This means that
So yes, it is theoretically possible to reprogram the chip, but you'll have to start from scratch.
And again, the answer may be different for different chips.
Also, it might be necessary to temporarily disconnect the chip from the circuit during programming as the surrounding circuitry might interfere with the programmer.