The code does alot of IO port operations. Keil uses SFR and SBIT declarations whereas the AVR code uses defines to set IO port locations and byte operations to set/clear/test bits. There has to be a better way than slogging through the text conversion and then slogging through the debug???
If minimizing code change is the priority, then you could continue to use #defines to reference the I/O port addresses, and byte operations to set bits. The 8051 provides byte-wide access to the I/O bits via the port SFR addresses (0x80, 0x90, etc). The bit operations are more efficient, but it's not the only way to set bits in a port.